Page 1 of 1

[DONE]Cache in ramdisk

PostPosted: Jun 16th, '16, 09:13
by mackowiakp
Can i move all $HOME/.cache files/dirs to tmpfs filesystem? I want to reduce write cycles on SSD disk. I know how to create tmpfs via fstab and mount it in place $HOME/.cache. But will it have unexpected impact for whole system work? I have 32 GB RAM and at this moment $HOME/.cache occupies aprox 2,4 GB on SSD.

Re: Cache in ramdisk

PostPosted: Jun 16th, '16, 17:36
by doktor5000
What unexpected impact for the whole system? Your system itself doesn't care about $HOME/.cache
But you should limit the size of the tmpfs, as by default it uses half of the overall RAM. And don't only overmount $HOME/.cache with a tmpfs but copy the contents into the tmpfs once it's mounted ...

FWIW, I wouldn't waste RAM for that. Have you at least measured how many writes are going there, compared to other, hotter disk spots? Or are you simply doing this out of the blue ?

Re: Cache in ramdisk

PostPosted: Jun 16th, '16, 20:16
by jiml8
I also would not worry about write cycles on the SSD. Modern SSDs are capable of enough write cycles that you probably will want to replace it with a higher capacity version well before it is worn out.

For reference, I have my home directory located on a 500 GB SSD which is shared with several VMs that I use for development, thus large compiles with lots of I/O and lots of writes occur on this device. I installed it in October of 2014 and as of now it is 78% full and the wear leveling count, as reported by smartctl, is 15. The device is rated for a wear leveling count of 100. Thus, based upon my usage, wearout will occur approximately 9 years from now. My other SSD, which hosts / as well as a number of other VMs, shows a wear leveling count of 8, so it should be good for about another 19 years.

I support a friend's computer, and I installed a 1 TB SSD in her machine about 16 months ago. This machine runs Mageia as its host, and supports 2 Windows 7 VMs. She is clueless and does not take any action to optimize her machine. She also has had some problems, and recopying backup VMs back onto her SSD to fix Windows problems has happened several times. Her SSD currently shows a wear leveling count of 37, which is very high, and gives a total projected life of only another 2.25 years. I doubt your usage will be as heavy as hers, and if she were not so clueless, her usage would not be that heavy either.

Re: [DONE]Cache in ramdisk

PostPosted: Jun 17th, '16, 13:15
by mackowiakp
OK. you convinced me !