Sunday, 10 February 2013

MacBook Pro with Retina Display - Sometimes slow to wake ...

On rare occasions, I've noticed that my MBPr ( aka MBP:TNG ) is slow to wake up from standby.

By slow, I mean that it can take a whole 10 seconds for it to be ready to receive my password :-) Compared to previous Windows machines, 10 seconds is still lightning fast but I'm a purist !

A quick Google search brought me to this blog post: -


where the author ( E R Walter ) explains that one can use the pmset command to regulate the interval before the Mac goes properly to sleep, writing RAM ( all 16 GB of it ) out to disk to conserve power: -

What is actually happening is that these new MacBook Pro's (and recent MacBook Air's) have a new powersaving mode which Apple calls standby. Standby mode kicks in after the laptop has been in normal sleep mode for about an hour. When that happens, the contents of RAM are written to the hard drive and the RAM is powered down to further extend battery life. In theory, the laptop will last up to 30 days in standby mode. The trade off is that, when waking up, it takes a long time to reload 16 GB of RAM from the hard drive (even with SSD).

Note that if the laptop sleeps for less than an hour, then it will wake up nearly instantly. I've seen this myself in cases where I close the lid briefly while walking between meetings. This fact is the key to my workaround. It turns out that this 1 hour delay is configurable.

Following his advice, I checked the current interval with pmset -g: -

$ pmset -g

Active Profiles:
Battery Power -1*
AC Power -1
Currently in use:
 standbydelay         4200
 standby              1
 halfdim              1
 hibernatefile        /var/vm/sleepimage
 darkwakes            0
 gpuswitch            2
 disksleep            10
 sleep                60
 autopoweroffdelay    14400
 hibernatemode        3
 autopoweroff         1
 ttyskeepawake        1
 displaysleep         2
 acwake               0
 lidwake              1


which means that the Mac will go to sleep after 4,200 seconds ( 70 minutes ).

If needed, I could change it to, say, 24 hours, using the following command: -

sudo pmset -a standbydelay 86400

However, given that I'm currently spending a lot of time travelling, the conservation of energy is more important than losing 10 seconds :-)

Therefore, I'm going to leave things as-is, but at least I know how to do it in the future …..

4 comments:

Chris Whisonant said...

What would be the additional trade-off with writing 16GB to an SSD that often? I would think that may cut into the life expectancy of the SSD...

Dave Hay said...

@Chris, good point, it is definitely a trade-off, and replacing an SSD as compared to waiting a few extra seconds for wake-up .... well, it's nolo contendere really :-)

Unknown said...

It most likely think it would cut into the life expectancy of the SSD
-Apple TV WiDi

Dave Hay said...

@widi TVs - good point

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...