xen上做qos限制
来源:互联网 发布:淘宝店铺改行业 编辑:程序博客网 时间:2024/04/28 07:06
Limiting Bandwidth Usage on Xen Linux Setup
Xen seems to be gaining speed these days and has a lot of useful features for those who want to resale or otherwise split a single box. Now that you have your Xen system set up you may be interested in going farther with bandwidth limiting.
The hardest part of setting up bandwidth limiting is understanding the traffic control system under Linux. This mainly revolves around the tc command.
The first thing you will want to do is select a queue discipline. Although you can select from a number of disciplines I pickedHTB for the following instructions because it seems to be the simplest to set up. All of the following is done on Xen0.
- The first thing you will need to do is find the name of your real ethernet device. This seems to change depending on what version of Xen you are running. For my setup it was peth0 and I was able to find it by looking at dmesg right after the system booted.
- After finding the name of your ethernet device you will need to set up a default queuing discipline that will catch anything that doesn't hit a child rule. Here we set the handle to 1 and a class sub id of 99.tc qdisc add dev peth0 root handle 1: htb default 99
- Next we define a default rate that will be used as a total for all child rates as well as anything that doesn't fall into a child bucket. In this case I'm setting the total rate to 20mbps with a burst of 15k.tc class add dev peth0 parent 1: classid 1:1 htb rate 20mbps burst 15k
Setting a burst lets small amounts of traffic go faster than the normal rate. The burst is also shared with the children so make sure to set it higher than any one child. Also note that parent 1: references the parents classid that we created above.
- Now that we have our default class and rate set up we set up child classes and rates for each node. Here I set up classes for 2 XenU nodes and the Xen0 node.tc class add dev peth0 parent 1:1 classid 1:13 htb rate 5mbps burst 15k
tc class add dev peth0 parent 1:1 classid 1:14 htb rate 10mbps burst 15k
tc class add dev peth0 parent 1:1 classid 1:99 htb rate 5mbps burst 15kNote that the parent classid is referenced here as 1:1 that we created above. We also assign each bucket its own unique classid.
- Now we need to determine who gets serviced in what order. In this example I use sfq for each class so that each class should get equal time as traffic is coming in.tc qdisc add dev peth0 parent 1:13 handle 13: sfq perturb 10
tc qdisc add dev peth0 parent 1:14 handle 14: sfq perturb 10
tc qdisc add dev peth0 parent 1:99 handle 22: sfq perturb 10 - Now the final step is to attach the defined classes to the routing system. This is done by using iptables and the given classid from the class setup step.iptables -t mangle -A POSTROUTING -p tcp -s 192.168.1.103 -j CLASSIFY –set-class 1:13
iptables -t mangle -A POSTROUTING -p tcp -s 192.168.1.104 -j CLASSIFY –set-class 1:14
iptables -t mangle -A POSTROUTING -p tcp -s 192.168.1.111 -j CLASSIFY –set-class 1:21
- xen上做qos限制
- 限制 XEN Domain0内存
- ixp425上QoS开发
- xenhost上的qos
- kernel dev 上qos
- 文件系统开发手记-第2篇 我为什么要在Lustre上做QoS
- Xen是做什么的?
- 限制 Xen Dom0 的内存
- Xen 32G内存限制
- Openwrt配置QOS流量带宽限制
- Xen上的miniOS
- Ubuntu上安装Xen
- xen上安装虚拟机:
- 摆脱数据库限制,做真正意义上的三层报表
- QoS
- QoS
- QoS
- qos
- linux 文件压缩与解压缩命令
- HIT软件学院第五次OS实验
- Android 近百个项目的源代码,覆盖Android开发的每个领域
- /proc/sys/vm/优化
- 如何在HTML文档中显示空格
- xen上做qos限制
- android工作随笔(第一季)
- java中的四舍五入(用java实现浮点数的精确计算)
- MeeGo 1.2 手机版UI截图
- http返回网页状态码查询
- 浅谈css框架开发
- Tcp/IP 端口耗尽
- java枚举类型
- 每次查询数据库按不同顺序显示数据