All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dennis Jacobfeuerborn <dennisml@conversis.de>
To: lartc@vger.kernel.org
Subject: Re: HTB limiting working for single big download but not for many small ones
Date: Fri, 08 Feb 2013 11:07:40 +0000	[thread overview]
Message-ID: <5114DC7C.5050903@conversis.de> (raw)
In-Reply-To: <5113EAEF.7020606@conversis.de>

On 02/07/2013 06:57 PM, Dennis Jacobfeuerborn wrote:
> Hi,
> I've run into problems trying to limit the overall download bandwidth for a
> webserver. This is the code I'm using:
> 
> tc qdisc add dev eth0 root handle 1: htb default 30
> tc class add dev eth0 parent 1: classid 1:1 htb rate 200mbit ceil 200mbit
> tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip sport 80
> 0xffff flowid 1:1
> 
> The problem is that when I test this with a single connection downloading a
> large file I can see the download speed according to the specified limit
> (in this case 200mbit).
> When I use this code on a production system that receives several thousand
> small downloads from an nginx server however I see the following:
> 
> # tc -s -d class show dev eth0
> class htb 1:1 root prio 0 quantum 200000 rate 200000Kbit ceil 200000Kbit
> burst 101600b/8 mpu 0b overhead 0b cburst 101600b/8 mpu 0b overhead 0b level 0
>  Sent 246544581544 bytes 55302789 pkt (dropped 1614680, overlimits 0
> requeues 0)
>  rate 636728Kbit 16228pps backlog 0b 229p requeues 0
>  lended: 55302560 borrowed: 0 giants: 51516908
>  tokens: -3729 ctokens: -3729
> 
> The rate is over 600mbit so I'm not sure why the traffic isn't limited to
> the 200mbit specified. Is there something else I need to take into account
> here to make this work?

I've now experimented with burst/cburst but either I end up with a rate way
below 200mbit or easily exceeding 600mbit. Apparently the actual 200mbit
limit is just ignored.

Regards,
  Dennis

  reply	other threads:[~2013-02-08 11:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-07 17:57 HTB limiting working for single big download but not for many small ones Dennis Jacobfeuerborn
2013-02-08 11:07 ` Dennis Jacobfeuerborn [this message]
2013-02-08 11:39 ` Dennis Jacobfeuerborn

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=5114DC7C.5050903@conversis.de \
    --to=dennisml@conversis.de \
    --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.