Monday, July 9, 2007

cpufreq and measuring power consumption

Since everyone are talking about Live Earth and global warming recently, I have decided to check my personal power consumption. Other than my car, I guess the second most power consuming device is my PC. So I decided to measure how much power it consumes. Especially as I have recently discovered the cpufreqd that can adjust my Pentium 4 processor speed from 2.4GHz down to 300MHz.

Unlike some hardware review sites where they could afford to buy good quality power meters like the Watts Up, all I have is just two multimeter laying around my toolbox and they can't even measure AC current. So, I also can't measure power as the method described in the article in TwistedMod. I has to create my own method to measure the current that goes into my PC. The circuit is as shown below:

circuit to measure PC power consumptionThe resistor 5.1ohm, 5W was used because it is the only suitable resistor that is in my toolbox. Basically, any low resistance high power resistor should be suitable. The power dissipation of the resistor must be less than its rated power. For instance, I would expect my PC to draw less than 200W average and the mains provides 250V, thus the current is I = P/V = 200W/250V = 0.8A. Therefore, resistor power dissipation is P = I2R = 0.82 x 5.1 = 3.264W, which is still safe and below 5W. Of course, a 10W resistor would be safer and if your mains is 110V, the current would be twice and there for a 2ohm, 10W resistor is probably more suitable as the voltage drop across the resistor is lower.

BTW, if you do not really understand the above paragraphs about voltage, current and power, PLEASE DO NOT ATTEMPT THIS AT HOME!

Ok, I have completed modifying the above circuit as shown below:


The setup showing multimeter measuring VR

Next, I set my two multimeters to measure AC voltage. And finally, I plugged in the power cord and I pressed the power button....

... fans and hard disk spins up ..... beep ...

Yes, it works. The VAC shows 252V and VR fluctuates around 1.8V as Kubuntu boots up. Also, resistor power dissipation, PR = 1.8V / 5.1ohm = 0.35A.

After the system boots up and once the system reaches idle (cpufreqd is set to ondemand and ksensors show 300MHz), the VR is 1.6A with my LCD monitor on and 1.2A when the LCD monitor is switched off.




Then, I set my CPU frequency using cpufreq-set command (for example, cpufreq -f 1600 to set various frequency and various system load to determine the effect of CPU frequency and CPU load on power consumption. For more info on setting CPU frequence and power management in Linux, see
Debian HOW-TO : CPU power management

To simulate load, I used mencoder to trancode an episode of DL.tv using the following command:

mencoder dl.tv.173.i.mp4 -ovc lavc -oac lavc -o /dev/null

FYI, these are the major components of my machine's specs:
  • Intel Pentium 4 - 2.4Ghz
  • 512MB RAM - Corsair XMS 2ns
  • MSI 865P Neo motherboard
  • MSI Geforce FX 5200 - 128MB
  • Creative SB Audigy
  • 250GB WD Caviar SE
  • 40GB WD Caviar
  • LiteON DVD +/- RW drive
  • 17" Samsung LCD 173V

Results:


Power consumption with single CPU load


Power consumption at idle

As you can see, when the CPU is loaded, the power consumption reduces when the CPU frequency is reduced. However, on idle load, changing CPU frequency does not seems to any effect on power consumption. I guess the reason is because my old processor is not really design for frequency scaling for reduced power consumption. It would be interesting to see the difference on newer processors with Intel's Enhanced SpeedStep or AMD's Cool 'n' Quiet.

At idle power consumption at 60W is not exactly low compared to some latest 'green' machines. But it is relatively low compared to the those high-end gaming machines.

Another observation is that the 17" LCD takes approximately 30W.

Lastly, please try to use Live Earth online calculator to find out your lifestyle carbon footprint and so something about it. My Live Impact score is 215 and 4.7 tons of carbon output per year. Hmm.. I guess I can probably do something to reduce this.

No comments: