Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I am using these commands to set up bandwidth throttling:

tc qdisc del dev eth1 root
tc qdisc add dev eth1 root handle 1: cbq avpkt 1000 bandwidth 100Mbit
tc class add dev eth1 parent 1: classid 1:1 cbq rate 1Mbit allot 1500 prio 3 bounded isolated
tc filter add dev eth1 parent 1: protocol ip u32 match ip protocol 6 0xff flowid 1:1

it

My understanding is that these commands should limit my network traffic to 1 MBit / 125 KByte per second but they don't.

The actual data transfer rate is roughly 5 MByte per second. I measured that by transferring a large file over NFS. If I modify the "rate 1Mbit" parameter to "rate 512 Kbit" the transfer rate is only 2.5 MByte per second, so the tc command does in fact throttle the traffic but not to what the parameter say.

This server is running Debian Linux 6.0.7 as a Citrix XenServer VM.

What are I am doing wrong? Please advise.

share|improve this question
    
How is the traffic passing through your server? –  Petter H May 26 '13 at 17:11
    
It is incoming NFS traffic. –  nn4l May 26 '13 at 17:36
    
then I think my answer may be applicable –  Petter H May 26 '13 at 17:50

1 Answer 1

up vote 2 down vote accepted

Your tc rules only applies to outgoing traffic.

Check this page:

Now bear in mind that we will generally only shape outgoing traffic, because thats what we have control over, unlike traffic coming in.

If you route two interfaces you can put similar rules on each device and route/bridge between. That way what is passed to the incoming chain of one device passes to the outgoing of the other, effectively limiting bandwith in both directions

another alternative is using the IFB pseudo-device which

allows attaching queuing discplines to incoming packets.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.