Power Management and You

Why did my computer turn itself off?

If you’ve ever poked around your system BIOS or power management settings for your OS, you’ve likely seen an array of settings for your computer. Here I’ll cover things such as what the various power management states are, the benefits and pitfalls of power management, and what you should consider using.

(Note: Semi-old essay; doesn’t account for Vista’s new PM features like hybrid sleep)

Why Use Power Management?

Simply put: Savings. Using power management can save not only energy and the costs involved with that energy, it can also extend the life of hardware by shutting it off when not in use. For laptop users and those with other mobile devices (some PDAs), power management is critical to extending the life of the battery. Power management can also let you “shut down” your computer without having to lose your place by making use of hibernation, which can be very handy.

Power Management States & Terms

Part of understanding power management means understanding the various states of power management, as well as some associated terminology.

  • S0 is normal system operation (ie, the ‘ready’ state).
  • S1is suspend-to-RAM. In this state, the system writes a snapshot of what it’s doing to RAM and reduces power usage. It’s also known as stand-by. S1, unlike S3, maintains power to the PCI/AGP/PCI-E buses.
  • S2 doesn’t exist, as far as I know.
  • S3 is suspend-to-RAM as well, however, S3 implements further power saving by disabling power use to the PCI bus (meaning any add-on cards will not have power). Minimal power to keep RAM alive will be supplied. It’s also known as suspend (note that stand-by, suspend, and sleep tend to be used interchangeably – you can only use either S3 or S1 in most cases). It’s a ‘deeper sleep’ than S1.
  • S4 is hibernation. Systems that support this will write a snapshot of where you were to your hard disk and power down. When rebooting, the OS will load that snapshot. The advantage of hibernate over standby is that power is not needed to maintain data in RAM, so you can move the computer, unplug to replace a cable, and so on. However, it typically takes longer to resume from hibernate than from S3 or S1.
  • S5 is complete shutdown – no power. Nothing is saved to RAM or the hard disk. The system will only use power to maintain the onboard clock.

There’s a couple of terms to know also. A “time out” is simply a value set that determines a period of time until something happens. When it comes to power management, this almost always means a period of time set that the computer will automatically try to enter a certain power management mode with no input from the user. For example, a time out of five minutes until standby means that, if five minutes elapses without input from the user or other sources, the system will enter standby. “Wake up” is the term for resuming normal operation.

For the most part, we’ll be speaking only of system power management, which in most cases involves the system board, memory, the power supply, CPU, and peripheral (PCI, AGP, PCI-E) bus(es). Hard drives are partially included (since they’re involved in hibernate operations) but have their own settings. Monitors are a separate system and have a multitude of standby methods not covered here. By default I’ll assume the reader is using Windows 2000 or XP, though many of these settings can apply to Windows 9x, Mac, Linux, and other OS’.

What Settings Should I Use?

For the average desktop user, a multi-layered timeout approach is most effective and unobtrusive. In the BIOS, setting S3 as your method is usually the best option. Don’t use the BIOS settings for time-outs – these should be set in the OS. The typical desktop user should use 10-15 minutes for turn off monitor, 25-30 minutes for turn off hard disks, 45 minutes for stand by, and 2 hours for hibernate (you may need to enabled hibernation support in the Hibernate tab). Laptop users should use more aggressive choices for when they’re not connected to a power plug – a 5 minute turn off monitor, 10 minutes for turn off hard disks, 30 minute standby, and 1 hour hibernate. Part-time servers with wake on LAN functionality should go with the desktop setup, but lengthen the standby and turn off hard disks times to 1 hour and 45 minutes respectively. These settings can be, of course, tweaked for the user’s preferences.

What Can Go Wrong?

Plenty. Because everything in your system requires power, it’s essential that your hardware cooperate when you make use of power management features. This in turn requires software drivers that are properly written to support power management. In short, everything has to work together. Thankfully, it does, most of the time. To that end, it’s worth making sure a basic sequence functions properly.

To that end, it is imperative that you test your power management functionality before making use of it. If you’re using Windows XP or 2000, open up Device Manager (right click My Computer, then select properties, then go to the Hardware tab and select Device Manager). Locate your keyboard, right click it, and select properties. There should be a Power Management tab; make sure “Allow this device to bring the computer out of standby” is checked. You can enable this setting for the mouse as well, but be warned that waking the system with the mouse has a greater ‘accident rate’. Close up Device Manager, then go to Display Properties (right click the desktop, choose Properties) then go to the Screen Saver tab. Disable the screen saver and select Apply, then select Power. Set Turn off Monitor to one minute, turn off hard disks to two minutes, system standby to 3 minutes, and hibernate to 5 minutes (you may need to enable hibernation support in the Hibernate tab first). Open some typical applications that you use (though not demos, utilities, games, or other programs that run continuously). Let the system time out through each mode, then wake the system after hibernate, verifying that it resumes properly and your apps appear and respond correctly.

Obviously, for a computer that has to be always on (servers), power management is usually not something you want to enable (other than turn off monitor). However, a part-time server with wake on LAN functionality might be able to make use of power management stand-by and suspend modes without impacting functionality too much (you’ll incur a lag when you have to wake the system to access it, but other than that you should be fine). However, do not set a hibernation time out. In a related vein, those giving presentations should make it a point to disable timeout power management to prevent their computer from suspending itself during a show.

Other issues that can happen can be generally divided into two classes – things that prevent the computer from reaching a desired power management mode, and things that prevent the computer from resuming from a power management mode (AKA waking up). In the first category, programs that run continuously or make use of expansion cards (usually network interfaces), or simple network traffic passing through the system can cause power management to fail, because the computer will always think that there is something to process. In Windows, this can sometimes be fixed by unchecking “Allow this device to bring the computer out of standby” (follow a similar procedure as listed above, but instead of keyboards and pointing devices, look under Network Adapters). Lastly, it’s a known issue that (some) screen savers can cause a machine not to enter standby with Windows, so you may have to disable yours.

Wake up problems can include any number of things, including screen corruption on wake up, inability to wake up, non-responsive system after wake up, and more. Many times, these problems can be fixed by updating drivers; specifically, start with the system mainboard (chipset) and video card drivers, then work your way from there. This may also entail BIOS updates; don’t do these unless you feel comfortable potentially hosing your system or parts thereof. Consult your manufacturer’s website for tools and updates on this, and make sure to read the directions thoroughly, because again, you will hose your computer if you screw this up. Another wake up problem is slow restore, where the computer takes a long time to restore itself. This may be a symptom of too many devices connected. Also note that temporary loss of network functions after wake up is normal.

Just a note on S3 and S1: I cannot be sure if this is a Windows bug or just the fault of some machines I’ve worked with, but if you start in S3 when you install Windows, you should use S3 for your suspend functions. If you switch to S1, S1 methods should be used. However, if you try to switch back to S3, Windows will not use S3 methods — it will use S1 methods, until you reinstall with S3 enabled.

Leave a Reply