Opedirectoryd taking >90% of CPU + thousands of messages in console per second

Solution 1:

I've got an answer to this problem for people coming here with this issue who aren't using Active Directory (meaning that it can't be the cause).

For me the problem was my Dropbox was struggling with broken symlinks inside my Dropbox folder. I had about 20-25 of these broken symlinks. You can see if this is the problem for you by whether the problem goes away when you quit Dropbox (and wait a bit for the Activity Monitor to calm down).

You can see the location of these broken symlinks with:

cd ~/Dropbox
find . -type l ! -exec test -e {} \; -print

If you want to then delete these (they're broken after all, just get rid of them), you can run this:

find . -type l ! -exec test -e {} \; -print | xargs rm

I quit my Dropbox program before doing this. After turning it back on, the problem was gone!

Note: I ran this with gfind instead of find, which is the GNU version of find that you can get by doing brew install findutils. It should work perfectly fine with regular find though.

Solution 2:

OS X: If the opendirectoryd process CPU utilization is high after updating to OS X v10.9.5

You might see an increase in CPU utilization of the opendirectoryd process on systems bound to Active Directory that are updated to OS X v10.9.5.

After updating to OS X v10.9.5, Activity Monitor might report high CPU utilization for the process "opendirectoryd" on Macs that are bound to Active Directory. You can edit the Active Directory search path to correct this issue:

  1. Choose System Preferences from the Apple menu. Click the Users &
  2. Groups icon in the System Preferences window. If the lock icon is locked, click it and enter the name and password of an administrator.
  3. Click Login Options, then click Edit.
  4. Click Open Directory Utility. If the lock icon is locked, click it and enter the name and password of an administrator.
  5. Click Search Policy.
  6. Click Authentication.
  7. Remove "/Active Directory/EXAMPLE.COM” from the search path, leaving "/Active Directory/EXAMPLE.COM/All Domains” (substitute your domain for example.com).
  8. Quit Directory Utility.

I shamelessly copied the above from support.apple.com. I hope this can help you out, but for now I have no clue on your system setup.