What your Macbook Air is doing when its supposed to sleep

Hello,


coming from a Linux world, I recently got a new Macbook Air M1 2020 from the Apple Store to use it as, well, portable computer. And I think its great! The performance and battery life are fantastic. Though one thing that bugs me is the fact, that the Macbook loses battery charge during sleep or even when supposed to be shut down.


Now I am not new to the Apple world, my first Macbook was a Macbook 2007 (the white one) and this could sleep for days and weeks without losing battery charge. Even months, as i noticed, when I stopped using it that often.


So I am wondering, why this new Macbook Air, who's battery and power management is obviously so good and advanced, that I am not able to completely drain it on a normal work day, is losing about 2-3 % battery charge over night, when its supposed to be off.


Apple states, this is to be "expected". Me personally, I would not expect battery drain for no reason. I am an engineer with a degree in electronics and a background in IT and I know this does not happen without a reason other than the power being used or a technical defect. However, I am reading lots of stories on the internet, where people state the exact same issue with their similar Macbook Air or Macbook Pro. Therefore I figured, the power must be consumed by the computer. So I am wondering what is running in the background. Which tasks are so important, that they are running, even when the computer is supposed to be switched off? There is nothing I can think of. I have deactivated Siri and location services. Is the computer still eavesdropping on me? Giving away my location to the "Find my Mac" service? Maintenance Tasks, the whole night, on a pristine computer with almost no software, other than the operating system? Bitcoin mining? Working for the World Community Grid? I also do not need frequent checks on new Mail or other messages that I needed to be notified about. In the end I still have a phone who does this. Activity Monitor shows no apps with significant power usage, only in the Battery Settings I can see on the "last 10 days" tab, that there was a battery drain with the display off. Needless to say, that the Macbook Air was not connected to any external devices during that time, also no bluetooth devices attached.


If possible, I would like to know what is happening here.


Thanks,


Michael

Posted on Feb 7, 2022 2:58 AM

Reply
Question marked as Top-ranking reply

Posted on Feb 11, 2022 10:11 AM

So I have now put the Macbook Air in question through two sleep phases, each of about 6 hours, without using it between sleep phases, other than to briefly check the battery state.


It looks like I have a working solution for the problem, so far without any noticeable side effects.


On the Macbook Air M1 2020 running Monterey (12.1) the powernap can be disabled and disabling it will stop the mentioned battery drain during sleep. Although there is no option in the System Preferences to do so, you will have to go to the terminal and disable it there. Be warned that you are doing this at your own risk.


with

% sudo pmset -a powernap 0


you can disable powernap. The option is persistent through sleep cycles (have not tested reboots).

Since you are altering critical system behaviour, you can only run this command as an administrator and you will be asked for your password. the option -a sets powernap for both, battery operation and charger connected. If you want to disable powernap only while on battery, but keep it enabled, when the Mac sleeps and has the charger connected, use -b instead of -a.

For more information you can see the manual for pmset by typing


% man pmset


I warn you again: Here be dragons! Please only change settings which you understand and are aware of the consequences, especially with the hibernationmode, since not all Macs support the same settings.


So far I tested sleeping only for a couple of hours with powernap disabled. Time will tell if it works for me during longer periods.


On some other forum I read that someone has also disabled the setting tcpkeepalive and made sure that wake on LAN is turned off in the System Preferences (which I have turned off too). I have not tried disabling tcpkeepalive yet, but might, if powernap disabled alone shows inconsistent results. However, I have not found a manpage entry for tcpkeepalive, so I am not fully aware of what this is doing, but the part tcp indicates, that it has to do something with network connections.


Thanks & br,

Michael


Similar questions

15 replies
Question marked as Top-ranking reply

Feb 11, 2022 10:11 AM in response to michaelmichael123

So I have now put the Macbook Air in question through two sleep phases, each of about 6 hours, without using it between sleep phases, other than to briefly check the battery state.


It looks like I have a working solution for the problem, so far without any noticeable side effects.


On the Macbook Air M1 2020 running Monterey (12.1) the powernap can be disabled and disabling it will stop the mentioned battery drain during sleep. Although there is no option in the System Preferences to do so, you will have to go to the terminal and disable it there. Be warned that you are doing this at your own risk.


with

% sudo pmset -a powernap 0


you can disable powernap. The option is persistent through sleep cycles (have not tested reboots).

Since you are altering critical system behaviour, you can only run this command as an administrator and you will be asked for your password. the option -a sets powernap for both, battery operation and charger connected. If you want to disable powernap only while on battery, but keep it enabled, when the Mac sleeps and has the charger connected, use -b instead of -a.

For more information you can see the manual for pmset by typing


% man pmset


I warn you again: Here be dragons! Please only change settings which you understand and are aware of the consequences, especially with the hibernationmode, since not all Macs support the same settings.


