Standby (lid shut) battery drain fix

marcopolo007uk

macrumors member
Original poster
Jul 2, 2009
76
0
I've read a few threads about battery drains when closing the lid on MacBooks and thought I'd share a fix that seems to be working for me.

The full details can be found here - http://vivekn.com/blog/2014/11/16/yosemite-battery-issues/

The bottom line was the standby delay for my MacBook running Yosemite was 3 hours, i.e. I close my lid and it kept running for 3 hours before fully entering standby. Decreasing this timer has helped a lot.

In terminal use pmset -g
If your standbydelay is 10800 (seconds) this equates to 3 hours.

To set it to a more reasonable 20 minutes use this terminal command

sudo pmset -a standbydelay 1200

I've not encountered any problems myself.
 

zhenya

macrumors 603
Jan 6, 2005
6,360
2,825
To be clear, your computer is not 'running' during those three hours, rather the system state is stored in RAM. This setting just shortens the time before that state is transferred from RAM to the disk, and the RAM can be powered down. It should consume almost no energy to power the RAM for three hours, as it uses something like 0.5W. That's 3% of your battery.

Something interesting to me is that I have not so far noticed any difference in the time it takes to resume from Sleep or Standby on my MacBook. Either way the login screen is presented instantaneously, and my desktop appears as soon as I enter my password. Given that, there is little downside to shortening this time as suggested above.
 

zhenya

macrumors 603
Jan 6, 2005
6,360
2,825
If it's consuming 3% battery in 3 hours, it's operating exactly as Apple intends. So from their perspective there is probably nothing to fix. It could be that SSD's have reached a point where they are now so fast that there is little difference in resume times between reading from RAM and reading from disk, although there might actually be a small battery hit in writing 8GB to disk too frequently. A 3 hour threshold would avoid that by preventing frequent large writes to disk when the user is actively using the computer, but has just closed it for a few minutes.
 

facrat

macrumors member
May 15, 2015
38
14
Use pmset -b to change only settings while on battery, rather than -a which is all states. Personally I set it to standby/hibernate after 1 hour:

sudo pmset -b standbydelay 3600

Edit: Also Safe Sleep is enabled by default on recent MacBooks (hibernatemode = 3), so when sleeping "The system will store a copy of memory to persistent storage (the disk), and will power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from hibernate image." (from pmset man). So it's always writing RAM to SSD regardless.
 
Last edited:

Queen6

macrumors 604
You just said that 10800 seconds or 1200 are the same, login screen take same time. But 10800 use 3% in 3 hours, so that's a problem ?
I agree, equally the solution is somewhat flawed, the power consumption is due to something in the system, by modifying the standbydelay you are just "cutting the cord" to whatever is "calling home" waking up the Notebook. My own 1.2 MacBook does not exhibit this behaviour during standby, the bigger question is why do some other MacBook`s drain, and what is the root cause of the wakeups.

I would start with;

cat /var/log/system.log | grep -i "wake reason"

Q-6
 
Last edited: