Throttle network bandwidth per application in Mac OS X

I notice that iTunes seems to suck up all my bandwidth and doesn’t play nice with other applications that use the web when it's downloading. In fact, it doesn't even give itself enough bandwidth when browsing the iTunes Store while downloading large or many files (podcasts, TV shows, large apps, etc).

I'm not concerned with getting all my downloads as soon as possible, they're really low priority, and I'd rather not have to do this while I'm awake, but I can't hit the refresh button if I'm in bed and forgot it already.

Is there an application or tool via the Terminal to limit the download bandwidth that iTunes gets without also hindering web browsers or other applications?

FOSS/GPL software is preferable, but pay software might be acceptable too.


GUI:

  • Network Link Conditioner (preference pane, part of Apple's Developer Tools)
  • Entonnoir (window, donationware) - Deprecated, no longer supported on modern MacOS
  • speedlimit (preference pane, free as in beer)
  • slowyapp (menuitem, payware)

CLI (no port-specific filtering but can be adapted):

  • OSx Bandwidth Throttler
  • throttle.sh

These tools rely on ports or port ranges as a filter criterium. If you don't know what ports your application uses you can check its documentation or use lsof while the appplication is running to reveal the ports numbers.

sudo lsof -i -P

Most or all of the tools use ipfw which is officially deprecated in favor of pf, so not sure if these solutions will work on OS X 10.9 and beyond.


Old question, but I just got in the thick of a similar problem so I thought I'd reply.

The problem is probably actually due to traffic shaping at your ISP. They aggressively prioritize traffic to known content providers in an effort to provide better streaming service to customers. I'd argue they've gone a little too far in some cases - I just diagnosed a similar problem where a background iCloud photo upload was causing ping times in excess of 45000 ms.

In order to resolve the problem, you can simply reduce the amount of total bandwidth your computer will use in order to prevent the ISP's traffic shaping from completely robbing bandwidth from all other applications. Ironically, this will improve browsing performance on your own computer, in addition to obviously improving performance for other computers on your network. If for example you've got a 15Mbps downstream cap, you can limit your computer to only using 12Mbps of it, and the ISP algorithm will no longer see the need to shape your traffic as aggressively:

sudo ipfw pipe 1 config bw 12Mbits/s
sudo ipfw add 1 pipe 1 tcp from any to me

In my case, it was upstream bandwidth (capped at 1Mbps by my ISP) that was the limiting factor, so I ran the following, which solved my problem:

sudo ipfw pipe 1 config bw 768Kbits/s
sudo ipfw add 1 pipe 1 tcp from me to any

Note that these commands will only be effective until a restart, but to cancel the rule, just do the following:

ipfw delete 1

How about waterroof? It's an easy front end for IPFW. (And open source.)


Use IceFloor on [Mountain] Lion