[Bug 221009] [NEW] Firefox keeps forcing disk to spin up when browsing because its sqlite storage calls fsync() for every recorded entry

Dennis Noordsij dennis.noordsij at helsinki.fi
Wed Apr 23 13:09:41 UTC 2008


Public bug reported:

Binary package hint: firefox-3.0

Background: when running in laptop-mode, all writes to the disk are
postponed until a scheduled disk spinup, this saves power. Only an
uncached read, or an explicit fsync(), causes the disk to spun up
outside of the scheduled spinups (every 10 minutes or so?).

(This is Ubuntu Hardy RC, with Firefox 3b5)


Firefox uses sqlite to save certain data (I guess including history).

This prevents laptop-mode from running effectively, since whenever
Firefox records a new entry (i.e. you browse to a page), its sqlite
storage calls fsync(), which in turns forces the disk to spin up. Laptop
mode in general seems to be quite efficient, with Firefox being the only
cause of increased spinups for me.

Sqlite does support a nosync mode, which could be enabled while in
laptop-mode. IMO it would be worth to at least enable the option to lose
some history in a (system) crash (which is only while in laptop-mode),
if it means Firefox can be used in laptop-mode. Currently, just browsing
with Firefox causes so many spinups the power savings are nil, and the
Load_Cycle_Count increases way too fast.


Example:

[75250.049865] pdflush(31873): WRITE block 109142072 on dm-2

....  last write
....  then 323 seconds of disk in spun down state ..
....  then in firefox clicking a link

[75613.477491] firefox(21767): dirtied inode 4784757 (places.sqlite-journal) on dm-2
[75613.477517] firefox(21767): dirtied inode 4784757 (places.sqlite-journal) on dm-2
[75613.478586] firefox(21767): dirtied inode 4784273 (places.sqlite-stmtjrnl) on dm-2
[75613.478599] firefox(21767): dirtied inode 4784273 (places.sqlite-stmtjrnl) on dm-2
[75613.479031] firefox(21767): WRITE block 76662616 on dm-2

... and now the writing starts because of the fsync() of sqlite.


A user would expect that on a "worn-in" desktop (i.e. basically everything you use is in cache) normal web browsing should not cause a sync (or read) event for every page. Webbrowsing is probably one of the most common activities on laptops running on battery, and Firefox is the most popular webbrowser in Ubuntu.

ProblemType: Bug
Architecture: i386
Date: Wed Apr 23 14:50:56 2008
DistroRelease: Ubuntu 8.04
NonfreeKernelModules: nvidia
Package: firefox-3.0 3.0~b5+nobinonly-0ubuntu3
PackageArchitecture: i386
ProcEnviron:
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=nl_NL.UTF-8
 SHELL=/bin/bash
SourcePackage: firefox-3.0
Uname: Linux 2.6.24-16-generic i686

** Affects: firefox-3.0 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: apport-bug

-- 
Firefox keeps forcing disk to spin up when browsing because its sqlite storage calls fsync() for every recorded entry
https://bugs.launchpad.net/bugs/221009
You received this bug notification because you are a member of Mozilla
Bugs, which is subscribed to firefox-3.0 in ubuntu.




More information about the Ubuntu-mozillateam-bugs mailing list