iMac running High Sierra is very slow — photoanalysisd can't be killed?

My iMac running High Sierra has become painfully slow.

I suspect photoanalysisd, as it's using a lot of CPU time, but I can't figure out how to get rid of it.

There's at least one other question (What is "photoanalysisd" and why is it using 77% of my CPU?) here about photoanalysisd, but my scenario is different and none of the suggestions in the other thread were helpful to me.

Looking in the Console log, I see odd errors for photoanalysisd, e.g.:

"seekAndRead -- Input/output error"
"error: (266) I/O error for database -- CLSBusinessCategoryCache.sqlite.  SQLite error code:266, 'not an error' errno:5"
"error: -executeRequest: encountered exception = I/O error for database at ... CLSBusinessCategoryCache.sqlite.  SQLite error code:266, 'not an error' errno:5"

Error code "not an error" -- huh?

Using the Terminal, I've tried all of the following:

sudo launchctl remove com.apple.photoanalysisd
sudo launchctl kill -TERM gui/$UID/com.apple.photoanalysisd
launchctl disable gui/$UID/com.apple.photoanalysisd
launchctl kill -STOP gui/$UID/com.apple.photoanalysisd
launchctl kill -TERM gui/$UID/com.apple.photoanalysisd

BUT photoanalysisd is still running, according to the Activity Monitor. Even after I issue commands to kill the process(!?), it's still there. Of course it also comes back when I restart, and slows the machine horribly again.

First question, then: why don't these commands get rid of photoanalysisd?

Next, I have tried starting in safe mode, but it makes no difference: the iMac is still unusable, until I issue commands to kill photoanalysisd.

Also, the screen updates are incredibly slow in safe mode. The desktop appears very slowly and is painted in bands like venetian blinds opening up from the bottom. Never seen this before.

Again, there is nothing in the Activity Monitor that is obviously eating up CPU or memory. Activity Monitor consistently reports over 90% idle, though the system is beachballing constantly.

Finally, I have already re-installed High Sierra once, but it made no difference.

I really don't care if the Photos app does the person recognition thing or not. I just want my Mac to be useable again.

Any suggestions?

EDIT: 25 days later, I still have no solution to this. My basic question about photoanalysisd (above) remains unanswered.


Solution 1:

If you use iCloud photos and sync with another device, you can turned off the photos sync on Mac. In case you go to turn it back on and it gives storage full error, do as suggested in download iCloud photo to mac OS X Yosemite 10.10.3 in second paragraph.

However this will bring the problem back if you would want to use photos later. So best shot can be leaving it on overnight by disabling sleep in System Preferences and keeping it plugged in. This might give it enough time to complete the analysis.