![]() |
學(xué)校地址:湖南省 長(zhǎng)沙市 雨花區(qū) 車站南路紅花坡路口 |
![]() |
學(xué)校地址:湖南省 長(zhǎng)沙市 雨花區(qū) 車站南路紅花坡路口 |
Linux下限制網(wǎng)卡的帶寬,可用來模擬服務(wù)器帶寬耗盡,從而測(cè)試服務(wù)器在此時(shí)的訪問效果。
1、安裝iproute
yum -y install iproute 2、限制eth0網(wǎng)卡的帶寬為50kbit:
/sbin/tc qdisc add dev eth0 root tbf rate 50kbit latency 50ms burst 1000
3、限制帶寬為50kbit后,在百兆局域網(wǎng)中wget下載一個(gè)大文件:
# wget http://192.168.1.7/test.zip
--19:40:27-- http://192.168.1.7/test.zip
Connecting to 192.168.1.7:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 23862312 (23M)
Saving to: `test.zip'
37% 8,994,816 457K/s eta 27s
下載速度為457K/s,限制效果達(dá)到。
4、解除eth0網(wǎng)卡的帶寬限制:
/sbin/tc qdisc del dev eth0 root tbf
5、對(duì)比:未作帶寬限制情況下,在百兆局域網(wǎng)中wget下載一個(gè)大文件:
# wget http://192.168.1.7/test.zip
--19:44:33-- http://192.168.1.7/test.zip
Connecting to 192.168.1.7:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 23862312 (23M)
Saving to: `test.zip'
23,862,312 6.14M/s in 3.7s
19:44:36 (6.16 MB/s) - `test.zip' saved
下載速度為6.16MB/s。
|
關(guān)于收錄1 |
關(guān)于收錄2 |
網(wǎng)站幫助 |
廣告合作 |
下載聲明 |
友情連接 |
網(wǎng)站地圖 |
| 共有文章: 16835 篇
今日新文: 0 篇
當(dāng)前在線: