måndag 11 oktober 2010

Rate limit a pipe

Something I often do while developing is replaying recorded network traffic.
Something along
$nc host port
to send data in the traffic.bin to host, via tcp. This will however dump the data as fast as possible, which makes it difficult to keep up with the data pace at the other end (which I try to study/debug).
A solution is to use pipe viewer which can do many things, one of them to rate limit data.
Running
$pv -L 100
gives 100 bytes per second rate. pipe viewer is installed by
$apt-get install pv
on Debian. I was just about to write a tool like this, but searched for an existing solution instead!

Inga kommentarer: