Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Andre_Seattle

macrumors newbie
Original poster
Jan 8, 2023
4
0
photolibraryd and photoanalysisd

These two processes consume hours of CPU-time on my machine.
I have three photo libraries that are 250GB combined and I do add a couple dozen photos every other week.
That partly explains why these processes are busy. I understand.
But I don't care about "Memories", "Faces" and other searchable features in Photos and I don't use iCloud either.
I disabled all these features but CPU consumption remains very high.

So, I wrote a looping script to kill these processes every 200 seconds:

launchctl disable user/$UID/com.apple.photoanalysisd
launchctl kill TERM gui/$UID/com.apple.photoanalysisd
launchctl disable user/$UID/com.apple.photolibraryd
launchctl kill TERM gui/$UID/com.apple.photolibraryd

Still, I don't like this solution: The processes still start up every now and then and manage to update a bunch of large Photos database files. This in turn increases my backup time and size since Time Machine considers them changed and forces Spotlight processes (mds and corespotlightd) to stay busy.

I then tried to rename these two files (below) to prevent these processes to ever start up.

./System/Library/LaunchAgents/com.apple.photoanalysisd.plist
./System/Library/LaunchAgents/com.apple.photolibraryd.plist

Turns out this has to be done in Revovery mode because of Ventura's enhanced security settings.
When I started Terminal in Recovery mode and went to the above directory location as root these files were not there!
I guess they are being copied or build during normal startup ?

Question: How to stop this whole photo analysis business?
How to prevent the creation of these files?

I found these related files during my search but I don't know their function.
The first 3 files in the list below are identical! Why?

./System/Library/Preferences/Logging/Subsystems/com.apple.photoanalysisd.job.plist
./System/Library/Preferences/Logging/Subsystems/com.apple.photoanalysisd.presentation.plist
./System/Library/Preferences/Logging/Subsystems/com.apple.photoanalysisd.graph.plist
./System/Library/Preferences/Logging/Subsystems/com.apple.photoanalysisd.plist
./System/Library/PrivateFrameworks/PhotoAnalysis.framework/Versions/A/Resources/CPAnalyticsConfig-photoanalysisd.json

Would renaming those stop the analysis? Too risky?

I am on Ventura 13.1 using a 2019 iMac 3Ghz 6-core i5 and 8 GB
 
I wish we could document how much electricity is wasted on the photoanalysisd across millions of computers.
 
This thing is so stupid and invasive. Another option is to keep the library on an external drive and disconnect it. But yeah, no other fiddling around will reset it. In fact even with disabling SIP and disabling those processes and the system photo library is defaulted to a blank one, it will still mess with my main photo library (just not as much)
 
This is one of the things I love about Apple Silicon; this stuff runs on the efficiency cores and doesn't slow down or affect your machine much at all.

To be honest I'm surprised it's running for so long. If you're adding a few dozen photos it should be able to analyze them in a few minutes and be done. That's what happens for me; I hardly see them running, and it's usually only after a big import.

Try disabling sleep, and locking your Mac overnight. It should eventually finish if it's behind on your library.
 
  • Like
Reactions: Tagbert
What are the command to reenable? With it disabled, I can't open up my photo library.
Re-enable just photolibraryd
Code:
launchctl enable gui/501/com.apple.photolibraryd
launchctl kickstart -k gui/501/com.apple.photolibraryd
re-enable photoanalysisd
Code:
launchctl enable gui/501/com.apple.photoanalysisd
launchctl kickstart -k gui/501/com.apple.photoanalysisd
Log out/reboot recommended.

To remove all user modifications, delete /private/var/db/com.apple.xpc.launchd/disabled.501.plist and reboot.
Or just re-enable SIP ("csrutil enable" from Terminal in Recovery).
 
First I don't like my photos are analysed at all. Second I don't need a search by name or any other AI on my computer. Third the ****ing thing "photoanalysisd" cant be deleted, nor disabled nor anything else. Although I was able to unload the launch agent with "LaunchControl.app" in "csrutil disabled" mode. But next time I start the computer it will be active again.
 
Here is what I ended up doing: I created another account on my Mac and gave it all the access and shortcuts to my original account. In this new account I never do anything with Photos. I have been monitoring processes from this new account and I don't see any of the photos related processes being launched. It's a crude work around, I know.
 
But I don't care about "Memories", "Faces" and other searchable features in Photos and I don't use iCloud either.
First I don't like my photos are analysed at all. Second I don't need a search by name or any other AI on my computer.
Seems to me that neither of you want/need/like many of the features of Photos. Rather than hacking Photos, I suggest that you both should stop using Photos and move to a different DAM (digital asset management) which meets your requirements. Get your photos out of the Photos app (export orginals) and use another DAM from Finder to Lightroom.
 
  • Like
Reactions: throAU
I have a potential fix. In my case, it wasn't my 100 GB main library; it was a library which the system maintains for shared albums. It sits here:
~/Library/Photos/Libraries/Syndication.photoslibrary
I have everything in iCloud, so I just deleted it (which needed to force-quit the photolibraryd, and the stupid memory hog (up to 50 GB) stopped immediately.
More details in this thread.
 
  • Like
Reactions: Idgit
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.