You are here

Disable Power Saving Settings on Server

Subscribe to Syndicate

Additional Setup Considerations

Update to the latest version of OS X (10.13.6, Mojave or later). It's free.

The following settings should be made on all servers (Postgres, Apache and web listeners) that are installed on Macintosh.

1 Make sure to
  • turn OFF all energy saving options such as Prevent hard disk sleep, appnap, Do not allow the CPU to go into low processor mode, etc.
  • turn ON features like restart the Mac after a power failure'. We also suggest altering the feature to auto-start the Mac at a time like '6:00am' should it just happen to be powered off. This way, your servers should always be on.
  • enable auto-login on machines with TM Server if it will have classic listeners, and set the machine so that you can lock the screen after inactivity. The classic listeners will halt if not running under a user.

    If you cannot set a mac to auto-login, it may be that file vault and/or cloud password needs disabled.

2 Make sure to turn Airport OFF if the Mac comes with it. Airport will cause the Mac to temporarily freeze while it looks for a network to connect to - and will lock out sales while it does that.

This is done by opening the control panel, clicking on the Airport interface, and then clicking on the 'gear' at the bottom to select the option 'make service inactive'. Doing this will change the status from 'off' to 'inactive'

3 Make sure to force the mac mini to use the built in Graphics Processor Unit (GPU) when displaying screen shots instead of CPU. This prevents remote access using up a cpu core to display the screen. You can do one of the following:
  1. physically plug in a monitor to the Mac-or-
  2. connect a KVM switch into it that is powered up. -or
  3. use an attachment like a Headless Video Adapter

Disconnecting a monitor from the Mac will cause the the computer to unnecessarily waste CPU cycles on display - when it should use the GPU.

4 Turn off Spotlight Indexing (mdsworker) using Terminal and typing

sudo mdutil -a -i off

On Lion and later, also use the following command

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

This will prevent the operating system from doing unneccessary work while serving web pages. To recognize if Spotlight is running on a server, look for an 'mds' application running. It can use a lot of CPU resources. If you receive Operation not permitted while System Integrity Protection is engaged while doing this, you may wish to disable System Integrity Protection

note: If any mdworker messages are in the console logs (or if mdworker pops up in activity logs), then Spotlight is not turned off.

5 If the Security and Privacy System Preference in High Sierra does not show 'Anywhere' which allow applications to run from 'Anywhere', open Terminal and type

sudo spctl --master-disable

You may have to close System Preferences and open it again in order to see the change. If Anywhere is not selected, please select it - as it should allow TM to run when the user is not an administrator. Installers from TM should make this option visible.

6 Using Terminal, disable Time Machine for the database folder (optionally, completely disable and local Time Machine files)

sudo tmutil addexclusion /Library/PostgreSQL
sudo tmutil disable
sudo tmutil disablelocal (only for sierra and earlier)
sudo tmutil thinLocalSnapshots / 10000000000 4 (for sierra and later to thin local backups if time machine enabled and you need space)
Alternatively, you can disable Time Machine through System Preferences.

If you must use time machine on the database server, see the next step for options

7 Do not use Time Machine for the Postgres backups. Use the backup script and move the backups to another machine. If Time Machine must be used on the database server machine:
  • make /Library/Postgresql one of the folders that is ignored by Time Machine.
  • change the backup interval so it is less frequent. 3600 is 1 hour (the default), 43200 is 12 hours. Use terminal and enter the following command.>/li>

sudo defaults write /System/Library/LaunchDaemons/com.apple.backupd-auto StartInterval -int 43200

8 Completely turn off any automatic Software Updates in the Mac's System Preferences. This is a database machine and should be manually updated on a periodic basis under controlled circumstances.

It may be either under 'Software Update' or 'App Store', depending on the version of OS X you have.

9 Completely disable App Nap on the computer running the Classic Listener using the Terminal command below:

defaults write NSGlobalDomain NSAppSleepDisabled -bool YES

10 Update the version of OS X to 10.13.6 or later. Its free
11 Disable 'handoff' in general system preferences as well as disconnect from iCloud.