This might not be answerable in theory, but any thoughts are appreciated:
I have a UNIX server that has 2GB of RAM, and presumably it is slightly overloaded and swapping to disk heavily. It is a test server, and the only user is me, so being busy is not a problem.
I have some extra RAM available (lets say 6GB) of RAM. Assuming the RAM upgrade substantially removes the need to page to disk, the question I have is:
Will the upgrade save energy (from a net reduction of disk usage vs. the energy used by the additional RAM)?
UPDATE: To clarify, this is not a "save $$$" question, this was a curiosity. Joel had once made a comment in a podcast about how there is always someone asking if they can run their system with lots of RAM and no swap, because they have a simplistic view of how memory is managed. This was me, thinking about the ways adding RAM would change my system's behavior.
Perhaps marginally, and more noticeable if you're using SSDs than spinning platters.
With a rotating media drive you're always spending the energy to keep it rotating -- I assume you don't sleep drives in a server. As I recall this is most of the power consumed in a rotating drive. With SSDs there is a higher power draw to write (b/c you're flipping the bits), and as you're not running a motor to keep platters spinning it's a more obvious draw than it would be for writing to a rotating drive.
The bigger energy-win here isn't HD power consumption, it's reduction of wait time (paging chews up CPU cycles that could be better spent doing Real Work: Having the data in RAM as opposed to having to make disk requests means your CPU can finish the task you've given it more quickly and return to an idle state.
Getting your CPU to idle faster/for longer periods of time is more likely to have a measurable effect on power usage (& possibly even thermal dissipation).
If the machine is actively swapping for an amount of time during its general use then the RAM upgrade will save energy. The disk(s) will be spinning no matter what, but the reduced head movements and actual writing operations will reduce the energy used by the drive(s). It will also extend the life of the drive(s) by reducing mechanical wear and tear.
If the machine is not actively using swap regularly then the power required to constantly refresh the extra RAM will be larger than the amount of energy used for the head movements and read/write operations.
How to calculate break-even point is I'm not sure (it will depend on the RAM and drives in question, and a detailed view of the machine's load patterns), though doing the calculation probably isn't worth it - I expect the difference to be negligible unless the machine is constantly swapping stuff in and out and even then you'll probably waste more in time working out the saving then you will actually save. The RAM upgrade is probably not a bad idea though as it will reduce the wear-and-tear on the drive, may improve the machines response times so perhaps help you be more efficient, and RAM is cheap these days anyway.
(I'm assuming the server is on 24/7 - if it is turned on (or woke from sleep/hibernate) to work then off afterwards the reduce time operations take due to no swapping would mean you save energy by not running the machine as much and this saving could be large enough to measure if the difference is "X hours in a week" rather than "Y seconds")
SSD's provide an interesting case. From a recent Anandtech roundup of SSD/HDs you find a power-draw chart on page 6. You can clearly see that the rotational drive in that roundup draws 1.2w idle and 3.25w writing, compared to the variety of SSDs that draw at minimum 0.21w idle and at most 1.28w writing. Of course, the SSDs will provide more heat as all that electricity is being resisted off rather than doing the work of spinning platters.
As for "how much power does RAM draw?" I haven't been able to come up with a straight-up answer to that, and it does vary by age. DDR2 will draw more per GB than DDR3 due to voltage and feature size differences. One internet wag quoted "10w per RAM stick", which if true means that adding RAM actually increases your power load significantly as you'd be adding two sticks to get the best performance out of your system.
The fact remains that the different from HDD idle and HDD write is small enough that it doesn't take much additional draw to exceed HDD power draw. I suspect that adding physical RAM sticks will actually increase your draw. Now... replacing your existing RAM sticks with higher capacity ones, which might also be created with a smaller feature size, now that would probably reduce overall power consumption.
Interesting question and very interesting answers.
I am in the upgrade the ram camp for reduced energy consumption. I have not tested this before but I just might now LOL.
I think the disk head movement has to use more energy than ram as the ram has no moving parts.
The interesting comparison would be between SSD's and ram though in a true in-system test.
Count me in if you do run a "test" and get some results though.