Firefox profiles on a tmpfs (ramdisk)?
Jouko Orava
jouko.orava at helsinki.fi
Mon Oct 25 21:18:48 UTC 2010
> > Using tmpfs, I can save and snapshot the active profile at any time,
>
> This is not true. If you copy the file wile ff is changing it, you can
> end up with a corrupt copy.
I meant that you can get a copy of the profile state as if Firefox had
crashed at that point.
(You can take a snapshot opportunistically at any time, by first
taking the snapshot of the profile, and then checking that the files
were not modified in the last two seconds, and will not be modified
in the next two seconds. If the profile is on tmpfs, writes should
affect metadata immediately, and the two-second limit takes care of
any clock granularity issues.
If the user is active and the files were modified in the grace period,
the snapshot may be broken, just as if Firefox had crashed.)
Since Firefox is supposed to be able to recover the session
from a crash, you *should* be able to take a snapshot of the active
profile at any time.
In fact, if you monitor Firefox file access patterns with e.g.
inotifywait -m -r path-to-the-active-profile-directory
or by stracing firefox-bin, you can see that both the session store
(sessionstore.js) and the places database (places.sqlite*) are
modified in a way that makes snapshotting safe.
(sessionstore.js is written to a temporary file, synced, then the original
replaced with the temporary copy; places has a separate journal file
which is written and synced before data is written to the db.)
Cheers,
Jouko
More information about the Ubuntu-devel-discuss
mailing list