Firefox profiles on a tmpfs (ramdisk)?
Micah Gersten
micahg at ubuntu.com
Mon Oct 25 21:56:32 UTC 2010
On 10/24/2010 10:12 AM, Jouko Orava wrote:
> 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
>
If upstream rejected for complexity, we won't be able to take it
either. We will be discussing increasing the time between session saves
in Firefox though.
Thanks,
Micah Gersten
Ubuntu Mozilla Team
More information about the Ubuntu-devel-discuss
mailing list