The other day, I had a server that would turn on and immediately start pushing 80+Mb/s. Needless to say, something was wrong.

I didn’t want to compromise the network, so I turned to ipfw to create a bandwidth limited pipe to apply to the port. This hint on MacOSXhints.com explains it nicely.

Advanced OS X users know that Darwin comes with ipfw, which can be used to set up a custom firewall. This same service however can be used to also limit bandwidth on specific ports.

Example:
sudo ipfw pipe 1 config bw 15KByte/s
creates a pipe that only allows up to 15KB/s to go through.

Then:
sudo ipfw add 1 pipe 1 src-port 80
will attach that pipe to the outgoing traffic on port 80, effectively limiting the outgoing traffic of the web server.
sudo ipfw delete 1
will remove the pipe from the port.

Of course, you can also find a GUI interface to this in WaterRoof.

Image