Found this at my favourite hints site (macosxhints.com) -
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:
creates a pipe that only allows up to 15KB/s to go through.Code:sudo ipfw pipe 1 config bw 15KByte/s
Then:
will attach that pipe to the outgoing traffic on port 80, effectively limiting the outgoing traffic of the web server.Code:sudo ipfw add 1 pipe 1 src-port 80
will remove the pipe from the port.Code:sudo ipfw delete 1