Stop NSURLSessiond from abusing network bandwidth

Stop NSURLSessiond from abusing network bandwidth

So I've heard the are multiple reasons why this could happen. But this time I want to record how I solved it just in case my memory fails me the next time I face the same problem again... if I'm lucky enough that the reason is the same one.

What is NSURLSessiond?

NSURLSessiond is a system process on macOS that handles network requests for various apps, including web browsing, file downloads, and more. It's part of the Foundation framework and is used by many built-in macOS apps and third-party apps.

Why is NSURLSessiond using high network bandwidth?

There are several reasons why NSURLSessiond might be using a large amount of network bandwidth, including:

  1. Background downloads: If an app is downloading large files or updates in the background, it can consume a significant amount of network bandwidth.

  2. Background data refreshing: Many apps have background refresh features that allow them to update their content even when you're not using them. This can consume a significant amount of network bandwidth.

  3. Misconfigured or buggy apps: In some cases, apps may have bugs or be misconfigured in a way that causes them to use excessive network bandwidth.

  4. Syncing with cloud services: Some apps may be syncing data with cloud services, which can consume a significant amount of network bandwidth.

  5. Malware or viruses: In some cases, malware or viruses can cause high network bandwidth usage by sending data or making requests in the background.

How I found I had a problem?

I work remotely and that day I didn't have access to Wifi, so I turned on the Personal Hotspot on my iPhone which is more than enough to show up on our daily meetings, browse StackOverflow, answer some tickets, create PRs on GitHub... the usual dev work.

The network bandwidth monitor(from iStats Menu) was running crazy and pointing to NSURLSessiond as the culprit. Nothing alarming... until I noticed my iPhone was hot as hell! The charging stopped with the message "Charging On Hold. Charging will resume when iPhone returns to normal temperature."

How I found the solution?

So I had to make it stop. I started googling and tried a couple of suggestions, then a couple more... nothing... some people blaming the iOS Simulator, or suggesting some dark command line magic to stop NSURLSessiond from working correctly by blocking connections, killing it, and/or stopping it from loading(never ever copy/paste command line commands if you don't know what you are doing)

The solution was way simpler: it was the system downloading updates.

Just open the "System Preferences" -> "Software Update", then click "Advanced..." and disable "Download new updates when available"