Some questions about /tmp to tmpfs

I have some questions about the above post.

what does this mean ?

make /tmp to tmpfs

Would I just rename /tmp ?

I use Seamonkey which is Mozilla based.

How would I move my profile (not cache!) to tmpfs speeds up ?

To move /tmp to RAM you need to modify /etc/fstab. Here’s an example:

tmpfs /tmp tmpfs defaults,noatime,nosuid,nodev,mode=1777,size=2048M 0 0

Adjust the amount of RAM to be allocated for /tmp (“size=2048M”) according to the specs of your system, keeping in mind that the maximum amount is not automagically used or reserved - it’s just the absolute max it can use. 2 gig is plenty.

Some thoughts on the issue by Dustin Kirkland:
https://insights.ubuntu.com/2016/01/20/data-driven-analysis-tmp-on-tmpfs/

As for moving Firefox profile to tmpfs: I’ll address that in a separate post. Soon.

1 Like

Thanks.

I found this but it looks pretty complicated.

https://www.verot.net/firefox_tmpfs.htm

Please do not mess with Firefox’s own cache settings, they are fine just as they are.

When finding solutions in the interwebs, always check when they were published. The post in Gentoo forums (referred to in the article you linked to) was made in December 2008. Ask yourself a question: is this solution still accurate? Is it possible that the underlying technology has changed / developed since then?

Hint: Firefox was at version 2. The cache management “internals” have change a couple of times since then. Also, cache is no longer under the profile directory (it’s in ~/.cache/mozilla/firefox), so there’s no need to be concerned about the size of the cache when moving the profile into RAM.

That said, my custom made script is somewhat similar to what is suggested in the verot.net article; it uses rsync but is a bit more “sophisticated” (more error checking, keeps log and requires no changes to fstab). I’m not just ready to post it here, because then I would have to support it and answer questions about it.

For a ready-made solution you could take a look at Graysky’s profile-sync-daemon:
https://github.com/graysky2/profile-sync-daemon

It manages other browsers as well and is available in Ubuntu official repos for 16.10+ and via Graysky’s PPA for 16.04. This is the script that inspired me to “roll my own” (the script had some shortcomings, IMHO, back in 2011).

1 Like

Forgot to say: In my tests moving Firefox cache into RAM did not speed up browsing. It actually seemed to slow things down a bit, so I figured it is not worth it.

Moving the profile directory to tmpfs does speed things up noticeably because a lot of the Firefox settings (cookies + browsing history etc.) frequently updated data is in Sqlite databases. With the databases in RAM there’s no I/O overhead.

I can not figure out how to Install the profile-sync-daemonAUR package. ?

I won’t mess with Seamonkey cache settings.

I loaded profile-sync-daemon on to 16o4 running FireFox and it did make a difference. Maybe not groundbreaking but FF is noticeably snappier. Thanks

1 Like

Could you share how you loaded it ?

sudo add-apt-repository ppa:graysky/utils

sudo apt update

sudo apt install profile-sync-daemon

Thanks a lot for the instructions.

1 Like

It’s also in the repos at least for 16.10. The arch wiki is quite handy on getting it configured:

https://wiki.archlinux.org/index.php/Profile-sync-daemon

From what I read, it won’t work with browsers that don’t have the cache dir within your profile dir.

That is the case with Seamonkey.

I am curious.

I made a 1 Gb tmpfs.

Why does df dislplay so many of them ?

a> ndy@7:~$ df

Filesystem 1K-blocks Used Available Use% Mounted on
udev 3523080 0 3523080 0% /dev
tmpfs 708640 9524 699116 2% /run
/dev/sda1 1922728752 12346156 1812765676 1% /
tmpfs 3543184 640 3542544 1% /dev/shm
tmpfs 5120 4 5116 1% /run/lock
tmpfs 3543184 0 3543184 0% /sys/fs/cgroup
tmpfs 1048576 4 1048572 1% /tmp
/dev/sdb1 101397896 8009904 88230616 9% /media/sdb1
tmpfs 708640 36 708604 1% /run/user/1000
/dev/sdb2 104112352 26361624 72455472 27% /media/andy/MAXTOR_SDB2
/dev/sdc1 7604392 8 7604384 1% /media/andy/DATASTICK

Hi @fixit7, The one you added is there. The others were already there.