LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-17-2010, 01:41 AM   #1
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Relocating Firefox cache to RAM not working


Firefox has this nasty habit of wanting to write to disk just as it's spinning down when I'm on battery...this is of course annoying because it'll probably shorten the life of the disk (it's doing it as I type this post!)

I figured that a solution to that would be to set FF's cache to be in a RAM disk instead of on the hard disk, so I tried following this guide on the Arch Wiki to set it up (the "Relocating only the cache" section). I followed it to the T, and it did nothing to change FF's disk usage. I even tried adding a /tmp entry in /etc/fstab that would supposedly mount /tmp on a RAM disk and pointed FF's cache to that...still no cigar.

My /etc/fstab:

Code:
# 
# /etc/fstab: static file system information
#
# <file system>        <dir>         <type>    <options>          <dump> <pass>
devpts                 /dev/pts      devpts    defaults            0      0
shm                    /dev/shm      tmpfs     nodev,nosuid        0      0
none		       /tmp          tmpfs     noexec,nosuid,nodev 1      2

#/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0
#/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0
#/dev/fd0               /media/fl   auto    user,noauto             0      0

UUID=4e323b77-6fb1-4ea6-ad15-51fec2629bdb swap swap defaults 0 0
UUID=502aed13-0ada-49bc-984b-eecf04289c4e /home ext3 defaults 0 1
UUID=87f32edf-ae96-447d-bd8a-2c3626c7b9a1 / ext3 defaults 0 1
UUID=a146e7a7-7b2f-49cd-a928-1be6f75e60d3 /boot ext2 defaults 0 1
Relevant about:config settings:

Quote:
browser.cache.disk.enable = false
browser.cache.disk.parent_directory = /dev/shm/firefox-cache
Screenshot for proof.

What is it that I'm missing here? Is my fstab incorrect? Is there something else I need to do in FF? I've searched Google and LQ about this issue and couldn't find anything other than the same instructions found on the Arch Wiki and the /tmp fstab entry idea.

Last edited by MrCode; 12-17-2010 at 01:43 AM.
 
Old 12-17-2010, 02:49 AM   #2
barriehie
Member
 
Registered: Nov 2010
Distribution: Debian Lenny
Posts: 136
Blog Entries: 1

Rep: Reputation: 23
I've got mine using RAM:
Code:
browser.cache.disk.enable;true
browser.cache.disk.parent_directory;/media/ramdisk/
Perhaps change:
Code:
browser.cache.disk.parent_directory = /dev/shm/firefox-cache
to
Code:
browser.cache.disk.parent_directory = /dev/shm/
FF will make a folder there called Cache to store the file(s) in.

HTH,
 
Old 12-17-2010, 02:58 AM   #3
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864

Original Poster
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
Quote:
Perhaps change:
Code:
browser.cache.disk.parent_directory = /dev/shm/firefox-cache
to
Code:
browser.cache.disk.parent_directory = /dev/shm/
FF will make a folder there called Cache to store the file(s) in.
Thanks, that made it create a "Cache" directory, but it's still waking up the HDD any time I'm scrolling or navigating pages. Perhaps this isn't an issue of the cache? Honestly I don't know what else it could be.

I'll keep looking though...
 
Old 12-17-2010, 09:47 AM   #4
barriehie
Member
 
Registered: Nov 2010
Distribution: Debian Lenny
Posts: 136
Blog Entries: 1

Rep: Reputation: 23
Does it exhibit the same when you launch it in safe mode?
 
Old 12-17-2010, 09:53 AM   #5
djsmiley2k
Member
 
Registered: Feb 2005
Location: Coventry, UK
Distribution: Home: Gentoo x86/amd64, Debian ppc. Work: Ubuntu, SuSe, CentOS
Posts: 343
Blog Entries: 1

Rep: Reputation: 72
It could be reading cookies, checking history - not everything is stored in the cache I'm presuming...

Someone else had a guide for moving everything that firefox does into a ramdisk. I've done this at home but I dont know if it'd stop the issue your having. I'll see if I can dig out the link.

[EDIT]

Found it : http://www.verot.net/firefox_tmpfs.htm

Last edited by djsmiley2k; 12-17-2010 at 10:10 AM. Reason: adding link for tmpfs firefox
 
Old 12-18-2010, 08:40 AM   #6
MrCode
Member
 
Registered: Aug 2009
Location: Oregon, USA
Distribution: Arch
Posts: 864

Original Poster
Blog Entries: 31

Rep: Reputation: 148Reputation: 148
@djsmiley2k

Sorry for the late reply...I kinda got sidetracked.

I followed the guide you linked to (with a few modifications to apply to my system), and so far, things are looking a lot better disk-usage-wise with FF. Thanks.

I'm gonna go ahead and mark this solved, but I'm still sort of "field-testing" this setup. Basically the only modification I did was to point my FF shortcut to a shell script that runs the rsync script before and after running FF itself (to load/save the profile, respectively), and so far it's working just fine. I'm not sure if that covers everything, though (although intuitively I don't see why it wouldn't), so hopefully things work out in the long run.

Thanks again for your help!

Last edited by MrCode; 12-18-2010 at 08:41 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to increase disk cache and maximize RAM usage? Maria Red Hat 0 10-21-2007 02:07 AM
Ram wiht suse, cache Disk cache??? fadelhomsi Linux - Newbie 2 02-05-2006 11:29 PM
firefox cache location? detpenguin Linux - Software 1 07-13-2005 03:04 PM
Problems with disk cache and ram xvanhessianx Linux - General 5 03-19-2005 07:42 PM
diff bet RAM & CACHE memory LinuxTiro Linux - Hardware 1 08-30-2003 12:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration