Linux下限制网卡的带宽,可用来模拟服务器带宽耗尽
2013-11-27 13:59
281 查看
Linux下限制网卡的带宽,可用来模拟服务器带宽耗尽,从而测试服务器在此时的访问效果。
1、安装iproute
yum -y install iproute
2、限制eth0网卡的带宽为50kbit:
/sbin/tc qdisc add dev eth0 root tbf rate 50kbit latency 50ms burst 1000
3、限制带宽为50kbit后,在百兆局域网中wget下载一个大文件:
[root@localhost ~]# 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) [application/zip]
Saving to: `test.zip'
37% [=======> ] 8,994,816 457K/s eta 27s
下载速度为457K/s,限制效果达到。
4、解除eth0网卡的带宽限制:
/sbin/tc qdisc del dev eth0 root tbf
5、对比:未作带宽限制情况下,在百兆局域网中wget下载一个大文件:
[root@localhost ~]# 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) [application/zip]
Saving to: `test.zip'
100%[==========>] 23,862,312 6.14M/s in 3.7s
19:44:36 (6.16 MB/s) - `test.zip' saved [23862312/23862312]
下载速度为6.16MB/s。
from blog.s135.com 张宴
1、安装iproute
yum -y install iproute
2、限制eth0网卡的带宽为50kbit:
/sbin/tc qdisc add dev eth0 root tbf rate 50kbit latency 50ms burst 1000
3、限制带宽为50kbit后,在百兆局域网中wget下载一个大文件:
[root@localhost ~]# 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) [application/zip]
Saving to: `test.zip'
37% [=======> ] 8,994,816 457K/s eta 27s
下载速度为457K/s,限制效果达到。
4、解除eth0网卡的带宽限制:
/sbin/tc qdisc del dev eth0 root tbf
5、对比:未作带宽限制情况下,在百兆局域网中wget下载一个大文件:
[root@localhost ~]# 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) [application/zip]
Saving to: `test.zip'
100%[==========>] 23,862,312 6.14M/s in 3.7s
19:44:36 (6.16 MB/s) - `test.zip' saved [23862312/23862312]
下载速度为6.16MB/s。
from blog.s135.com 张宴
相关文章推荐
- 在 Linux 中限制网络带宽使用(限制指定程序和指定网卡的流量)
- Linux下简单限制网卡带宽的设置方法
- 服务器更换主板后,LINUX系统下网卡不可用解决办法
- linux 限制网卡带宽
- Linux下简单限制网卡的带宽
- Linux下简单限制网卡的带宽
- linux系统 cpu升到100%、linux限制网络带宽、模拟丢包
- Linux下简单限制网卡的带宽
- Linux下限制网卡的带宽
- Linux 服务器下多网卡的负载均衡 推荐
- 提升linux下tcp服务器并发连接数限制
- Linux下简单的网络编程笔记(模拟简单的服务器与客户端的通信 1-服务器端)
- linux下ftp服务器 proftpd 推荐 限制用户目录
- 真实记录疑似Linux病毒导致服务器 带宽跑满的解决过程
- 配置Linux环境下多网卡高可用网络端口
- VM虚拟机安装linux,NET联网,Vm tool实现win-linux文件拖拽,mentuhust破除锐捷多网卡限制
- Linux下突破连接限制实现高并发量服务器
- DELL 服务器安装rhlinux5.6安装网卡驱动
- Linux下突破限制实现高并发量服务器
- Linux 下使用Trickle限制下载/上传带宽