What I add to tmpfs in FreeBSD.




In order to reduce the load on the filesystem and the solid state drive (ssd disk) by reducing the amount of overwrites to the ssd disk in tmpfs I am adding some directories to the temporary filesystem. FreeBSD as well as GNU/Linux supports tmpfs. To reduce wear and tear on your ssd disk it is a good idea to add the most frequently rewritten directories on the operating system, data that does not need to be stored for long periods of time. In my example these directories are






Yes I put ports in tmpfs because building ports creates temporary files and I need to update them before building the port anyway. For example Gentoo GNU/Linux downloads tens of gigabytes during portage builds and deletes them after completing the operation. FreeBSD does not pump that many files during the ports build, however putting /usr/ports into tmpfs also reduces the number of ssd overwrites.

An example of my fstab file looks like this:


tmpfs            /var/log/    tmpfs    rw        0    0

tmpfs            /tmp    tmpfs    rw,mode=777        0    0
tmpfs            /var/tmp/    tmpfs    rw        0    0
tmpfs            /var/cache/    tmpfs    rw        0    0
tmpfs            /usr/ports    tmpfs    rw    0    0



This gives all the memory space to these directories. If your user is also on an ssd you can add the browser cache to tmpfs in a similar way. I do not touch the browser cache because my home is on the hdd, but in this case it makes sense to put the browser cache in tmpfs, speeding up the web browsers you use. For me acceleration of web browsers is not a priority in my system the speed of my main (Firefox) web browser is fine at the moment.