24

enter image description here

I am trying to find a solution to prevent nsurlsessiond using up all my bandwidth. It is using 2GB of data daily. I have also tried the links below. Because of this issue I am not able to complete my company work. Please can anyone help?

  1. https://forums.macrumors.com/threads/nsurlsessiond-heavy-network-usage.2027130/
  2. https://forums.macrumors.com/threads/nsurlsessiond-process-going-crazy-on-catalina.2228994/
  3. https://forums.macrumors.com/threads/nsurlsessiond-downloading-data.1785204/
  4. https://discussions.apple.com/thread/6605949

I am getting this while on click nsurlsessiond.

enter image description here

ClimateUnboxed
  • 7,106
  • 3
  • 41
  • 86
Rahul Parikh
  • 442
  • 1
  • 4
  • 18

8 Answers8

23

I fix it by disabling Software Updates.

Go to System Preferences -> Software Update

Click on Advanced... and uncheck "Check for Updates"

enter image description here

Edit

I had this issue again recently but only when i opened the iOS simulator. I don't know what's the problem but the simulator will use internet for about 500MB and back to normal. Either you can wait until simulator stops downloading or just block the url using firewall as @Lutze explained

Roy Ryando
  • 1,058
  • 12
  • 30
1

The main problem is that any application can delegate transfers to the NSURLSession Daemon. As a workaround you could use an application firewall like Little snitch to detect and block the specific domain where the traffic comes from.

In my case it was "osxapps.itunes.apple.com" that took a lot of bandwidth.

Screenshot of little snitch with the blocked domain

Lutze
  • 11
  • 1
1

Best Solution:

You can create a script that runs whenever nsurlsessiond is created and stops it automatically, you can use launchd, a built-in system service on macOS that manages processes and runs scripts at specific intervals or in response to specific events.

Here are the steps to create a launchd script that monitors nsurlsessiond and stops it automatically:

1- Open the Terminal application on your MacBook.

2- Create a new launchd configuration file by running the following command:

nano ~/Library/LaunchAgents/com.example.nsurlsessiond-monitor.plist

This will open the nano text editor and create a new file named com.example.nsurlsessiond-monitor.plist in the LaunchAgents directory.

3- Paste the following XML code into the nano text editor:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
  <dict>
    <key>Label</key>
    <string>com.example.nsurlsessiond-monitor</string>
    <key>ProgramArguments</key>
    <array>
      <string>/bin/bash</string>
      <string>-c</string>
      <string>while true; do
          if pgrep nsurlsessiond > /dev/null; then
            killall nsurlsessiond
          fi
          sleep 5
        done</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
    <key>KeepAlive</key>
    <dict>
      <key>SuccessfulExit</key>
      <false/>
    </dict>
  </dict>
</plist>

This code defines a launchd configuration file that runs a bash script that checks if nsurlsessiond is running every 5 seconds and stops it if it is. The KeepAlive key ensures that the script is always running, and the SuccessfulExit key ensures that the script is restarted if it exits with an error.

4- Save the file and exit nano by pressing Control+O, then Enter, and then Control+X.

5- Load the launchd configuration file by running the following command:

launchctl load ~/Library/LaunchAgents/com.example.nsurlsessiond-monitor.plist

This will register the launchd job and start running the script.

Now, whenever nsurlsessiond is created, the script will automatically stop it. If you want to stop the script manually, you can unload the launchd configuration file by running the following command:

launchctl unload ~/Library/LaunchAgents/com.example.nsurlsessiond-monitor.plist
0
launchctl unload /System/Library/LaunchAgents/com.apple.nsurlsessiond.plist
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlsessiond.plist
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.nsurlstoraged.plist

This works for me.

Jin Lee
  • 3,194
  • 12
  • 46
  • 86
SIMBIOSIS surl
  • 357
  • 3
  • 15
  • 1
    While this code may provide a solution to the question, it's better to add context as to why/how it works. This can help future users learn and eventually apply that knowledge to their own code. You are also likely to have positive-feedback/upvotes from users, when the code is explained. – Amit Verma Feb 13 '21 at 07:21
0

Had this issue for a couple of days - i installed 11.3.1 which had been pending for a while and the issue seems to have sorted itself out.

0

if Nsurlsessiond Causes High CPU and Bandwidth Usage , do this :

1 - Go to Activity Monitor, and locate the trustd process.

2 - Copy its PID from the PID column.

3 - Launch Terminal and run the # sudo kill -9 [trustd PID] command to end the parent trustd process.

Note: Replace [trustd PID] with the PID you just copied.

4 - Run the # ls -la /var/folders/zz | grep nsurlsessiond command to find the specific “randomized name” directory. You’re going to need this information for the next command.

5 - Then, run the # sudo rm -fr /var/folders/zz/[randomized name] command to remove the nsurlsessiond temporary directory.

Note: Replace [randomized name] with the name you previously found.

source


6 - follow this solution

Adnan Abdollah Zaki
  • 4,328
  • 6
  • 52
  • 58
0

I had the same issue, then I fixed using this way:

System Settings > Apple ID > iCloud > iCloud Drive > Turn Off

Important: After this process, your data may not be synchronized with iCloud.

iCloud Settings

-2

i used cloudfare Warp App and it stopped the nsurlsessiond from downloading .

ITS WORKING for me on MacBookPro using Big sur OS :)

adel.N
  • 31
  • 3