Apple - How to simulate slow internet connections on the mac
Apple’s official tool to slow down the network connections on you Mac for testing purposes is Network Link Conditioner
- Additional Tools for Xcode [version].
Additionally, iOS has similar function accessible from within Xcode and iOS 6 or later.
Older versions of Xcode before version 4.3.2 embedded a copy of this tool. This SO thread documents some history of the tool in a similar manner to the iOS simulators and developer documentation.
There are 11 built in profiles from a Lossy Edge network with 400ms delay to a cable modem. If you need other limits, you can create custom profiles with your own settings or you can also use ipfw
yourself as described in Craig Hockenberry's article slow ride, make it easy It also mentions the Speed Limit panel by Mike Schrag that is a smaller download than Xcode, but has fewer options than Apple's tool.
It slows down the entire network stack, so you can't throttle on a per app basis without doing things like install lion in a virtual machine and set that VM with a throttled stack.
OS X 10.9 and earlier provide ipfw
and it allows you to define custom firewall rules. Create a pipe with limited bandwidth using ipfw
and you can run your tests and simulations.
Create a pipe "1" limited to 500KBytes/s via
sudo ipfw pipe 1 config bw 500KByte/s
Guide all network traffic of port 80 through pipe "1" using
sudo ipfw add 1 pipe 1 src-port 80
When you don't need the pipe anymore, remove it from the port using
sudo ipfw delete 1
Other
- If you want to set higher traffic barriers, you can use
MByte/s
- Port
80
: standard port for unencryptedhttp
traffic. This port is used for most browsing and downloading. You should be fine with this in most cases. - Port
443
: standard port for SSL encryptedhttps
traffic.
Speed Limit is a System Preferences pane for intentionally and selectively slowing down specific ports and domains.