This question already has an answer here:
I am running a /Library/LaunchDaemons service at boot time - nobody is logged in. I want the computer to not sleep. Here's my
pmset -g on macOS Sierra 10.12.4:
System-wide power settings: Currently in use: standbydelay 4200 standby 0 womp 1 halfdim 1 hibernatefile /var/vm/sleepimage powernap 0 gpuswitch 2 networkoversleep 0 disksleep 10 sleep 0 autopoweroffdelay 28800 hibernatemode 0 autopoweroff 0 ttyskeepawake 1 displaysleep 10 acwake 0 lidwake 1
Whenever I log in through SSH, it takes a while, and whenever I try to connect to my running service via HTTPS there is a long delay (10 seconds or so). It seems like the system is going to sleep. I can't figure out how to disable this.
I have logged in as a user (only user on system), and set computer sleep and display sleep to never, unchecked put hard disks to sleep, left wake for network access on, and unchecked power nap. This is all for Power Adapter mode. Automatic Graphics Switching is still enabled.
This seems mostly related to not having a user logged in. When I'm logged in, it doesn't go to sleep.