[ Previous Tip ] [ Mac Tips ] [ Next Tip ]
The Mac OS is designed to let a computer gracefully sleep automatically and wake quickly. This primarily serves to conserve power. On a laptop running from a battery, this can be critically important. Having the battery run down because a computer wasn't doing anything is a very bad thing. On a desktop, it is a bother because the computer can tend to run up your power bill. Depending on the power that the computer draws and the current electricity rate, the power bill to run a computer all the time can exceed $60/year.
There is a timer that can be set in the System Preferences Energy Saver Preference Pane to allow a Mac to sleep after a set period of no user activity. The key word here is "allow." While the sleep command that a user issues from Apple > Sleep acts nearly immediately and with high reliability, the sleep timer does not force sleep. Even if the timer runs out, it can take several minutes for a properly functioning computer to sleep. After the time runs out, there are any number of things that can still keep the computer awake. Finding these things is the subject of this page.
Generally, if the computer thinks that it is busy, or being used by the local or some remote user, it will stay awake so that it is maximally responsive. Sometimes however, it fools itself and stays awake on it's own even when it should be sleeping. These are some of the things that will keep it awake.
Time Machine. The Time Machine process will hold a computer awake until it finishes. If the sleep timer has run out in the meantime, the computer should sleep shortly after Time Machine finishes.
Spotlight. Spotlight is the feature that allows rapid searches. To perform this task, it examines every disk attached (unless excluded) and builds an index of the disk. This normally happens in real time as the contents of the disks are changed. However, if the index is damaged or it is a disk that hasn't been indexed already, Spotlight can spend hours rummaging through the disk to build an index. Spotlight will also hold the computer awake until it finishes.
Sharing. Sharing, particularly file sharing, will hold a computer awake. If another computer has mounted yours as a shared volume, expect it not to sleep until the remote user ejects yours. Screen sharing can do the same thing. Printer sharing will hold the computer awake for the length of a print job. Internet Sharing will also hold a computer awake all the time. Unless you actually use Internet Sharing, turn it off.
Note that if you have "Wake for Network Access" checked in the Energy Saver Preference Pane, the computer will wake briefly every hour or two to advertise it's presence to the network and then it will go back to sleep, perhaps after only 10 seconds. This is normal. If you don't want to access the computer while it is sleeping, turn this option off.
User Input. Any user input, including any activity from a USB device (like a mouse or keyboard) will reset the sleep timer and prevent the computer from sleeping. Cats are noted for waking computers in the middle of the night by walking on the keyboard.
BlueTooth. BlueTooth devices can also wake a computer unless that capability is suppressed in the BlueTooth Preference Pane, Advanced tab.
Power Nap. Power Nap is a feature enabled only in Mountain Lion for Macs that came with an SSD (Solid State Disk) installed and that have fairly recent firmware. Firmware updates for some older models dating back to 2010 of the MacBook Air and some MacBookPro configurations can enable Power Nap. Power Nap allows a sleeping computer to do some housekeeping tasks while otherwise sleeping. The computer will wake about once an hour, check email and other messaging software and do just one Time Machine backup. This is to be sure that the computer is ready to go, for example, the next morning and that no wake up activities are necessary so that it can be grabbed and taken out of WiFi range without the need to wake it up. Even if Power Nap is enabled when on battery power, File Sharing does not work. This is to prevent some sharing activity from draining a sleeping computer's battery. File Sharing will still work when the computer is sleeping while connected to a charger. Power Nap results in a very light touch on the battery when it operates if it is not plugged in.
Sometimes it isn't obvious that a computer is sleeping at all. Depending on the model of Macintosh, there may be a slowly pulsing indicator light that indicates sleep or maybe some heat on the case, or some fan or disk noise. My mid 2011 iMac does not show much of an indication when it goes to sleep at all. I use a Kill-A-Watt AC power meter to show me if my computer is sleeping or not. A sleeping computer will draw 1 or 2 watts from the wall outlet. One that is not sleeping could be in the range of 11 to 100 or more watts.
A USB hub or USB device with an LED on it can provide a sleep indicator if the computer does not have one. In this case, the LED will go out when the computer sleeps. Note that on SOME laptops, the USB ports one either side CAN act differently. Cut an try to see what works.
If a computer is not sleeping when I think that it should sleep, then I follow these steps to track the problem down.
at the command prompt. If you see a line that says "assertions" or "sleep prevented by" and a number, the number is the process ID (PID) of a process that has declared that the computer should stay awake. Open Activity Monitor (also in Utilities). Select "All Processes" and looks for that PID in the first column. On the same line will be the name of the application or process that is keeping the computer awake.
At any of these steps where it starts to sleep, you have found an indicator of what was keeping it awake. Start going back up the list and turning things back on until it is running in a normal state and sleeping. If it starts refusing to sleep again, you've narrowed the problem down. Look to the descriptions above about processes that can suspend sleep to get some guidance as to what specifically might be causing the insomnia.
If you find that it won't sleep when you log back in, there are further steps you can take. At the login window, all user processes are halted. Logging in starts up whatever is in your Login Items or if you are running Lion or Mountain Lion, whatever was running when you logged out. If you had clicked the box to not Resume applications, then only Login Items will be running. One of these is causing the problem. Another way to suppress relaunching of user processes at login is to, immediately after you enter your password, press and hold Shift. This will stop any applications from relaunching at login.
Go to System Preferences > Accounts > (your account) > Login Items and delete everything there, you really don't need this in Lion and ML anyway. Then log back out and if you are running Lion or Mountain Lion, make sure that the box that says to Resume applications is NOT checked. Then log back in and test again.
At this point, the system should be sleeping. If not, then you should create a brand new test account and try it there. If the test account doesn't sleep, but the system sleeps at the login window, then you have a problem that I haven't run across yet.
If the test account, or your account with nothing running, sleeps, then start adding running applications back in a few at a time. If it sleeps, add more. If not, one of the last batch was the problem. Shut off each one in turn and test again. When you find the particular app that is doing it, then you'll have to get an updated version that works or you'll have to remember to quit it when you are done using it.
[ Previous Tip ] [ Mac Tips ] [ Next Tip ]
This page has been accessed times since Feb 10, 2012
© 2012-2013 George Schreyer
Created Feb 10, 2012
Last Updated March 2, 2013