Back to resources
Two little programs:

flowmeter is quite efficient - it dynamically adjusts its read buffer size to keep latency down and to keep system load a constant.

flowlimit is a realitively CPU intensive implementation, it's actually quite a hard problem better ideas wanted.

[james@circe flowmeter]$ flowlimit 9453 < /dev/zero | flowmeter > /dev/null
6.1s rate:9.2 K/10.5 K bytes:64.0 K (read size 8192)
10.4s rate:10.0 K/10.0 K bytes:104.0 K (read size 16384)
12.1s rate:9.3 K/9.9 K bytes:120.0 K (read size 8192)
18.2s rate:9.2 K/9.7 K bytes:176.0 K (read size 8192)
20.8s rate:9.2 K/9.6 K bytes:200.0 K (read size 16384)
24.3s rate:9.2 K/9.6 K bytes:232.0 K (read size 8192)
30.3s rate:9.2 K/9.5 K bytes:288.0 K (read size 8192)
31.2s rate:9.2 K/9.5 K bytes:296.0 K (read size 16384)
36.4s rate:9.2 K/9.4 K bytes:344.0 K (read size 8192)
41.6s rate:9.2 K/9.4 K bytes:392.0 K (read size 16384)
42.5s rate:9.3 K/9.4 K bytes:400.0 K (read size 8192)

[james@circe flowmeter]$ 

The first number is a short term average, the second the average since the program started. You get status every 10s so don't be impatient. [9453 b/s == 9.23 K/s]

Take me to the files