Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 4 Jun 2010 11:30:46 -0500
From:      Brandon Gooch <jamesbrandongooch@gmail.com>
To:        Luigi Rizzo <rizzo@iet.unipi.it>
Cc:        freebsd-ipfw <freebsd-ipfw@freebsd.org>, bored to death <bored_to_death85@yahoo.com>
Subject:   Re: traffic bandwidth limit with dummynet
Message-ID:  <AANLkTinYPfJUrX8OHx5oc1xSySVIJqmaPdztoOMkqcFw@mail.gmail.com>
In-Reply-To: <20100604115725.GA37274@onelab2.iet.unipi.it>
References:  <247123.29322.qm@web59713.mail.ac4.yahoo.com> <20100603172733.GA16454@onelab2.iet.unipi.it> <360703.24596.qm@web59711.mail.ac4.yahoo.com> <20100604115725.GA37274@onelab2.iet.unipi.it>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jun 4, 2010 at 6:57 AM, Luigi Rizzo <rizzo@iet.unipi.it> wrote:
> On Fri, Jun 04, 2010 at 01:19:32AM -0700, bored to death wrote:
>> thank you luigi for your reply, it helped.
>>
>> i changed the hz parameter to 1000 and then 4000 and then 8000 in my /bo=
ot/loader.conf. the result got much better.
>> i configured my system as a router and i send 1GB traffic rate passing b=
y it and set an 800MBytes bandwidth limit on input traffic with dummynet.
>> this was the result:
>> with hz=3D1 (default) between 200MBytes/s and 300MBytes/s
>> with hz=3D1000 between 200MBytes/s and 300MBytes/s
>> with hz=3D4000 between 350MBytes/s and 450MBytes/s
>> with hz=3D8000 between 250MBytes/s and 550MBytes/s
>>
>> the maximum traffic rate is got so much better, but 2 problems still rem=
ain:
>> 1- the maximum rate is still not high enough.
>> 2- the rate variation range is high (250-550) and it's not a steady enou=
gh.
>>
>> i've also tried setting different "queue" and "burst" values for the pip=
e. the result is a little better when i set "queue" to a value between 80MB=
ytes and 90MBytes and "burst" to a big number.
>>
>> any other ideas?
>>
>
> HZ=3D1000 is the default, for the records.
> Setting the burst size should have no practical effects,
> whereas setting the queue size e.g.
> o
> =A0 =A0 =A0 =A0ipfw pipe 10 config bw 800Mbit/s queue 200kbytes
>
> should help a lot, but check your configuration with 'ipfw pipe show'
> because if you supply an invalid parameter ipfw silently uses
> a default or something different.
> As an example, you said you used 80-90 Mbytes but the max queue
> size is 100 packets or 1023Kbytes and larger values do not produce
> the desired effect.
>
> As a rule of thumb, to make sure that drops are not caused
> by short queues, you should set the queue size to 1/HZ seconds
> worth of data -- at HZ=3D1000 and 1Gbit/s this means 128Kbytes.
> Note that after the dummynet queue, there might be some other
> queue that saturates. As an example, when using the box as a router,
> packets go in bursts to the output interface, and the burst can
> be as large as 1500 packets per tick on a fully saturated Gig-E
> (the interface's queue ranges normally between 128 and 1024 slots).
> The only fix for this is probably using higher values of HZ.
>
> chers
> luigi

Thanks for the explanation Luigi, this is bound to help others in
regard to queue configuration.

-Brandon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinYPfJUrX8OHx5oc1xSySVIJqmaPdztoOMkqcFw>