how to mount /usr/lib and other Dirs in RAM
i read that it can massively improve responsiveness to mount certain directories in RAM (one guy claimed it can make firefox open in under half a second)
i can see the benefit of doing this, but how would i go about doing so? in particular how could i get it to write the modified files back to /usr?
fyi the ones i think would have greatest impact are
/usr/bin /usr/sbin /usr/lib and /lib
(I believe some servers use it to speed access times to large databases, etc.)
Yes it can be done by creating a ram disk, copying to it, & remounting onto it.
If you're still interested, look up 'ram disks'.
You have to create a custom initrd to do this, with a modified init-script that copies the contents of the directories to a tmpfs and then mounts that tmpfs as the directory you want to have in RAM.
I think it would be far easier to load the whole system in RAM, instead. Also, keep in mind that this will:
- have a negative effect on boot time.
- use much of your RAM, that can't be used for your applications. If you don't have enough RAM for the file-system and your applications the system will start to swap, which will slow down your system.
- only accelerate the first start of an application. If you have enough RAM to mount entire file-systems into it then your application will most likely be cached anyways after the first start.
So this can be a project for a nice learning experience, but I wouldn't recommend it for everyday use.
|All times are GMT -5. The time now is 11:47 AM.|