From owner-freebsd-ipfw@FreeBSD.ORG Fri Jun 4 12:25:55 2010 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5A03106566B for ; Fri, 4 Jun 2010 12:25:55 +0000 (UTC) (envelope-from bored_to_death85@yahoo.com) Received: from n13.bullet.mail.ac4.yahoo.com (n13.bullet.mail.ac4.yahoo.com [74.6.228.93]) by mx1.freebsd.org (Postfix) with SMTP id 70A648FC17 for ; Fri, 4 Jun 2010 12:25:55 +0000 (UTC) Received: from [76.13.12.65] by n13.bullet.mail.ac4.yahoo.com with NNFMP; 04 Jun 2010 12:25:54 -0000 Received: from [74.6.228.82] by t6.bullet.mail.ac4.yahoo.com with NNFMP; 04 Jun 2010 12:25:54 -0000 Received: from [127.0.0.1] by omp1003.mail.ac4.yahoo.com with NNFMP; 04 Jun 2010 12:25:54 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 486550.43436.bm@omp1003.mail.ac4.yahoo.com Received: (qmail 34789 invoked by uid 60001); 4 Jun 2010 12:25:54 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1275654354; bh=15o8ifAMgikeAC/UlmJ7kNMVrt0WAOSwUix6Sl5eFrM=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=FrTHxlHevGfMI+XIa3D5iPz4MsWJzBOQsg7Hd3pP38flpkjOs7h1dBKpmrFIi2PbH4IrQifKek1kX3fa2trLVM7qAEODd4iFONc4iMBDp7WHnGMxPt4SsU+us0vRlnNdPnh9L+3mrwtFACEc0vpK8XStAU0N/yqdpu9WhVQS9Sg= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=QQ3pwN5GVHarL1L3s4EwJ++eLY7l+ADTExrzWWUIB4yOc+DbxIe0JLGamqi9oMIr8Xl4Fp9G0/iuX7Tg6SIMyHxFm/vG1ZfyZKKOrDtaU1aV9fpG8Q3Nvgh6L03FZb7H/dfUFM4/QX6/Ro+7gE0b52FBbR5lg77j/tipK4I/uds=; Message-ID: <322466.33198.qm@web59714.mail.ac4.yahoo.com> X-YMail-OSG: 3Op8RpoVM1mpIe9Y_YbG8eWSBi_v_uv9bDmGUntvbb5gykB TOp62GZIk4CWzc1WrPrrgoMzDVztrlmKM4m3F3P1P0HrOero7j7p2XbQTpNn 83rPEW1xMlP8wzSh3lPWJ.kMYSQBsT0eLp7IShGUVoN4WfczJtwbbhrxFdDO KToe_Qn9dLG6E5iPnvUWM5.IRUqmP_oELJBxaZIL9UrOnGBqn7d.zwf90Hsw rpt8iJYc5ml42LoOd5RpWkt.K1cuwBbecUp8sl8m_rq9i1KBlgpvbPWPSDhL .HvLTaG8fRIjbM4PW Received: from [89.165.120.190] by web59714.mail.ac4.yahoo.com via HTTP; Fri, 04 Jun 2010 05:25:54 PDT X-Mailer: YahooMailRC/397.8 YahooMailWebService/0.8.103.269680 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> Date: Fri, 4 Jun 2010 05:25:54 -0700 (PDT) From: bored to death To: Luigi Rizzo In-Reply-To: <20100604115725.GA37274@onelab2.iet.unipi.it> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-ipfw Subject: Re: traffic bandwidth limit with dummynet X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jun 2010 12:25:55 -0000 thank you luigi, your explanation really cleared everything out for me. i changed my pipe 1 config to: ipfw pipe 1 config bw 800Mbits/s queue 200K and set HZ to 4000 and this solved my problem completely. i checked limitations with various values between 400Mbits/s to more than 1000Mbits/s and it works like a charm. (the problem was when i set queue to 80MBytes, queue value was actually set to "80 slots") thanks again luigi. ________________________________ From: Luigi Rizzo To: bored to death Cc: freebsd-ipfw Sent: Fri, June 4, 2010 4:27:25 PM Subject: Re: traffic bandwidth limit with dummynet 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 /boot/loader.conf. the result got much better. > i configured my system as a router and i send 1GB traffic rate passing by it and set an 800MBytes bandwidth limit on input traffic with dummynet. > this was the result: > with hz=1 (default) between 200MBytes/s and 300MBytes/s > with hz=1000 between 200MBytes/s and 300MBytes/s > with hz=4000 between 350MBytes/s and 450MBytes/s > with hz=8000 between 250MBytes/s and 550MBytes/s > > the maximum traffic rate is got so much better, but 2 problems still remain: > 1- the maximum rate is still not high enough. > 2- the rate variation range is high (250-550) and it's not a steady enough. > > i've also tried setting different "queue" and "burst" values for the pipe. the result is a little better when i set "queue" to a value between 80MBytes and 90MBytes and "burst" to a big number. > > any other ideas? > HZ=1000 is the default, for the records. Setting the burst size should have no practical effects, whereas setting the queue size e.g. o ipfw 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=1000 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