So far I tested sleeping only for a couple of hours with powernap disabled. Time will tell if it works for me during longer periods.


On some other forum I read that someone has also disabled the setting tcpkeepalive and made sure that wake on LAN is turned off in the System Preferences (which I have turned off too). I have not tried disabling tcpkeepalive yet, but might, if powernap disabled alone shows inconsistent results. However, I have not found a manpage entry for tcpkeepalive, so I am not fully aware of what this is doing, but the part tcp indicates, that it has to do something with network connections.


Thanks & br,

Michael


Feb 10, 2022 10:40 AM in response to michaelmichael123

Meanwhile I have snooped around on the global data exchange and found this blog:

https://mackeeper.com/blog/mac-sleep-modes-explained/

which sheds a bit more light on the situation.


Reading from the system report, my Mac, while on battery, is set for hibernation mode 3, which means "save RAM to disk, but have RAM powered" and this enables the system to stay on while supposed to sleep. Also when performing


% pmset -g


it shows hibernatemode 3.


% man pmset


explains the hibernation modes the same way as in the blog article, just for confirmation (good to see some proof, that macOS under the hood is still made of the same bones as BSD, where it originates from :D)


Sections of interest are:


hibernatemode = 3 by default on portables. 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.

hibernatemode = 25 is only settable via pmset. The system will store a copy
of memory to persistent storage (the disk), and will remove power to
memory. The system will restore from disk image. If you want "hibernation"
- slower sleeps, slower wakes, and better battery life, you should use this
setting.


Whats interesting though as well, are the further readings from pmset


michael@Michaels-Air ~ % pmset -g
System-wide power settings:
Currently in use:
 standby       1
 Sleep On Power Button 1
 hibernatefile    /var/vm/sleepimage
 powernap      1
 disksleep      10
 sleep        1 (sleep prevented by powerd)
 hibernatemode    3
 ttyskeepawake    1
 displaysleep    2
 tcpkeepalive    1
 lowpowermode    1


particularly the section "powernap”, which is obviously set to “on”. In the System Preferences menu I have found no option for this.


Maybe not the answer to my question, but the solution to the issues I have with it, lies here within.


Thanks & br,

Michael


Feb 9, 2022 6:01 PM in response to michaelmichael123

To answer your question Power Nap is what your Mac is doing while it's asleep, and it cannot be disabled on your model Mac.


Unlike Intel Macs, M1 Macs incorporate the features of Power Nap in its CPU. It's inherent in its design, much in the same manner as with iPhones. You can "turn off" a Mac in much the same way as one might "turn off" an iPhone, but people simply don't do that routinely. Apple believes users shouldn't be expected to concern themselves with such minutia. They applied that same design philosophy to Macs—if you're not using it, just ignore it. No need to turn anything "off".


Then, when you want to use your Mac, it's ready to be used. No time-consuming boot procedure. Would you really want to turn your wireless router (for example) on and off every time you used it? Routers require even longer to boot up, and they consume orders of magnitude more power than a sleeping Mac.


Besides, most electronic equipment these days can no longer be "turned off" in a conventional, traditional sense. There are several good reasons for that (and some less than good reasons), but the one that applies most to lithium-ion battery powered devices are limitations in the batteries themselves. They are constructed with inaccessible internal electronic components designed to preclude the possibility of thermal runaway, so they always have to maintain a certain minimum state of charge. If it drops below that, it electrically isolates the battery from the device it powers. Macs (and iPhones) are designed to cope with that.


Any electronic device that powers itself on and off with a momentary contact always needs some power to monitor the "power button" such as it is. The amount of power it needs to do that is tiny, but it's not zero. However, even if we did have a real power switch on Macs, the lithium-polymer battery itself will still consume some tiny, non-zero amount of power, just sitting there unused.

Feb 10, 2022 1:08 PM in response to michaelmichael123

So the original question of mine should be rephrased to:
"What is my Macbook Air doing when I put it to sleep with WiFi on and how can I prevent this?"


Power Nap describes what it's doing, and no you can't turn it off. Not unless you want to completely shut down the Mac, and as you know even that will not completely eliminate power loss.


To put it to the point: I believe the user should have a choice, some options to ensure there is no processing or battery drain during sleep whatsoever, especially when on battery.


Shut it down, if that is your choice. That's all you can do.


Apple is characteristically silent on their power management algorithms, if for no other reason that they change them frequently at their whim. I can assure you however that they are a function of a Mac's power state, which is always known. They are selectively disabled or made to occur less frequently when the battery charge state diminishes to a certain threshold. There is no reason to be concerned about it becoming completely dead over the course of a few weeks, or even a few months. A year, yes, but any attempt to extrapolate x% of power drain per day in an effort to determine when it will become completely depleted is erroneous. It won't do that. A Li-Ion battery left on its own connected to nothing will eventually discharge though.


