From owner-freebsd-questions@FreeBSD.ORG Thu Apr 24 05:49:54 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C284106564A for ; Thu, 24 Apr 2008 05:49:54 +0000 (UTC) (envelope-from zszalbot@gmail.com) Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.185]) by mx1.freebsd.org (Postfix) with ESMTP id BA47F8FC12 for ; Thu, 24 Apr 2008 05:49:53 +0000 (UTC) (envelope-from zszalbot@gmail.com) Received: by nf-out-0910.google.com with SMTP id b2so1309469nfb.33 for ; Wed, 23 Apr 2008 22:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:received:received:to:subject:x-php-script:mime-version:date:from:cc:in-reply-to:references:message-id:x-sender:received:user-agent:content-type:content-transfer-encoding; bh=8lHM6bQC0Sc8v5fNOi2tQXmnK1HVk3Hyn7IGtfeKP34=; b=NOCfemEWypsrEawd8vMLPsAgJqT52uW3nf7ZKA/H7aKcFS8mgB2wgcBBrzlilpMdNO4lPkyGlii0ryX0JyDmwwkmHi8rZ4pDRMKj+TSNecwXV+bdtwR4HmKl+SS+IqFG4pOzBn+5FyEtzDZH3qKFKXEKTjixJda1cPcixL8Vif4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=to:subject:x-php-script:mime-version:date:from:cc:in-reply-to:references:message-id:x-sender:user-agent:content-type:content-transfer-encoding; b=XL+LQ/wjqqqMXjcl++FNrnvmmKDTp+4psoTjRUXdWuGEVKzU581wexdEljzCVfbUnl2xZG8+5uhJtG97sZkyRxZLp8sSDNQaKG/CNVl4yN+uQyBY0/snOJcl2L6gH4WNDy3p9rvJD1CeOCKNL1FL3ZUXcWJLYWmlm+Yg2imPLAY= Received: by 10.210.75.6 with SMTP id x6mr255632eba.136.1209016192097; Wed, 23 Apr 2008 22:49:52 -0700 (PDT) Received: from lists.lc-words.com ( [83.19.156.210]) by mx.google.com with ESMTPS id f6sm9526067nfh.21.2008.04.23.22.49.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 23 Apr 2008 22:49:51 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by lists.lc-words.com (Postfix) with ESMTP id 3EC242843A; Thu, 24 Apr 2008 07:49:46 +0200 (CEST) Received: from lists.lc-words.com ([127.0.0.1]) by localhost (szalbot.homedns.org [127.0.0.1]) (amavisd-maia, port 10024) with ESMTP id 34279-03; Thu, 24 Apr 2008 07:49:45 +0200 (CEST) Received: by lists.lc-words.com (Postfix, from userid 80) id A529028438; Thu, 24 Apr 2008 07:49:45 +0200 (CEST) To: Luke Dean X-PHP-Script: szalbot.homedns.org/roundcube/index.php for 192.168.11.1 MIME-Version: 1.0 Date: Thu, 24 Apr 2008 07:49:45 +0200 From: Zbigniew Szalbot In-Reply-To: <20080423122105.E72531@border.lukas.is-a-geek.org> References: <0cffa49967a87486dca37f253a3c60b5@localhost> <20080423122105.E72531@border.lukas.is-a-geek.org> Message-ID: <9e91a6220e128d5273f16ef8088d9c5b@localhost> X-Sender: zszalbot@gmail.com Received: from 192.168.11.1 [192.168.11.1] with HTTP/1.1 (POST); Thu, 24 Apr 2008 07:49:45 +0200 User-Agent: RoundCube Webmail Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org Subject: Re: pf traffic shaping and perfomance X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2008 05:49:54 -0000 Hi Luke, On Wed, 23 Apr 2008 12:40:04 -0700 (PDT), Luke Dean wrote: > > > On Wed, 23 Apr 2008, Zbigniew Szalbot wrote: > >> >> Hello, >> >> I would like to implement traffic shaping using pf. I know I need to >> recompile kernel to be able to achieve this but I have a more general >> question. I used to have pf with traffic shaping on a Pentium III 866 >> before and as soon as I activated it, the http response of the box was >> noticably slower. Here are the defs I used then: >> >> #altq on $ext_if cbq bandwidth 512Kb queue { def, smtp, udp, http, \ >> #ssh, icmp } >> #queue def bandwidth 13% cbq(default borrow red) >> #queue smtp bandwidth 25% cbq(borrow red) priority 7 >> #queue udp bandwidth 10% cbq(borrow red) >> #queue http bandwidth 40% cbq(borrow red) >> #queue ssh bandwidth 10% cbq(borrow red) >> ##{ ssh_interactive, ssh_bulk } >> ##queue ssh_interactive priority 7 >> #queue ssh_bulk priority 0 >> #queue icmp bandwidth 2% cbq >> >> It is quite possible that I misconfigured the shaping (as seen above). > What >> would be suggested traffic shaping rules to allow smooth mail operation >> (smtp taking up to 40% of allowed bandwidth) and http responses? >> >> If that matters, uname -v >> FreeBSD 7.0-RELEASE #0 >> >> >> Many thanks in advance! > > I had the same problem with class-based queueing when I tried this. I > suspect that the 512Kb in your initial queue definition is the limiting > factor. I never did get it to work like I expected it to, however, so > maybe I just don't understand it. > > Eventually I realized that I didn't actually want to chop up my bandwidth > like this. What I really wanted to do was simply prioritize the traffic. > The most important applications get first shot at the bandwidth, and the > less important applications get choked when they need to be. I switched > to priority queueing and I've been very happy with it. Thanks! That gives me a clue! Would you mind sharing your defs? I'll be reading the man anyway. Zbigniew Szalbot