devkit-power-daemon drains my battery recording excessive history
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
devicekit-power (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: devicekit-power
While running on battery power, I noticed bursts of disk activity lasting a few seconds and occurring at perhaps twenty-second intervals, which of course is bad because it prevents the disk from spinning down and drains battery power.
/usr/bin/top revealed that devkit-power-daemon was consuming ~10% CPU during the periods when the laptop hard drive was active. I attached strace and indeed saw it performing blocks of I/O work in /var/lib/
-rw-r--r-- 1 root root 1673328 2010-02-24 21:24 history-
-rw-r--r-- 1 root root 1060256 2010-02-24 21:24 history-
-rw-r--r-- 1 root root 807099 2010-02-24 21:24 history-
-rw-r--r-- 1 root root 2363486 2010-02-24 21:24 history-
-rw-r--r-- 1 root root 1244830 2010-02-24 21:20 history-
-rw-r--r-- 1 root root 1028622 2010-02-24 21:20 history-
-rw-r--r-- 1 root root 399937 2010-02-24 21:20 history-
-rw-r--r-- 1 root root 2351404 2010-02-24 21:20 history-
While I am not familiar with the daemon's source code, some offhand suggestions for making it a better citizen:
1. Use a binary format. These log files waste a lot of space on ASCII text that could easily be compressed:
....
1257278229 88.681 discharging
1257278246 88.492 discharging
1257278263 88.263 discharging
1257278281 88.111 discharging
....
2. Get rid of the open/close/
3. Recording power history just isn't important enough to justify a lot of I/O (and it is ironic that power efficiency is reduced this much just by measuring it). Reduce the sampling rate, especially when on battery power, if #1 and #2 do not pay off.
ProblemType: Bug
Architecture: i386
Date: Wed Feb 24 21:27:20 2010
DistroRelease: Ubuntu 9.10
ExecutablePath: /usr/lib/
NonfreeKernelMo
Package: devicekit-power 011-1ubuntu2
ProcEnviron:
ProcVersionSign
SourcePackage: devicekit-power
Uname: Linux 2.6.31-19-generic i686
Same to me. Ubuntu 9.10, amd64.