You could provide plenty of justification for what you believe, but it's a moot point. That's how Apple designs their products. If you disagree you are welcome to express your opinion to them directly, but personally I don't think it's worth the time.

Feb 10, 2022 9:00 AM in response to babowa

Hmm.. while I have "Automatically keep my Mac up to date" DEactivated, these options are activated:


  • "Check for updates" and
  • "Install system data files and security updates"


in the "Advanced..." dialogue.


Could be it is regularly checking, though I would be surprised, if Apple issue crucial updates every day (or night, since GMT is my timezone).


I will check if it makes any difference turning these options off too.


Feb 10, 2022 6:19 AM in response to bartzkrieg

Hello bartzkrieg,


thanks for your reply.

Relating the availability of PowerNap, the link that John posted actually suggests, that it is only available on Macs with SSDs:


"Power Nap, available on Mac computers with flash memory, lets some Mac computers ..."


unless of course Apple is referring to something else when using the term flash memory.


I tried turning off WiFi before putting the computer to sleep (closed the lid) over night and indeed the battery charge went down from 92% to 91% only.


I have not tried turning the Mac off yet and see what happens, but I remember I did turn it "off" once over night after I got the Mac, only to find the battery charge being decreased by 5 % in the morning as well. Then I read some comments about this being an "always on" machine (o_O ?). That indicated that the machine is actually not off when switched off.


Will try again tonight with WiFi off.


thanks & br,

Michael

Feb 10, 2022 7:06 AM in response to John Galt

Hello John,


I understand your elaborations, though I do not agree with some of them. While its clear, that almost no consumer electronic device has a physical power button (one that interrupts the circuit physically) and I agree with the purpose behind this, the behaviour of this Mac is not comprehensible to me.


Relating to LiIon technology, I am aware how these things work, since I studied electronics. Also this machine is by far not the first with LiIon tech and soft power buttons. Old laptops, even Macbooks -- actually I cannot think of a single laptop computer manufactured since the beginning of the 21st century, that had a physical power button. Though none of them (and as far as I remember not even the older Macbooks) have a power loss under the same circumstances. The PowerBook could sleep for a month without battery drain.


I noticed the power drain (of 5 %) also after I shut down the computer. 5 % are (in terms of this Macbook Air battery, which has a capacity of roughly 50Wh) still 2.5Wh, which is a lot to just monitor a power switch. Don't get me wrong, its absolutely negligible, if you have a device thats connected to the charger or the power grid, but on battery powered devices this is weird. I think it should be the user's choice if he/she wants to power something off, especially with battery operated devices. Yes, the Mac is spot on ready, when woken up. During the day this is really nice. But do I need this in the morning? What if I left it sleeping for 3-4 days? For example when travelling and you find yourself in a situation, where you don't know, when you will be able to charge again. Then you might end up somewhere with a dead battery.


The experiment conducted last night (switch WiFi off, then put Mac to sleep) shows a difference in power loss compared to letting it sleep with WiFi on. Therefore I figure, that this energy is being used in activities that require WiFi. One thing that comes to my mind, is that "sleeping", where the RAM is still powered in order to retain the contents, might be an answer, but taking into consideration the stated difference in power drain between WiFi on/off, this might not be the reason. Hibernation, in comparison, where the RAM contents is written to disk and reloaded when the device is powered up, would not affect power at all.


To put it to the point: I believe the user should have a choice, some options to ensure there is no processing or battery drain during sleep whatsoever, especially when on battery.


So the original question of mine should be rephrased to:

"What is my Macbook Air doing when I put it to sleep with WiFi on and how can I prevent this?"


Thanks & br,

Michael



Feb 10, 2022 1:31 PM in response to John Galt

Of course there may be no real practical use for me to solve this, and you are right, a LiIon battery discharges somewhat when left on its own, just at it degenerates over time due to physical characteristics of the cells. It makes no sense to whine over 1-2% loss of charge when sleeping oder night. Behind my intentions lies merely the need for understanding of how this thing ticks, since I am an engineer at heart. Still I want to be aware of whats happening, because with Apple products somehow always swings their attitude of "take it or leave it". Most people love it out of the box and this computer is unquestionably a masterpiece in design, power, portability, battery life and its just a joy to use it. But "perfect" things seem to always come with a flaw and this flaw is present not due to some limitations, it was built in by design for reasons which I am trying to understand.


Yet its good to know there are ways around it, which - probably also for good reason - were not made available to the random user.


I will keep testing settings and post here if I find a solution.


Thanks & br,

Michael


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

What your Macbook Air is doing when its supposed to sleep

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.