I had a similar need. I run s3sync over my DSL connection, but I could only leave it running at certain times because if I max out my upstream, everything comes to a crawl.
I've added support for throttling upstream and downstream.
--ulimit=<bytes/s>
--dlimit=<bytes/s>
I primarily use it for upload throttling and it seems to work well enough. I did a quick test for download throttling and it seems to work also.
How it works:
It depends on progress stream (since it need to calculate the rate), so we always use progress stream now. To toggle displaying of progress, I changed that to be a parameter in the constructor.
Rate is calculated whenever read() or write() is called. If the rate is greater than the limit, it calculates how long it would need to sleep for to bring it down to the limit, and then it sleeps that amount.
(Un)fortunately the patch is intermingled with my Content-MD5 patch.
Tienshiao