Standby (lid shut) battery drain fix

Discussion in 'MacBook' started by marcopolo007uk, Jun 24, 2015.

  1. marcopolo007uk macrumors member

    Joined:
    Jul 2, 2009
    #1
    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.
     
  2. MyopicPaideia macrumors 68000

    MyopicPaideia

    Joined:
    Mar 19, 2011
    Location:
    Trollhättan, Sweden
  3. zhenya macrumors 603

    zhenya

    Joined:
    Jan 6, 2005
    #3
    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.
     
  4. Pandarama macrumors member

    Pandarama

    Joined:
    Jun 1, 2015
    Location:
    France
    #4
    Thanks a lot, excellent. We need that Apple fix this !
     
  5. zhenya macrumors 603

    zhenya

    Joined:
    Jan 6, 2005
    #5
    There's nothing to fix - it's operating as Apple intends!
     
  6. Pandarama macrumors member

    Pandarama

    Joined:
    Jun 1, 2015
    Location:
    France
    #6
    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 ?
     
  7. zhenya macrumors 603

    zhenya

    Joined:
    Jan 6, 2005
    #7
    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.
     
  8. facrat, Jun 24, 2015
    Last edited: Jun 24, 2015

    facrat macrumors member

    Joined:
    May 15, 2015
    #8
    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.
     
  9. Queen6, Jun 25, 2015
    Last edited: Jul 18, 2015

    Queen6 macrumors 603

    Queen6

    Joined:
    Dec 11, 2008
    Location:
    Enjoying Better Things
    #9
    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
     

Share This Page