A coworker approached us today wondering if they could get a performance boost using Samsung’s newly announced 256GB SSD. Most of their work is done in browser, so we said “no”. They’d only see benefit if they were reading/writing large files. Their system has plenty of RAM, and we decided to take a different approach. By creating a filesystem in RAM, you can read and write files much faster than on a typical hard drive. We decided to put the browser’s file cache into RAM.
We installed the Espérance DV preference pane in OSX to facilitate RAM disk creation. It’s really simple to setup. Just select how much space you want to dedicate to the disk and create it. You can have Espérance DV recreate the RAM disk on start and even have it automatically restore from a disk image. There is a check box for moving Safari’s Web Cache to the RAM disk, which creates the necessary symlink. You can also use it to speed up Xcode builds. Moving Firefox’s cache is fairly simple:
$ rm -r ~/Library/Caches/Firefox
$ ln -s /Volumes/RamDisk/Firefox ~/Library/Caches/Firefox
Since the browser isn’t having to hit the hard disk on every page load anymore, the performance is much snappier. Xbench says our random reads from RAM are now 86.19MB/sec instead of 0.61MB/sec when the cache was on the hard drive.
We immediately began looking for ways to get the entire OS into RAM; Tin Hat is a version of Linux that does that.
We’re very happy with the results of our RAM disk browser upgrade. Let us know in the comments if you’ve had a similar experience doing this in Windows.
This seems like it’s most useful for the initial startup and load of pages for the first time (that you’ve already cached).
now that is a handy thing to know.i wonder since your able to have the ram disk get created on boot is there a hack to move the whole os into ram?? did you guys ever get anywhere with that?? I think you would have to worry about data loss if the system crashed or hung up on you ,now if you could have the disk get accessed ever so often say every 5 minutes and dump the files and or changes to files to there respective places “doubtful” this might be a viable way to go I’m sure everything would feel snappier with no hard disk being needed to read and write files.
why not just increase the size of your firefox in-memory cache?
see: http://www.extremetech.com/article2/0,1697,1854520,00.asp
for those looking to load _an_ entire OS into RAM, the best solution would be to check out a linux distribution. knoppix, for example, has a ‘toram’ parameter that can be used to dump the entire OS into RAM and run from it.
as for mac os, however, you’d be looking into some uncharted territory since a lot of the mac os is closed source.
Anyone have a suggestion for window user. Any review on different application from window size. I love OSX and work on it at work. At home though, i’m still very windows oriented.
I thought that SSD’s were actually better for many, many small files.
The advantage comes from the fact that there is practically no seek time compared to hard drives.
However, once a hard drives finds a file, the actual reading of it is faster than an SSD.
could always use a hardware ram drive.
I would like to be able to create a ram disc in windows using free software.
Another free RAM disk program for Mac OS X is my own Make RAM Disk.
wow, mac users are amazed at the smallest things. really.
I also would be interested in doing this for windows. Running browsers off of USB sticks can be very slow, but if they were loaded into ram…….
My search for free software for xp for creating ram disks that can be >2gb has failed miserably.
for those wanting an entire os in ram, uh.. it might not be as hard as you think. it could involve some sort of hibernation sequence, an image of the drive is stored on a hdd or ssd, and then copied directly to ram on boot.
_matt, i thought ram drive only need to be small, say 256mb or less. Usually you would store only cached file or page fault stuff. I’m not looking to store the entire OS in ram.
well, i wouldn’t want to put an entire os in ram either, since 4gb of ram isn’t much to put an entire os onto, plus some headroom for apps.
what i do want to do is cache more than just firefox. how about a holding area for files that need to be compressed or decompressed?
decompressing a 7z from a flash drive onto the same drive takes forever, so how about extracting it to the ram disk, then transferring it back over.
or, for my laptop, copy a bunch of songs over to the ramdisk, install a lightweight mp3 player on it, and then start playing the songs, this will allow the hard drive to sleep more while I’m listening to music.
This “hack” has been extensively discussed on the linux kernel mailing list and kernel trap.
Just please, no one suggest putting a swap file in the ramdisk! :)
Well, they should!
1. Firefox loads pages slowly?
2. 1988 called, they want their DOS game speedups back.
Ha! About that I remember how incredible fast Netscape Navigator (a browser!) was loaded in Windows ’98 with a new Pentium x computer. After a while I switched to newest Firefox. Is was (and is today) loading so slow that I asked myself “is is compiling the browser right now?”
Most of the Mac user community moved away from the need for Ram Disks around the time MacOs 8.1 came out, even more so when we moved to OSX…….
And imagine your lappy saving battery by spinnig the HDD once a few minutes
Jaysus, that’s all so lame. Firefox stores data in RAM if the disk cache is set to 0. Of course, you lose cache data once it’s over, but in the meantime it works waaaay much snappier.
Putting the disk cache in RAM is just like trying to put the SWAP in RAM. Doesn’t it sound, erm, useless?
Well, NO, since the RAM is MUCH faster.
wow.. seriously.. this is old school Amiga territory. the ram disk was usually implemented by default during os installation, and on all but the lamest cpu upgrade cards, kickstart and the os were loaded directly to a partitioned ram drive.
sadly, the official implementation of the ramdisk did nothing for saving your work in a crash. but, im sure there were many shareware fixes for that.
Its kind of sad that something like this needed to be ‘rediscovered.’ I have for a long time lameted the lack of a ram disk on my pc, as well as a truely good file manager. explorer has been s#^t from day one, and still is.
I’m sorry, wtf is wrong with you people? Putting the disk cache in a ramdisk? That’s beyond fail.
Go to about:config, set browser.cache.disk.enable to false. There. Firefox will use only RAM.
Oh and welcome to 2008 and the wonders of modern memory management.
Strange, I justed moved the Firefox Cache folder to a RAM disk, then i set browser.cache.disk.enable to false, browser.cache.disk.size to 0 and deleted the Profiles folder and the .DS_Store in the Cache folder.
Then I started FF and it recreated those Files, claiming 2 MB of space
One should assume it would not to this once browser.cache.disk.enable is set to false
Well, if you disable disk.cache doesn’t it ditch caching altogether? Then wouldn’t it surf slower anyway? OK it won’t use harddisk for retrieving cached data, but it will wait for downloading them, am I wrong?
I installed RAMDrive, set a 512MB drive, and pointed Firefox disk cache to a directory in it. Now I hardly restart my machine, it either goes to stand-by, or hibernation. In both cases, cached files are always in RAMDrive (~8MB now).
Firefox has a snappier feel now.
Plus, I created a pagefile in my RAMDrive, and disabled C: altogether. XP feels snappier, too.
But maybe I am just making up that progress, who knows.
I downloaded RAMDisk from here:
http://www.mydigitallife.info/2007/05/27/free-ramdisk-for-windows-vista-xp-2000-and-2003-server/
K.
Pffft I run my OS in RAM all the time. You can make any old PC into a monster that way.
Really leets run it all in cache!
article mentions no pricing yet, so who’s the supplier source for the ssd and what’s the price?
just to possibly fix the firefox problem that a few people i know were running into with those terminal commands, these are working:
rm -r ~/library/caches/firefox
mkdir /volumes/ramdisk/firefox\ \(\cache\)
ln -s /volumes/ramdisk/firefox\ \(\cache\) ~/library/caches/firefox
removes cache folder
makes new cache folder in RamDisk
creates symlink from HD to RamDisk
My brother used to boot Windows from RAM. I think he was using Windows 98 or 2000. I dont think it is possible for XP. Yes, I realize this article is about MAC but some commments have come up about Windows
lol macfags
DOS had RAM drives in 1983.
Is nobody ever reading an article beyond the first two lines?
The SSD was only the reason to try a RAM disk. An SSD is a harddrive that uses RAM instead of a spinning disk. A RAM disk on the other hand is a software that simulates a harddisk using the RAM of your PC.
Even though they were both mentioned in a single article, they are something fundamentally different.
But apart form that, any kind of disk cahe is used if the RAM cahce is not suffifcient. If redirecting disk cache back into RAM makes a program faster, then the program is configured badly.
It’s an improvement on a RAM cache if the RAMdisk is persisted on login/logout (which it is, if you tick the box).
Wouldn’t setting the browser cache size to 0mb (to not cache to the drive) automatically save the cache to ram?
i have heard stories about this. apparently they used to do this more back in the old days when hard disks were really slow. and they were searching through “large” files (aka 50-100 kilo Byte)i have heard good things. one idea someone at my school is practicing is installing programs then copying the entire install files into ram before using.
Puppy Linux runs completely in RAM if it can.
http://www.puppylinux.org/home
Old trick I used ram disks on my Amiga to speed things up.
what’s with all of the flamers on here? geez. This may be old news to some people, but I see a lot of potential here.
Sure, you can set the disk cache to 0 in FF, but now I can have one centralized place (the ramdisk) for ALL my apps, so I don’t have to go to each program and their own memory use.
awesome hack, i’ll give it a shot
~/library/caches/firefox doesn’t exist on my system?
They’re capitalized in the system, just not here, cause caps aren’t cool.
is there one for safari?
i notice some pages take a long time to even resolve they just sit at contacting.
i am thinking maybe safari or the underlying resources are making room in the cache to place the new files so if it could be done entirely in ram so the only time it ever gets written to disk is when ram gets full and spills over to the virtual memory.
note to moderators there seems to be a problem with yahoo it is no longer receiving the anti bot confirmation email so sorry for the duplicate post.
is there one for safari?
i notice some pages take a long time to even resolve they just sit at contacting.
i am thinking maybe safari or the underlying resources are making room in the cache to place the new files so if it could be done entirely in ram so the only time it ever gets written to disk is when ram gets full and spills over to the virtual memory.
tin hat got stuck in an endless loop booting trying to load my sata drive or something. then i shut it off and tried again without my sata drive connected and it got farther and rebooted itself.
hooray!
I have a crazy idea…
What if you have an PC emulator like Qemu running a distro of Linux that just runs a ram drive with the memory pre-allocated by the emulator? Then have like a samba server or something to interface with the virtual ramdisk that runs on application layer of the host machine. Like having a networked drive subst’ed in that redirects to the virtual machine running the ramdrive that allows the user to drag-drop files and/or execute them. Is this idea plausible or is there a fatal flaw(s) in this design?
I remember running the entire OS on Mac OS 7 from a ram disk – simply create the ramdisk, copy The system folder accross (one drag and drop action), set the new ramdisk as the boot drive and reboot. Easy.
Ahh – back when an operating system was easily managed from within a single directory.
Awesome and mindblowing.
89.16 mbps vs 0.61 mbps. Thats something to think about.
Did you try that from Linux live CD.
I’ve been doing this for years and years. My main reason for it was that I noticed that when I did a did repair, it was often the files in the browsercache that were broken. Also, it’s refreshing that a reboot would really get rid of browser poo. The only downside is that Camino (my preferred browser) loses it’s favicons in the fav’s bar. I can live with that.
Useless trivia re: the Amiga – Despite its better known ram disk, there was also the fixed size Rad: ram disk device driver that would keep its contents after a reboot. Great way to diskcopy workbench or the first disk of a multidisk game.
I used to do this on my PCjr. I had 2megs of ram and used 720k of it to run a ram drive. Suddenly 4.77Mhz didn’t seem so slow…
Did you ever fart so hard you ended up in another zip code?
I am barack obama and I approve this article
what other advantages could creating a ramdisk have besides browsing advantages?
That is really cool.