Slow Bitcoin Core Syncing on a Mac

opengraph

It’s been a while since I’ve run Bitcoin Core. Recently, I started it up again and ran into the dreadfully long wait of getting it synced up to the blockchain. The problem is, it was sycing far slower than even it’s usual slow self. It would have taken weeks to sync up. This was disconcerting since the developers have been promoting that changes made to it in version 0.10 make if faster to let it sync than getting a copy of the blockchain using Bit Torrent. I’m using version 0.11.2.  What’s going on? For me it boiled down to two things, but the first was enough.

1. Database Cache Setting

In the app’s Preferences, there is a setting for database cache which is by default set to 100 MB. If you’re using slow and old hardware like me, this becomes a more critical setting. It was suggested here that 500 MB or even 1000 MB is a better setting during the initial sync. Once synced, you can roll it back down to 100 MB and give your other apps some room back.

bitcoinCoreOptions

I tried 500 MB, restarted the app and saw a huge improvement. Intead of weeks, I was down to many days or maybe a week. I then tried 1000 MB, restarted, and think I saw further improvement, but I suspect I was reaching the point of diminishing returns. The sync was down to days, which was good enough for me.

2. Mac App Nap

Since Yosemite, Macs now try to put apps that aren’t doing anything into a low funcitoning state that makes the Mac use less energy. It’s been claimed many places that app is being hamstrung by being put to sleep by the OS. This makes sense, and it’s supposed to be as simple as setting a checkbox in the app's Information window. The problem is, on my Mac, this checkbox does not appear. I have yet to understand why. If I open Application Monitor and look at the Energy tab, I can see if the Bitcoin app is napping. It doesn’t appear to be, but it could be when I’m not looking.

There’s a way to set this from the Terminal, but I haven’t tried it and it gets mixed results. To disable it should be:

defaults write org.bitcoinfoundation.Bitcoin-Qt NSAppSleepDisabled -bool YES

And reenable:

defaults write org.bitcoinfoundation.Bitcoin-Qt NSAppSleepDisabled -bool NO

When I saw the sync would be finished in a few days, I didn’t even try. But, if you really hate App Nap, here’s how you can kill the whole thing.