2 March 2017, 06:55
I recently installed a Synology DS416j NAS for a client and they subsequently developed a strange issue that initially I was sure had nothing at all do with the NAS. In the end I learned the NAS wasn’t the cause, although it was a factor in explaining the issue.
The problem was this: Whenever anybody wrote data to the NAS it would kill the office’s Internet speed. Suddenly the staff would struggle to get 10Mbit download speeds whereas ordinarily they were able to get 70-80Mbits.
Their network setup was an Airport Extreme acting as a hub, and into that attached via Cat6E cables were the broadband modem, the new NAS – and an old Mac mini that had previously acted as a file server (staff members were slowly copying projects from this server, as required, onto the NAS).
Hmmm… To cut a long story short, the Mac mini was causing the problem and specifically the ordinarily problem-free Spotlight indexing routine. I’m still not entirely sure what the issue was but turning off network drive indexing on the Mac mini fixed the issue. Did you know that Macs automatically index network shares? No? Well, now you do.
(EDIT: Googling around shows many old blog postings that say Spotlight doesn’t automatically index network shares, but these all feature much older versions of OS X; I found the command below here, courtesy of Mac admin Pepijn Bruienne, who says network indexing is turned on by default. As with all Apple-related stuff, the workings of Spotlight is extremely opaque and incredibly difficult to fully understand, as demonstrated by Pepijn, who had to disassemble the binary of the Spotlight process to find out how to turn off network indexing!)
Turning off network indexing
To turn off network share indexing you’ll need to open the Terminal app, which is in the Utilities folder of the Applications list of Finder, and paste in the following (note that this command is just one line, even though it might appear to be several lines on your screen – triple-click it to select all of it, then copy, and then paste into Terminal):
sudo defaults write /Library/Preferences/com.apple.SpotlightServer.plist ExternalVolumesIgnore -bool True
You might see a rather stern-looking warning, which you can ignore, and then you’ll need to type your login password when prompted. You can then quit Terminal and there should be no need to reboot.
In fact, I entirely turned off Spotlight on the Mac mini, because it wasn’t needed. This can be done by pasting the following into Terminal, which is again a single line:
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
Note that this will entirely deactivate Spotlight, so you don’t really want to do this on a desktop computer. Spotlight is used for several other things in addition to helping you find stuff. For example, the App Store update component uses Spotlight.
This workplace was full of Macs and why they didn’t affect the NAS in the same way is a mystery. After all, they too all ran macOS/OS X, and presumably their versions of Spotlight were also attempting to index the NAS. However, they connected over Wi-Fi, so I guess that the direct cable network connection of the Mac mini to the Airport Extreme somehow caused it to violently gobble-up network bandwidth until the indexing was finished. Or maybe it was something more complicated, and silly. Either way, the issue was solved.
Leave a comment...
Thank you. I have an iMac with 32 gigs. Since upgrading to MacOS my drive never stops running. It’s been months so indexing of ALL connections may be the issue. It’s basically killed functionality of the machine. I wish I’d never updated the MacOS. I will try your method and see if that helps. If not it’s off to Apple it goes to rt repair.
Whoa! This tip just helped speed up some of my SFTP connections in ExpandDrive. Turns out Spotlight was indexing everytime I connected to my remove server.
You could have put a good switch on the Network and it would have fixed your problem as well.
— Tom · Mar 2, 09:46 PM · #