You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Why are trustd, nsurlsessiond, syslogd causing high CPU on Mac?

The syslogd high CPU I am pretty sure is a result of the excess logging coming from trustd and nsurlsessiond.

In console I am getting the same 3 messages logged constantly:

error	11:38:11.053373-0700	nsurlsessiond	Failed to obtain user-directory, errno: 5
error 11:38:11.053484-0700 nsurlsessiond Process with bundleID <private> [pid 222] does not have a bundle path, rejecting connection
error 11:38:11.053661-0700 trustd obliterateAllSessionsWithReply error handler called with error Error Domain=NSCocoaErrorDomain Code=4097 UserInfo={NSDebugDescription=<private>}
error 11:38:11.054331-0700 nsurlsessiond Failed to obtain user-directory, errno: 5


This reoccurs every millisecond or so and has been occurring since Catalina was installed. Originally after a reinstall I was running Mountain Lion and then did a bridging upgrade to Mavericks to get to Catalina. I also thought this might be due to not having iCloud setup so I logged it in but didn't change the problem.




[Re-Titled by Moderator]

Posted on Apr 8, 2020 11:42 AM

Reply
Question marked as Top-ranking reply

Posted on Jun 30, 2020 9:27 AM

Hi flipflips, I followed Jeremy's instructions, and now the issue is solved. So let me explain how to do this in more detail.


But before taking off: beware that tinkering with the Mac system using the Terminal is risky business. I had a long conversation with Apple Care, who took me through a lot of steps, and they in general advise to NOT use Terminal.

So, make sure to have a backup of all your files, and check the contents of the log-files to check that your issue is caused by exactly the same issue that Jeremy reported. That is how I did it, and it worked for me.


And if your system gets unstable, you can always go back to factory defaults, and start over from there :)


Now, first we will check the log files.

To do this, start Spotlight (the looking-glass symbol in the upper righthand corner of the screen) and type:


/var/log/asl


This brings up a Finder window with the folder with the log-files.

Those log-files have a name like:


2020.06.30.xxx.asl


You can open the log-file with the program Console (that is the default program, or you can use Open with...)


Check this log-file for lines as:


libcoreservices: __makeDirectory: 405: mkdir: path=/var/folders/zz/[randomized name]/0/ mode=0755: Operation not permitted.


The [randomize name] part is a long string like zyxvpxvq6csfxvn_n00000y800007k


This string is important: it is the name of a system subdirectory that is used by the nsurlsessiond process. Nsurlsessiond tries to write to this directory, but gets no permission, and repeats and repeats and repeats and repeats. That's why nsurlsessiond stays in the top of your list of processes, eating up to 50-60% of your CPU capacity, draining your battery, and heating your MacBook.


So check if you see these lines in your log file, to make sure your issue is the same.


To solve the issue you have to do 2 things:

  1. Kill the trustd process
  2. Delete the blocked directory, so that the OS can create a new one.


These things are done using the Terminal. You can find this program in the Launchpad, or find it using Spotlight.


First, find the name of the subdirectory (the string mentioned above). Copy it from the log-file, or find it using the Terminal.


Start the Terminal program. The Terminal window opens. After the prompt, type:


ls -la /var/folders/zz | grep nsurlsessiond


You will get an output like:


drwxr-xr-x@  5 _nsurlsessiond    _nsurlsessiond     160  9 jun 13:45 zyxvpxvq6csfxvn_n00000y800007k


The part that I made bold is the name of the subdirectory we need to delete, so copy this to your Clipboard.


Now, take a look again at the Activity monitor, and look for the trustd process, that is one of the top 3 or 4 processes in the list. It has a unique process id, the PID number (for example 219).


In Terminal, kill the trustd process, by typing:


sudo kill -9 [trustd PID]


So if the PID is 219, you type:


sudo kill -9 219


After killing this process, you will see the CPU usage drop immediately.


Now we delete the subdirectory. Again in Terminal, type


sudo rm -fr /var/folders/zz/[randomized name]


Again, replace [randomized name] with the string you copied before.


Congratulations, you are done!


Keep following your system performance for several days in the Activity Monitor.


Success!




Similar questions

125 replies

Jul 3, 2020 1:59 AM in response to elle0405

Make an extra user on your Mac. Don’t connect the new user to your AppleID. Log in as the new user. If your system is still ‘running away’ then it is an operating system issue. If not, it is one of the programs that you use in your main user account.

Use Activity Monitor to see which process eats up your CPU.

Jul 4, 2020 2:22 AM in response to Warrennj31

No, nothing will be disabled. We only delete a dictionary witch nsurlsession wants to change. Sience it has no rights to do that it tries over and over again what causes the high CPU usage.


The only thing what we do is to delete this dictionary with the logs in it, the logs are not needed anymore. Nsurlsession creates automatically a new dictionary after that.

Jul 8, 2020 8:49 AM in response to jeremywohl

Thank you so much. It wasn't clear to me whether the steps were doing anything until I tried:

# ls -la /var/folders/zz | grep nsurlsessiond

and plugged in that result.

# sudo rm -fr /var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k

Suddenly, the CPU load dropped from ~60% to 8%.

The memory pressure plot turned from yellow to green.

The energy impact plot has a dropoff like one side of the Mariana Trench.

Amazing. Thank you.

Jul 18, 2020 12:54 PM in response to jpaussa

Thanks so much - I had this problem after updating to Catalina on a mid-2012 MacBook Air and by following steps 1 & 2, the overheating has stopped. Stupid question, but I'd like to understand what was happening - why was trustd/nsurlsessiond/syslogd causing the overheating? Have I now deleted these processes permanently? And will this have any effect, other than stopping the overheating? So many thanks!


Jul 19, 2020 1:29 AM in response to JL_222

Nsurlsessiond is process that plays a tole in communicating with the cloud. It uses a subdirectory to temporarily store data. This subdirectory was created in the past, and after the Catalina update the nsurlsessiond process has no longer access to this directory (clearly a bug in Catalina). It keeps trying and trying, using a lot of CPU and heating your MacBook.

After deleting the subdirectory the OS will create a new subdirectory when nsurlsessiond needs one, and to this new subdirectory there is no problem with the access.

Jul 24, 2020 7:10 AM in response to livialazaruk

I second that! After solving the trustd issue due to the gracious help by members of this group, window server tops the list most of the times.

And I have never in 6 years of use experienced crashes after shutting the Macbook. Only with Catalina... If it were not so complicated to go back, I'd do it. I'll have a look at both issues via the search function.

Thanks for any help.

Aug 12, 2020 11:06 PM in response to jpaussa

worked for a month ....now my battery is getting hammered and Fam running again ....I did all these Steps and it worked for a month on my 2015 15” MacBook after I downloaded Catalina 15.5 I wad screwed!


i should have just kept my old 2008 15” mac and never updated. This sucks I don’t want to keep doing this!



why isn’t apple fixing this?


i even ENABLED SIP



Aug 14, 2020 1:19 PM in response to HansOo

I followed your process and was able to do the kill trustd instruction.


In bish or zsh I could not delete the subdirectory. Terminal tells me:


sudo rm-fr/var/folders/zz/zyxvpxvq6csfxvn_n00000y800007k command not found


Can I do anything else to get rid of the sub directory that continues to eat up CPU. Thank you!


Why are trustd, nsurlsessiond, syslogd causing high CPU on Mac?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.