(this is a copy of my post at the parallel thread at Sleep Wake Failure with High Sierra 10.13.2 all references to comments are from there)
It has been a while since my first intention to attempt an assessment of apple’s power management settings (PMS) in relation to the SWF problem. In the meantime, forced by desperation, I went for a Beta update, following Procladius' suggestion that it seemed to do away with the SWF reboots. The good news is that it did make a difference and since I installed the 10.13.5 beta, about a week ago I have not had a single SWF event! The reason I am not calling in with jubilation is that the change is not entirely convincing. Firstly, as mentioned by jabesse, I have not enabled ‘disksleep’, which may have ruined my hopes. However, I experienced the innumerable SWFs while my ‘disksleep’ was off, so the situation with the Beta update is still (if only partially) different.
In short, it appears to me, that the 'computer sleep' mode is no longer the same as before the HS upgrade. I am not a computer expert and have no means of determining whether and to what extend the system goes into what is defined as ‘sleep’. Such definitions are not provided clearly enough for a user to be able to determine their effectiveness.
This post may become somewhat overly extended, but I hope it provides an informative overview of possibly useful PMS options.
For a start, the iMac I use allows three parameters to be set from the ‘System Preference’ -> ‘Energy Saver’ options:
- Computer sleep (from 1min to 3h to Never) - set to 10 min at present
- Display sleep (from 1min to 3h to Never) - set to 5 min at present
- Disk sleep - circumstantially (on/off), currently off.
These are part of a bigger set, available with the Terminal command, pmset -g, as given below:
System-wide power settings:
Currently in use:
standby 0
Sleep On Power Button 1
womp 0
halfdim 1
hibernatefile /var/vm/sleepimage
powernap 0
autorestart 0
networkoversleep 0
disksleep 0
sleep 10 (sleep prevented by sharingd)
autopoweroffdelay 14400
hibernatemode 0
autopoweroff 1
ttyskeepawake 1
displaysleep 5
standbydelay 4200
Although not immediately evident from the parameter names, Computer sleep and Display sleep are recognisable by the 10 and 5 min settings respectively. Leaving aside Display sleep, as unlikely trouble maker, it is interesting to notice that in addition to Computer sleep there are four other similar parameters, namely - standby, disksleep, hibernate and autopoweroff.
The setting of ‘disksleep’ is either ‘off' or ‘on' (when possible). Hypothetically, SWF could have been caused by demand on the disk, while it attempts to go to sleep, but this setting has been ‘off’ almost all of the time on my computer, while SWF has been occurring daily over the past four months.
Similarly, ‘autopoweroff' also seems to be unlikely culprit, as it powers down the computer after the 4 hours, set with the ‘autopoweroffdelay’, which in my case has been happening without signs of malfunction.
It then appears that the remaining three parameters, (computer/system) sleep, standby and hibernate may be somehow involved in SWF, given their interdependence, according to definitions. Starting with ‘standby’:
standby causes kernel power management to automatically hibernate a
machine after it has slept for a specified time period. This saves power
while asleep.
Apparently ‘standby’ effects hibernation after the machine has slept for a specified period of time. At the same time
standbydelay specifies the delay, in seconds, before writing the
hibernation image to disk and powering off memory for Standby.
On one hand standby should activate hibernation after the computer has slept according to the ‘sleep’ timer (set by the user), on the other, the activation should not happen before the time determined with ‘standbydelay’ (set by default to 1h10min on my iMac). On the face of it, the above should not be a problem as ‘standby’ is set to 0 (off) by default and does not seem accessible via the ‘Energy Saver’ controls. The twist, however, seems to be in the definition of hibernation.
hibernatemode supports values of 0, 3, or 25. Whether or not
a hibernation image gets written is also dependent on the values of
standby and autopoweroff
For example, on desktops that support standby a hibernation image will be
written after the specified standbydelay time. To disable hibernation
images completely, ensure hibernatemode standby and autopoweroff are all
set to 0.
In my case, which I suppose is not uncommon, standby and hibernate happen to be set to 0 (off presumably), the autopoweroff, however, is set to 1 (on) and it does come into effect every day for my computer (typically overnight or when I'm away for hours). Since not all three are set 0, it seems, according to the definition, that hibernate is not disabled completely. Even though hibernate is set 0 it obviously happens when autopoweroff is effected!
Conceivably, under certain combinations of sleep conditions hibernation is attempted, while it is not provisioned for and perhaps unrecognised apple system panics lead to those darn SWF events.
To wrap up, after upgrading to 10.13.5 beta my iMac has not experienced SWF, but it seems that computer sleep never takes effect, until time comes for autopoweroff, which appears to be trouble free. People have reported in the past that, when system sleep is set to ‘never’, SWF in some cases does not happen, but this obviously is only masking the problem, not a solution.
Still Waiting for a convincing completion of this dreadful episode of macOS High Sierra update.