Since I have purchased my Macbookair, it has been going to sleep mode when I closed the lid and the apple logo on its lid would turn off. Randomly it started going to sleep mode after 15-30 mins later I have closed its lid and sometimes it never went to sleep. I typed "pmset -g assertions
" in the terminal of my mac and these were the results:
Assertion status system-wide:
BackgroundTask 0
ApplePushServiceTask 0
UserIsActive 1
PreventUserIdleDisplaySleep 0
PreventSystemSleep 0
ExternalMedia 0
PreventUserIdleSystemSleep 1
NetworkClientActive 0
Listed by owning process:
pid 117(hidd): [0x0003be5000098b76] 00:28:29 UserIsActive named: "com.apple.iohideventsystem.queue.tickle.4294995445.11"
Timeout will fire in 119 secs Action=TimeoutActionRelease
pid 331(useractivityd): [0x0003c4fb00018c32] 00:00:01 PreventUserIdleSystemSleep named: "BTLEAdvertisement"
No kernel assertions.
Idle sleep preventers: IODisplayWrangler
I didn't fully understand these results and tried several ways to solve my issue and I would very much appreciate it if someone could help me understand sleep and wake troubleshooting on the command line or from logs and settings.
Best Answer
Your output from
pmset -g assertions
matches mine perfectly - nothing there would prevent a quick sleep. To dig into this deeper, I like to open a command line windows/tabs and run two commands in different shells:You can change the 5 counter - I usually use
iostat 60
or more to track long term CPU and IO trends, but sleep wake happens pretty quickly when things are running correctly with "out of the box" power settings and a fresh / new OS installation.Here you can see the timing on the lid down and lid up:
Here you can see the jump in the
iostat 5
where the CPU was idle entering sleep (the 4.00 1 0.00 1 1 98 being low IO, and 98 % idle CPU) for the first two lines go together. Most of the values jump up the three "intervals" when I woke the lid from sleep and the CPU kicked in gear to run all the tasks needed to wake from sleep and resume apps / catch up on periodic activities missed while sleeping)