Operations 8 min read

macOS Optimization Guide: Disabling Time Machine, Hibernation, Enabling noatime, RAM Disk for Temp Files, and Other Performance Tweaks

This article provides a comprehensive set of macOS performance optimizations—including disabling local Time Machine backups, turning off hibernation, adding the noatime mount option, configuring RAM‑based temporary and cache directories, and disabling unnecessary SSD features—to improve system responsiveness and battery life.

Qunar Tech Salon
Qunar Tech Salon
Qunar Tech Salon
macOS Optimization Guide: Disabling Time Machine, Hibernation, Enabling noatime, RAM Disk for Temp Files, and Other Performance Tweaks

After upgrading to macOS 10.8 Mountain Lion, the author sought to apply optimization techniques similar to those used on Linux and Windows, focusing on SSD trim, disabling file access timestamps, and turning off hibernation.

The following specific measures are described:

2.1 Disable Local Time Machine Backups

Run the command:

sudo tmutil disablelocal

To re‑enable later, use:

sudo tmutil enablelocal

2.2 Disable Hibernation

Execute:

sudo pmset -a hibernatemode 0

Then remove the sleep image (for older systems):

sudo rm /var/vm/sleepimage

2.3 Add noatime Mount Option

Create a launch daemon plist (com.nullvision.noatime) with the following content and place it in /Library/LaunchDaemons/com.noatime.plist :

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.nullvision.noatime</string>
        <key>ProgramArguments</key>
        <array>
            <string>mount</string>
            <string>-vuwo</string>
            <string>noatime</string>
            <string>/</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
    </dict>
</plist>

Set proper ownership and reboot, then verify with mount that the root partition shows the noatime option.

2.4 Move Temporary and Cache Directories to RAM Disk

Use the following script (saved as MoveTempFoldersToRamDisk.sh ) to create RAM‑based filesystems for /private/tmp and /private/var/run :

#!/bin/bash
# ... (script content omitted for brevity) ...
RAMDisk /private/tmp 64
RAMDisk /private/var/run 32
# Additional RAMDisk commands can be added as needed

Make it executable ( chmod 755 ~/MoveTempFoldersToRamDisk.sh ) and run with sudo ~/MoveTempFoldersToRamDisk.sh , then reboot. After reboot, mount will show entries such as:

/dev/disk1 64Mi 3.9Mi 60Mi 7% 989 15393 6% /private/tmp
/dev/disk2 32Mi 796Ki 31Mi 3% 197 7993 2% /private/var/run

2.5 Disable Sudden Motion Sensor (SSD only)

Run:

sudo pmset -a sms 0

2.6 Disable Hard‑Disk Sleep (SSD only)

Uncheck “Put hard disks to sleep when possible” in System Preferences → Energy Saver.

2.7 Disable VirtualBox Dock Effects

In Activity Monitor, the Dock process may consume high CPU due to VirtualBox. To reduce this, right‑click the VirtualBox icon in the Dock, select “Options”, disable “Show monitor preview”, and enable “Show application icon”, which can lower CPU usage by about 20% and improve battery life.

The author, He Weiping, is a search technology and database researcher at Qunar, with extensive experience in search, distributed systems, and database technologies.

performance optimizationmacOSSystem AdministrationShell CommandsRAM Disk
Qunar Tech Salon
Written by

Qunar Tech Salon

Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.