{"id":51,"date":"2007-06-10T05:56:28","date_gmt":"2007-06-10T04:56:28","guid":{"rendered":"http:\/\/patrick-nagel.net\/blog\/archives\/51"},"modified":"2007-06-11T06:48:06","modified_gmt":"2007-06-11T05:48:06","slug":"laptop-battery-consumption-learning-gnuplot","status":"publish","type":"post","link":"https:\/\/patrick-nagel.net\/blog\/archives\/51","title":{"rendered":"Laptop battery consumption \/ learning gnuplot"},"content":{"rendered":"<p>Today I tested how long my laptop&#8217;s battery can last when I just keep it on the table, idling. Running Linux and a bunch of applications, the TFT set to the lowest brightness setting. Wireless activated.<\/p>\n<p>After the laptop switched off, I plotted the power consumption curve with gnuplot, which I wanted to get to know for a long time already \ud83d\ude09 The data file (fed from \/proc\/acpi\/battery\/BAT1\/state) contained 1678 data points (ten samples per minute). The gnuplot session looks like this:<\/p>\n<p><code>gnuplot> set terminal png picsize 800 600<br \/>\nTerminal type set to 'png'<br \/>\nOptions are 'small color picsize 800 600 '<br \/>\ngnuplot> set output \"test.png\"<br \/>\ngnuplot> plot \"powerlog3\" using 1:2 title 'Power consumption (W) over time (min)' with lines, \"powerlog3\" using 1:3 title 'Remaining (%) over time (min)' with lines smooth unique<\/code><\/p>\n<p>You can see the result here:<br \/>\n<a href='http:\/\/patrick-nagel.net\/blog\/wp-content\/uploads\/2007\/06\/test.png' title='Plot of my laptop\u2019s power consumption, tested on 2007-06-10, plotted with gnuplot'><img src='http:\/\/patrick-nagel.net\/blog\/wp-content\/uploads\/2007\/06\/test.thumbnail.png' alt='Plot of my laptop\u2019s power consumption, tested on 2007-06-10, plotted with gnuplot' \/><\/a><\/p>\n<p>In the beginning I finished something I was working on, so you can see some spikes in the power consumption when I launched programs and such&#8230; After 60 minutes the monitor switched off, so the consumption drops. I guess I hit the table at minute 144 or so, because then the monitor seems to have switched on again, don&#8217;t remember though \ud83d\ude09<\/p>\n<p>I&#8217;ll do the test running Windows at a later time &#8211; but there I will only get one number &#8211; the total runtime. I have no idea how I could get statistics like that in Windows, and I&#8217;m not willing to try 10 shareware programs until I get a suitable result \ud83d\ude09<\/p>\n<p>UPDATE (2007-06-11):<br \/>\nI got around running the test in Windows. I tried to produce about the same conditions: display switches off automatically after 60 minutes, no automatic standby and stuff. I also remembered to switch on the display again after ~70 minutes of being switched off, so the results should really be comparable. One of the apps I kept running on the otherwise idle system was a PuTTY window. Therein I ran a shell script on my server, which touched a file every ten seconds, so I just would have to check the modification date of that file to know when the box went down. I started the test at 11:01 local time, which means 3:01 UTC. The file&#8217;s modification date is: 2007-06-11 05:22 (UTC). &#8211;> The laptop was shutdown automatically after 2:21h.<\/p>\n<p>So it&#8217;s definitely not true that there is some energy wasting going on when Linux is running on a computer, as I have been told (and which eventually caused me conducting this experiment \ud83d\ude09 ). If anything, Windows lost here, as usual.<\/p>\n<p>P.S.: Some information about the two software environments:<br \/>\nLinux: Kernel 2.6.21-gentoo-r2, (for details, have a look at my current <a href=\"http:\/\/rafb.net\/p\/F8u4kp17.html\">configuration<\/a>). On top of it, running Xorg, KDE with Beryl as window manager, there are usually about 150 processes in the task list.<br \/>\nWindows: Windows Vista Business, everything left quite to the default (I never use it&#8230;). No special services running or anything.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I tested how long my laptop&#8217;s battery can last when I just keep it on the table, idling. Running Linux and a bunch of applications, the TFT set to the lowest brightness setting. Wireless activated. After the laptop switched off, I plotted the power consumption curve with gnuplot, which I wanted to get to &hellip; <a href=\"https:\/\/patrick-nagel.net\/blog\/archives\/51\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Laptop battery consumption \/ learning gnuplot&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,13],"tags":[],"class_list":["post-51","post","type-post","status-publish","format-standard","hentry","category-uncategorized","category-linux-general"],"_links":{"self":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts\/51","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/comments?post=51"}],"version-history":[{"count":0,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/posts\/51\/revisions"}],"wp:attachment":[{"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/media?parent=51"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/categories?post=51"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/patrick-nagel.net\/blog\/wp-json\/wp\/v2\/tags?post=51"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}