I'm with you.
So far the best I could find is that battery drain while sleeping is related to frequent(more than 0 user driven wake means frequent for me) wake up that is unexpected as a user:
uptime; pmset -g stats
0:24 up 1 day, 23:07, 2 users, load averages: 1.16 1.24 1.23
Sleep Count:86
Dark Wake Count:74
User Wake Count:21
Around 2 days without rebooting/shutdown and accumulated 74 "Dark Wake"! Although this is an extreme result due to my experiment. (setting "NoMulticastAdvertisements" to 1 for mDNSResponder and shortened standbydelay to 30 minutes on 2017-01-03 and reverted on 2017-01-04)
A ridiculously high bytes written (14.69 GB!) count from Activity Monitor:
| kernel_task |
14.69 GB |
1,004.9 MB |
64 bit |
0 |
root |
- |
No |
0 bytes |
No |
0 bytes |
4.1 |
23:38.19 |
0 bytes |
0 bytes |
0 bytes |
No |
No |
0 bytes |
0 bytes |
0 |
0 |
0 bytes |
Yes |
Although this is a side effect after setting standbydelay to half an hour. The default setting is 3 hours.
Fighting with my first mbp a few days and here is the summary of my findings:
1. hibernate mode
By default it is 3, which means whenever the computer sleep, the used RAM(maybe the compressed one) will be written to disk. This is called "Safe Sleep". -> I'm sure I will never run out of battery or all of my previous laptop knows to enter hibernate mode at low power state even sleeping, I must disable it as I wonder if writing roughly 1 GB per sleep with a high number of Dark Wake will use up too much battery unnecessary.
2. mDNSResponder
It is one of the suspect due to this: (snippet of pmset -g log)
2017-01-04 17:05:48 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=active Using Batt (Charge:45%) 7228 secs
2017-01-04 17:05:50 +0800 Wake Requests [*proc=mDNSResponder request=Maintenance inDelta=7198] [proc=powerd request=TCPKATurnOff inDelta=32430]
2017-01-04 19:05:50 +0800 Kernel Client Acks Delays to Sleep notifications: [AppleIntelFramebuffer driver is slow(msg: SetState to 0)(538 ms)]
7198 = 2h * 3600s/h - 50s-48s
This formula is true for other inDelta values.
Setting NoMulticastAdvertisement to 1 helps removing the RTC wake request by mDNSResponder. But....
3. ARPT/Network, DriverReason:WiFi.ScanOffload*
After(if you notice the date is 2017-01-03 here while 2017-01-04 for mDNSResponder above, this is because I unset the NoMulticastAdvertisement on 2017-01-04 for cross-verification) mDNSResponder no longer waking, ARPT/Network wake become very frequent when standbydelay was set to 1800 (other values may have the same effect too, not verified): (snippet of pmset -g log | grep -Ei 'reason|arpt|ec.sleep|rtc|entering sleep|maintenance sleep|EC\.[^ ]+|scanoffload')
2017-01-03 19:01:12 +0800 WakeDetails DriverReason:WiFi.ScanOffload-Unspecified - DriverDetails:
2017-01-03 19:01:42 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=active Using Batt (Charge:47%) 754 secs
2017-01-03 19:14:16 +0800 DarkWake DarkWake from Standby [CDN] due to ARPT/Network: Using BATT (Charge:47%) 30 secs
2017-01-03 19:14:16 +0800 WakeDetails DriverReason:WiFi.ScanOffload-Group key handshake timeout - DriverDetails:
2017-01-03 19:14:46 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=active Using Batt (Charge:47%) 325 secs
2017-01-03 19:20:11 +0800 DarkWake DarkWake from Standby [CDN] due to ARPT/Network: Using BATT (Charge:46%) 30 secs
2017-01-03 19:20:11 +0800 WakeDetails DriverReason:WiFi.ScanOffload-Unspecified - DriverDetails:
2017-01-03 19:20:41 +0800 Sleep Entering Sleep state due to 'Maintenance Sleep':TCPKeepAlive=active Using Batt (Charge:46%) 631 secs
2017-01-03 19:31:12 +0800 DarkWake DarkWake from Standby [CDN] due to ARPT/Network: Using BATT (Charge:46%) 30 secs
:
:
(recurring)
4. XCH1/HibernateError (check it by pmset -g log | grep --color HibernateError)
This error start appearing when the swap file was disabled by setting the boot-args of nvram. It is harder to set on this new mbp 13" 2016 with touch bar probably due to the side effect. The side effect of disabling swap file is the XCH1 failing to hibernate which caused the failure of the IOBluetoothHostControllerUARTTransport driver and thus the death of bluetooth. I discovered this story because Apple Watch Unlock no longer working for me. It took a long way to find out the cause and fix it by resetting NVRAM.
The early conclusion based on many dog fights with my first mbp:
- DON'T disable swap file until you find a way to prevent XCH1/HibernateError because your machine will have problem sleeping well and the bluetooth will become irresponsive.
- hibernatemode 0 is okay, feel free to set it.
- standbydelay SHOULD NOT be too short until you find a way to prevent the Dark Wakes.
- DON'T set the mDNSResponder's preference NoMulticastAdvertisements to 1 until you find a way to prevent the ARPT/Network Dark Wake because things will just get worse!
- pmset is our good friend, if anyone got more information about what it shows and how to dig more in details, please guide us to the paradise.
A few notes about reading pmset -g log:
- Entering Sleep state due to 'X' where X can be:
- Clamshell Sleep - when the lid is closed
- Idle Sleep - when idled for sleep delay
- Maintenance Sleep - re-entering into Deep Idle or Standby state
- (Dark)Wake from balhblahbalh due to X where X can be:
- ARPT/Network - ****, DarkWake related to WiFi, but why?
- EC.LidOpen - alright, wake by me
- EC.SleepTimer - standby time reached, hibernate!
- RTC/Maintenance - the clock set by software, most likely mDNSResponder in our case
- XHC1/HibernateError - argh, u got swap file disabled? Is your bluetooth still fine?
References that maybe helpful:
- rMBP 2015 Wake Reason: ARPT (Network) (ahha, rMBP 2015 experienced the same, a temporary workaround is to turn off WiFi before sleeping the machine)
- http://apple.stackexchange.com/questions/152305/disable-swapping-on-yosemite (any better way to disable swap file for Sierra? I have just tried the nvram one, may try those said for Sierra later...)
- Enhanced notifications that can wake your Mac - Apple Support (some useful things, will Find My Mac cause wake by WiFi?)
- If your Mac doesn't sleep or wake when expected - Apple Support (useful troubleshooting steps, try to follow it)
Lastly, I've disabled the "Wake for Wi-Fi network access" option in the Power Adapter tab to see if this affect battery use or not...good luck to me.