Linux上用trickle限制进程wget的下载速度

Linux上用trickle限制进程wget的下载速度
sudo apt-get install trickle
php -S 127.0.0.1:8080 -t ./
生成一个1MB的文件test:
dd if=/dev/zero of=test bs=1M count=1
以256KB/s的速度wget下载1MB的test,耗时3.8秒:
time trickle -s -d 256 wget http://127.0.0.1:8080/test -O /dev/null
以256KB/s的速度curl下载1MB的test,耗时5.8秒:
time trickle -s -d 256 curl http://127.0.0.1:8080/test -o /dev/null
time trickle -s -d 256 curl http://127.0.0.1:8080/test -o test2
-s 表示独立运行,因为trickle还有一个trickled管理端可以用
-d 表示下载方向,单位都是KB/s
-u 表示上传方向,单位都是KB/s

转载于:https://my.oschina.net/eechen/blog/527455