Skip to content. | Skip to navigation

Personal tools

Navigation

You are here: Home / Wiki / Powersaving

Powersaving

Automatically Turning Off Idle Testbed Nodes

Automatically Turning Off Idle Testbed Nodes

The ability to automatically turn off idle nodes as a power-saving measure is available for Emulab installations at or above the stable-20110913 tag in the emulab-stable repository. For Emulabs like the main installation in Utah, this feature isn't terribly important: utilization is so high that nodes are never idle for very long. If your Emulab is like mine, however, usage is sporadic. When users are actively experimenting/testing/developing the nodes are heavily utilized, but then they may sit idle. Many of our 50 or so nodes are idle for days or weeks at a time. The ability to automatically turn them off represents a potentially large savings in electricity, heat and, of course, money.

The power saving feature operates as follows: a cron job is run periodically which searches for "idle" nodes. An idle node is one which is available to be allocated to an experiment, but which hasn't been allocated. If a node has been idle for more than a specific amount of time, the node is powered down. When an idle node which has been powered down is next allocated to an experiment, Emulab automatically turns the node on again as part of the "swap-in" process.

Power saving can be enabled individually for each type/class of node. This is important in that you may have certain types of nodes that you don't want to turn off. In particular, some old PCs have a nasty habit of not wanting to wake up once they are turned off! If you've got machines like that then you'll want to be careful enabling this feature for them. Similarly, opinions vary as to whether it's better for the long term health of electronics to turn devices on and off or to simply leave them running. It's up to you to decide whether the wear and tear of the initial power surge in turning a machine on is worth the energy/cost savings of leaving it turned off. I vote for saving energy and money, and this feature is flexible enough that you can control how frequently machines are subject to power cycling.

Enabling Power Saving

In order to use this feature you'll have to have power controllers installed and properly configured in your Emulab. See https://users.emulab.net/trac/emulab/wiki/install/power-control.html

To enable power saving, log into your Emulab as administrator and go into "red-dot" mode. Go to "Administration, Edit Site Variables". Set "general/idlepower_enable" to "1". The site variable "general/idlepower_idletime" defaults to one hour (3600 seconds). You can change this variable if you want to adjust the power down timing for your Emulab.

For each type of node which you want to use this feature with, edit the node type and add the attribute "idlepower_enable" as an integer set to the value "1". You can see a list of your node types by choosing "Experimentation, Node Status" when in "red-dot" mode. Each node type is selectable for editing directly from this page or from the "Node Type List" link at the bottom of this page.

Finally, schedule the "idlepower" script to run as a cron job on boss. I added the following line to /etc/crontab on boss to run the script every 30 minutes as "root":

 */30  *  *  *  *  root  /usr/testbed/sbin/idlepower -r > /dev/null

Remember to restart the cron process after making this change to /etc/crontab ("/etc/rc.d/cron restart").

The default of one hour of idle time before power off and the half-hour scheduling of the cron job means idle machines will be powered off after 60 to 90 minutes. You can, of course, adjust these values for the needs of your individual Emulab.