Firefox profiles on a tmpfs (ramdisk)?

Jouko Orava jouko.orava at helsinki.fi
Sun Oct 24 14:12:03 UTC 2010


Hello,

For a couple of years now I've kept my active Firefox profiles on a tmpfs
(mounted size=128M,mode=01777,atime,auto,rw,nodev,noexec,nosuid)
on both my desktop workstation and on my minilaptop. It feels subjectively
much snappier, but I haven't actually measured the difference.
On the laptop, it also reduces disk usage, which is very nice.

The profiles are unpacked from a tarball when firefox starts, and tarred
back when firefox closes, using two script hooks in run-mozilla.sh:
	[ -x /usr/lib/firefox-profiles.sh ] && /usr/lib/firefox-profiles.sh load
just before the final if clause, and
	[ -x /usr/lib/firefox-profiles.sh ] && /usr/lib/firefox-profiles.sh save
just after the final if clause.

The script itself is very careful to not fail (and not to overwrite the
old tarball unless the new one is ok), and has never failed yet,
even when Firefox crashes.

I tried to get something similar upstream earlier:
	https://bugzilla.mozilla.org/show_bug.cgi?id=576707
but it was rejected for complexity reasons.

If the Ubuntu Mozilla team were to add the script hook into Firefox
-- noting that it does not change the behaviour by default, only if the
hooked script actually exists --, I could create an Ubuntu package,
which when installed creates the necessary tmpfs, profile tarballs,
and modifications to the profile configs to limit the profile size
(so that the tmpfs does not grow too large).
All of the changes are also safely undoable if the package is removed.
Each user can also choose which profiles, if any, are kept on the tmpfs.

The question is, are Ubuntu developers interested in this?

It does add changes to Firefox run-mozilla.sh script, which has to be
maintained. (However, run-mozilla.sh does not seem to change often.)

If there is interest for this, I could upload or e-mail the scripts
(/usr/lib/firefox-profiles.sh for Firefox, and proposed maintainer
 scripts for a package setting up the tmpfs and moving Firefox
 profiles to a tmpfs.)

(There are also some user interface related issues to think about, too.
 For example, should the package move all profiles to tmpfs by default,
 or should it have a GUI prompting the user on the next Firefox startup?
 Is there need for a migration tool, GUI or commandline, so that users
 could choose afterwards?)

At the minimum, adding the script hook into run-mozilla.sh makes
the testing much easier. Now, I need to modify run-mozilla.sh whenever
Firefox is updated, which is a bit of a chore..

I'd be very happy to provide further information for those interested.

Cheers,
	Jouko Orava




More information about the Ubuntu-devel-discuss mailing list