2

My Energy Saver system preferences look like this:

Energy Saver

The thing is, I don’t want my Mac to ever go sleep — especially last night when I had Handbrake transcoding a ton of important files I was expecting to be done this morning. I woke up to discover Handbrake stopped sometime after I walked away from it last night, only to continue transcoding again after I logged back into my Mac this morning.

Why in the world did it put itself to sleep when it was so clearly busy? All 12 cores of the processor were going to town! How do I ensure my Mac Pro does NOT go to sleep, especially when it should be working hard?

Technical details, if needed:
Mac Pro 2013 (trash can edition)
12-Core Processor
64GB RAM
1TB SSD
macOS High Sierra 10.13.5

  • You control panel sounds different to mine... Above 'Display sleep' should be 'Computer sleep', which you didn't mention. That's the key parameter. Set it to Never. [I'm on a 2012, but they can't be that different, can they?] Pic for comparison - i.stack.imgur.com/Lk543.png – Tetsujin Jul 8 '18 at 17:40
  • Interesting. Do you have High Sierra? No 'computer sleep' on mine. – Mark Jul 8 '18 at 22:47
  • Yes, same OS, just on a cheesegrater not trash can – Tetsujin Jul 9 '18 at 6:50
  • Thanks for marking my answer as the solution, please also upvote by clicking the uparrow next to my answer ;) – JBis Jul 10 '18 at 11:07
2

Had this issue with a server computer. The only reliable (I have used this for 6 months+ without a single issue) native solution I found was by using the caffeinate command.

The command I use to prevent sleep is caffeinate -s. You can add a time limit with the -t [# of seconds] flag but since you want it never to go to sleep you don't need it.

Heres the man page:

CAFFEINATE(8)             BSD System Manager's Manual            CAFFEINATE(8)

NAME
     caffeinate -- prevent the system from sleeping on behalf of a utility

SYNOPSIS
     caffeinate [-disu] [-t timeout] [-w pid] [utility arguments...]

DESCRIPTION
     caffeinate creates assertions to alter system sleep behavior.  If no
     assertion flags are specified, caffeinate creates an assertion to prevent
     idle sleep.  If a utility is specified, caffeinate creates the assertions
     on the utility's behalf, and those assertions will persist for the dura-
     tion of the utility's execution. Otherwise, caffeinate creates the asser-
     tions directly, and those assertions will persist until caffeinate exits.

     Available options:

     -d      Create an assertion to prevent the display from sleeping.

     -i      Create an assertion to prevent the system from idle sleeping.

     -m      Create an assertion to prevent the disk from idle sleeping.


     -s      Create an assertion to prevent the system from sleeping. This
             assertion is valid only when system is running on AC power.

     -u      Create an assertion to declare that user is active. If the dis-
             play is off, this option turns the display on and prevents the
             display from going into idle sleep. If a timeout is not specified
             with '-t' option, then this assertion is taken with a default of
             5 second timeout.

     -t      Specifies the timeout value in seconds for which this assertion
             has to be valid. The assertion is dropped after the specified
             timeout. Timeout value is not used when an utility is invoked
             with this command.

     -w      Waits for the process with the specified pid to exit. Once the
             the process exits, the assertion is also released.  This option
             is ignored when used with utility option.

EXAMPLE
     caffeinate -i make
:
1

caffeinate is your friend. Open a terminal "window", type man caffeinate and read it. The options allow you to use caffeinate in a general, or a selective way. For example, assuming the Handbrake PID is 123:

caffeinate -w 123

This command will create an assertion that keeps your Mac working as long as Handbrake is running, and then releases it, allowing your Mac to go to sleep.

If you have further questions, please let us know.

0

Try unchecking Prevent computer from sleeping automatically when the display is off. Now close System Preferences. Then go back in and check that checkbox back on.

I’ve had instances where what was displayed in System Preferences didn’t match what was actually set. Changing one setting should cause macOS to reapply your preferences.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .