Brandon Rozek

Photo of Brandon Rozek

PhD Student @ RPI studying Automated Reasoning in AI and Linux Enthusiast.

Bandwidth Limiting Applications

Published on

Updated on

Warning: This post has not been modified for over 2 years. For technical posts, make sure that it is still relevant.

Whether it’s web scraping or testing low latency connections, we want to be able to bandwidth limit certain applications. I’ve written about rate limiting network interfaces before. This post focuses on the application level instead.

First if the application has an option to rate limit, then we should prefer that. Here are the ways you can rate limit in some common terminal applications. Let’s say you set the bandwidth limit as $max_kbps

rsync --bwlimit $max_kbps ...
curl --limit-rate $max_kbps ...
wget --limit-rate $max_kbps ...

If the application you want to rate limit does not have a convenient flag and is dynamically linked, then we can use the application trickle.

trickle -s -d $max_kbps -u $max_kbps
Flag Description
-s Standalone Mode
-d Download Bandwidth Consumption Rate (KB/s)
-u Upload Bandwidth Consumption Rate (KB/s)

Trickle works by replacing the socket library that is dynamically linked.

Reply via Email Buy me a Coffee
Was this useful? Feel free to share: Hacker News Reddit Twitter

Published a response to this? :