Time Machine ridiculously slow after El Capitan upgrade

Solution 1:

Part of the issue is that low priority input/output-operations (I/O) now seems to get throttled heavily. You can check it via Terminal (can be found via Spotlight (usually bound to Space) and entering terminal) then entering at the bash prompt:

sudo fs_usage backupd

and look for the THROTTLED entries. If you see them, the backup is throttled.

So if you have a ton of files, just the time it takes to do the I/O takes forever, even if the files are small (because it performs a bunch more I/O operations around xattrs etc. than it used to).

Go to a Terminal and enter:

sudo sysctl debug.lowpri_throttle_enabled=0

For me, this speed it up from 72 hours to ~4 hours on an filesystem with 2.5 million files.

It's also a good idea to re-enable the throttling after your backup finished successfully with the following command

sudo sysctl debug.lowpri_throttle_enabled=1

Solution 2:

I confirm that the command:

sudo sysctl debug.lowpri_throttle_enabled=0 

works perfectly.

If you want to make it permanent across reboot, you can do the following.

  • create a file under /Library/LaunchDaemons/fix-el-capitan-slow-time-machine-speed.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>fix-el-capitan-slow-time-machine-speed</string>
        <key>ProgramArguments</key>
        <array>
          <string>/usr/sbin/sysctl</string>
          <string>debug.lowpri_throttle_enabled=0</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
      </dict>
    </plist>
    
  • make sure the file belongs to root

    sudo chown root /Library/LaunchDaemons/fix-el-capitan-slow-time-machine-speed.plist
    
  • issue the command

    sudo launchctl load /Library/LaunchDaemons/fix-el-capitan-slow-time-machine-speed.plist
    

You can find the content of the file at this gist

Solution 3:

I found this article on the Apple discussion forums about the message that appears in the Console (while it's doing nothing or backing up at 10 bytes/second):

com.apple.backupd: Waiting for index to be ready (100)

In my case I was able to discard all old backups, so I dismounted the volume from the troublesome Mac, mounted the drive/network share from another computer (not a Mac), deleted the entire .sparsebundle directory (which took a surprisingly long time) and then started the backup again. It created a new .sparsebundle and it's now backing up at around 10 MB/sec.

If you didn't want to delete your existing backups, you could try one of the other suggestions on that page:

  • rebooting in Safe Mode and then back to normal;
  • tell Spotlight not to index the Time Machine volume/disk;
  • deleting the Spotlight index, .Spotlight-V100 (which I didn't have);
  • using mdutil to disable and re-enable Spotlight indexing on the volume:
    • sudo mdutil -i off /Volumes/Time\ Machine\ Backups
    • sudo mdutil -i on /Volumes/Time\ Machine\ Backups

(see that discussion for more details and ideas).