All of lore.kernel.org
 help / color / mirror / Atom feed
From: fanfei <fan.fei@datatom.com>
To: lartc@vger.kernel.org
Subject: Re: Can't get the ingress policer to work
Date: Thu, 09 May 2013 10:28:50 +0000	[thread overview]
Message-ID: <518B7A62.2050204@datatom.com> (raw)
In-Reply-To: <518B64EE.8060503@open-t.co.uk>

于 2013/5/9 18:09, Sebastian Arcus 写道:
> On 09/05/13 09:57, Sebastian Arcus wrote:
>> I'm trying to limit the bandwidth on the ingress leg of my Internet
>> connection. I'm using the code from lartc.org:
>>
>>
>> tc qdisc add dev eth0 handle ffff: ingress
>>
>> tc filter add dev eth0 parent ffff: protocol ip prio 50 \
>> u32 match ip src 0.0.0.0/0 police rate 500kbit \
>> burst 10k drop flowid :1
>>
>>
>> I've tried rates of 1Mbit, 10Mbit, 100Mbit. I've tried bursts of 1k,
>> 10k, 100k, 1000k. Nothing seems to make any difference. The test
>> download starts at about 20Mbytes/second - then keeps on slowing down
>> and stalling intermittently all the way down to 6kbytes/second. Then it
>> bobs up and down, stalling all the time, between 5kbytes/second and
>> 17kbytes/second. There seems to be absolutely no relation between the
>> rate I set and the resulting download rate.
>>
>> I'm testing on two VM's. With no traffic shaping on, I get about 36
>> megabytes/second clean speed between the two vms. Kernel on both sides
>> is 3.8.4. I'm only applying traffic shaping on one of the vm's.
>>
>> Any suggestions would be much appreciated. I ran out of ideas so far.
>> I've reread the tc-htb man page, searched google on the ingress queue -
>> but can't see what am I missing.
>
> I have just retried the exact same settings, but on a real server with 
> an ADSL connection to the internet (well, actually an ethernet 
> connection which goes through an ADSL router). On this server, the 
> ingress policing is working perfectly fine. Maybe the KVM vm's or the 
> virtio network interface is playing havoc with tc?
>
> The real server has kernel 2.6.38 - while the vm has 3.8.4. Could the 
> kernel version be an issue? Have there been changes in traffic 
> shaping/policing code in newer kernels? Could there be other settings 
> which are interfering with the ingress policing? Maybe the MRU on the 
> interface?
>
> -- 
> To unsubscribe from this list: send the line "unsubscribe lartc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html

try set mtu, like
tc filter add dev eth0 parent ffff: protocol ip prio 50 \
u32 match ip src 0.0.0.0/0 police rate 500kbit \
burst 10k mtu 100kb drop flowid :1

100kb works for me, maybe you should set another value

  parent reply	other threads:[~2013-05-09 10:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-09  8:57 Can't get the ingress policer to work Sebastian Arcus
2013-05-09  9:39 ` Sebastian Arcus
2013-05-09  9:51 ` Ian Macintosh
2013-05-09 10:09 ` Sebastian Arcus
2013-05-09 10:21 ` Andy Furniss
2013-05-09 10:28 ` fanfei [this message]
2013-05-09 10:36 ` Sebastian Arcus
2013-05-09 10:41 ` Sebastian Arcus
2013-05-09 11:00 ` Andy Furniss

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=518B7A62.2050204@datatom.com \
    --to=fan.fei@datatom.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.