Uploading photos to iCloud stalls unless the Photos app on Mac is active
I have a library of over 100,000 photos stored on an external Firewire drive which I've recently re-attached to my iMac, and have designated as the system library. The iMac is running Sierra 10.12.2. I've enabled iCloud photo sync, and am subscribed to 1 TB of iCloud storage which is sufficient to contain this library. In the past, I've been able to use this library with iCloud successfully.
At the moment, I'm stuck on re-syncing this library to iCloud. The Photos app has decided to traverse the entire library and is in the process of uploading it back to iCloud (or technically, I suppose that it is transmitting information about it so that it finds out if there are any differences between the local and cloud copies, which apart from a handful of recent photos, there will not be any at all). Specifically, it says that it is uploading X of Y photos.
Now, the problem is with respect to waiting for it to finish. The bizzarre thing is that the Photos app is only doing something when the app is running in the foreground on my Mac. It literally starts transmitting MB's of data when I click on its application window to bring it to the foreground. I know, because I am using iStat to show network activity. It transmits a few MB's, then after a few minutes, it stops again. I have disabled sleep on my Mac. But I have to return to my Mac and move the mouse before Photos starts transmitting again and making progress on the upload (which I can see counting down, slowly). If I switch to another app, or close Photos, then it will stop for good.
I know that normally, with a large library, that it can take a week or more to sync, which is not great but acceptable. However, in my case, I have to literally be working within the Photos app for the entire day to see any progress. I was under the impression that I can simply leave my Mac running and that it would eventually finish, and that Photos could even be closed and that a background process would do the job. But in my case, nothing happens. I don't see any sync related errors in my system log, either. It does make progress, but it is just painfully slow.
Is anyone seeing this? It's driving me crazy. By the way, I have tried turning iCloud photo sync off and then back on, but the same thing happens.
iMac, MacBook Pro, iPhone 3GS, iPod nano, Mac OS X (10.7), Apple TV, Time Capsule, Airport Extreme & Express