Friday, April 1, 2011

Speed ​​up Firefox using RAM memory and tmpfs


Taking advantage of the recent release of Firefox 4, Sir, to tell you about this little trick I learned a long time ago already. In GNU/Linux we can ride sectors like RAM storage locations, Ie we can hang the directory tree.

And just what we can do is that our firefox profile resides in one of these sectors of the RAM, which leads to the whole feel faster, the searches in the awesome bar and history are, in our eyes , Snapshots, etc. because, as we all know, RAM is faster than the hard. Addition, another benefit is that if they use a SDD drive, reduce the amount of writing to disk.

But How is that? I asked. It is very easy even from that I know the trick to this day, has become even easier to implement than before. And you can apply to two things: Only the cache or the entire profile. I will explain them both systems .

Using only RAM cache:

We entered the about:config our browser and create a new entry type string and value we put:
browser.cache.disk.parent_directory
Now we double-click above the new entry as the value we put the new folder from memory:
/dev/shm/firefox-cache
And ,so we can only create the folder in question in a console:
mkdir -m0700 /dev/shm/firefox-cache
Ready, when they restart Firefox, you'll be using the RAM for the entire cache.

Spending all the RAM profile:

The other way is a bit more complicated but also gives better results. Although, on the other side, going all the RAM, this being ephemeral, we have a script that will copy what's in memory to disk to preserve all that information. Because otherwise, when you turn the PC would lose everything done in Firefox in that session.

So get to work, first make a backup of our profile:
tar zcvfp ~/firefox_profile_backup.tar.gz ~/.mozilla/firefox/xyz.default
xyz is the number or code for your profile, it's always different. Now run the script that will synchronize. which we can download it from AUR with a simple:
yaourt -S firefox-sync
And ready. The first time you run Firefox-sync, everything will be created and synchronized with our profile. The consecutive times, which will be lowering the RAM to disk to protect data. Now we just prevent the process is done automatically, to avoid having to run the script every time you turn on your PC, so that we create a cron task:
$ crontab -e
And add:
*/30 * * * * ~/bin/firefox-sync
For every 30 minutes synchronize. The value is optional, can give 40, 20 or 5 minutes if desired.

And now, we add at the beginning and end of session for as long as you begin this sync:
$ echo '~/bin/firefox-sync' | tee -a ~/.bash_logout ~/.bash_login >/dev/null
Well, that's all. If you try, discuss how they fared .
If this article was useful and you want to help us to grow Subscribing to our feed or Click "Like" in our Facebook page ,or follow us via Twitter or subscribing to our feed.

People who read this post also read :



0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More