Firefox keeps forcing disk to spin up when browsing because its sqlite storage calls fsync() for every recorded entry
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mozilla Firefox |
Expired
|
Medium
|
|||
firefox-3.0 (Ubuntu) |
Fix Committed
|
Medium
|
Unassigned | ||
firefox-3.5 (Ubuntu) |
In Progress
|
Undecided
|
Ray king | ||
Bug Description
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.
[75613.477517] firefox(21767): dirtied inode 4784757 (places.
[75613.478586] firefox(21767): dirtied inode 4784273 (places.
[75613.478599] firefox(21767): dirtied inode 4784273 (places.
[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
NonfreeKernelMo
Package: firefox-3.0 3.0~b5+
PackageArchitec
ProcEnviron:
PATH=/
LANG=nl_NL.UTF-8
SHELL=/bin/bash
SourcePackage: firefox-3.0
Uname: Linux 2.6.24-16-generic i686
Changed in firefox: | |
status: | Unknown → Confirmed |
Changed in firefox: | |
status: | Confirmed → In Progress |
Changed in firefox: | |
status: | In Progress → Fix Released |
Changed in firefox: | |
status: | Fix Committed → Fix Released |
Changed in firefox: | |
status: | Unknown → Confirmed |
Changed in firefox-3.0 (Ubuntu): | |
status: | Triaged → Fix Committed |
Changed in firefox: | |
importance: | Unknown → Medium |
Changed in firefox: | |
status: | Confirmed → Expired |
Changed in firefox-3.5 (Ubuntu): | |
status: | Confirmed → In Progress |
assignee: | nobody → Ray king (phylepro123) |
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 sqlite- journal) on dm-2 sqlite- stmtjrnl) on dm-2 sqlite- stmtjrnl) on dm-2
[75613.477517] firefox(21767): dirtied inode 4784757 (places.
[75613.478586] firefox(21767): dirtied inode 4784273 (places.
[75613.478599] firefox(21767): dirtied inode 4784273 (places.
[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 dules: nvidia nobinonly- 0ubuntu3 ture: i386 usr/local/ sbin:/usr/ local/bin: /usr/sbin: /usr/bin: /sbin:/ bin:/usr/ games
Architecture: i386
Date: Wed Apr 23 14:50:56 2008
DistroRelease: Ubuntu 8.04
NonfreeKernelMo
Package: firefox-3.0 3.0~b5+
PackageArchitec
ProcEnviron:
PATH=/
LANG=nl_NL.UTF-8
SHELL=/bin/bash
SourcePackage: firefox-3.0
Uname: Linux 2.6.24-16-generic i686