From owner-freebsd-questions@FreeBSD.ORG Tue Mar 14 19:40:00 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6814A16A42A for ; Tue, 14 Mar 2006 19:40:00 +0000 (UTC) (envelope-from wsantee@gmail.com) Received: from pproxy.gmail.com (pproxy.gmail.com [64.233.166.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCF7C43D45 for ; Tue, 14 Mar 2006 19:39:59 +0000 (GMT) (envelope-from wsantee@gmail.com) Received: by pproxy.gmail.com with SMTP id n25so1074218pyg for ; Tue, 14 Mar 2006 11:39:59 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:subject:x-enigmail-version:content-type:content-transfer-encoding; b=Iy9efwM5y4xUa41eeXM5GF9n64xhRaXYluy7MKIJBxsWzHdAInO7aWSkDUo2+DrV3rYPqwPUIg1rbMY/TVn/PiJjWibC3GDS0uWtEQAd9MMqIDDnWw1P6w3HinKszLgPqQAD9NuKkRWKQBFzBwruEjXCBchCeHNnnhkvW88/pFM= Received: by 10.35.113.12 with SMTP id q12mr807682pym; Tue, 14 Mar 2006 10:34:10 -0800 (PST) Received: from ?10.0.1.3? ( [168.103.224.74]) by mx.gmail.com with ESMTP id b43sm322442pyb.2006.03.14.10.34.09; Tue, 14 Mar 2006 10:34:09 -0800 (PST) Message-ID: <44170C9C.1040002@gmail.com> Date: Tue, 14 Mar 2006 10:34:04 -0800 From: Wes Santee User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: freebsd-questions@freebsd.org X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: cbq not borrowing fully from parent queue 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: Tue, 14 Mar 2006 19:40:00 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Greetings. I'm running 6-STABLE using pf and altq/cbq to manage bandwidth on my wireless adapter. The setup from pf.conf is this: altq on $ext_if bandwidth 54Mb cbq queue { internal, external } queue internal bandwidth 53104Kb priority 7 cbq(borrow) queue external bandwidth 896Kb priority 4 cbq { highq, defaultq, lowq } queue highq bandwidth 40% priority 3 cbq(borrow) queue defaultq bandwidth 40% priority 2 cbq(default borrow) queue lowq bandwidth 20% priority 1 qlimit 300 cbq(borrow) The internal queue is for wireless traffic coming from and going to the internal network. The external queue (and its children) are for traffic going upstream to my ISP. The "external" queue is set to my max upstream bandwidth to my ISP, so it can't borrow from the root queue. All the child queue's under "external" can (and should) borrow against the available upstream bandwidth amount if available. The problem is that packets in lowq are filling up the queue, even though there is plenty of bandwidth available to borrow from the parent queue. Here's a snapshot from pfctl -vvsqueue: queue internal bandwidth 53.10Mb priority 7 cbq( borrow ) [ pkts: 401 bytes: 216532 dropped pkts: 0 bytes: 0 ] [ qlength: 0/ 50 borrows: 0 suspends: 0 ] [ measured: 0.0 packets/s, 0 b/s ] queue external bandwidth 896Kb priority 4 {highq, defaultq, lowq} [ pkts: 0 bytes: 0 dropped pkts: 0 bytes: 0 ] [ qlength: 0/ 50 borrows: 0 suspends: 0 ] [ measured: 0.0 packets/s, 0 b/s ] queue highq bandwidth 358.40Kb priority 3 cbq( borrow ) [ pkts: 0 bytes: 0 dropped pkts: 0 bytes: 0 ] [ qlength: 0/ 50 borrows: 0 suspends: 0 ] [ measured: 0.0 packets/s, 0 b/s ] queue defaultq bandwidth 358.40Kb priority 2 cbq( borrow default ) [ pkts: 7397 bytes: 3230740 dropped pkts: 0 bytes: 0 ] [ qlength: 0/ 50 borrows: 10 suspends: 9 ] [ measured: 1.0 packets/s, 4.16Kb/s ] queue lowq bandwidth 179.20Kb qlimit 300 cbq( borrow ) [ pkts: 41643 bytes: 48966175 dropped pkts: 0 bytes: 0 ] [ qlength: 117/300 borrows: 31513 suspends: 6282 ] [ measured: 21.1 packets/s, 193.23Kb/s ] Notice that queue "external", the parent of lowq, has plenty of available bandwidth. However, lowq has still got a backlog of 117 packets, and refuses to go over 193Kbit/sec. It is borrowing, but not enough to keep the queue in check. Is there a reason the cbq implementation in pf will not aggressively borrow against the parent queue if the bandwidth is available? I had to set the qlimit up to 300 because at 200 it was still dropping packets even though there was *plenty* of available bandwidth to borrow from the parent. Cheers, - -Wes -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (MingW32) iQIVAwUBRBcMmIrq8W17hxGfAQi2HA//cnrbFvZIzOnzKYIsV2GE4IlNA4lC8Wyg XaZq1yEvqkuA6BgF0V029bgkuCOrKEe6qrOKpygINWLvsCgdNS2RXbgyxSXOkZQ2 IC9giWLV9aZtapR7yo8sK9aKLwhM/ppOtQc1q1tlR4q0NX4El6fKj6QBVqDx2D1Q qykpAvV23Ew1f7Sl6iqFmOA3d/NUq0knJQCNUD3R3X8cz1N5Cx19hx15Sjb+A1Sg XRTlo0OzFgwJ67vVS79BAmceZO0gni7VxHbKBdGTklFFIYcykKB+Lv3TLmxJY2l8 CRyfG1ozc7VRQAa1RsbocQfAQ0BTHJ2X0gXd8CfZFIB343Go/4bwWVQrLtpniKnk Uen8eIlpC0BeCFlDhPOhUT4MapaJxnLgRtVvyqoBJC6J6c54t7K9wrU5PQ8jBbgL 6fhXh/qi5rjTTIPtszDYWI/bZmvYlyOMXAz5zUkFxcHQGkmonizoB2ADonloc3Aw qQfRjnyc8B+YnYu9F+HyCo0baQylbrmMjb1b0rZbBm2UlXRK7xQKMg0BdWLC3tZH tFSOXVprx9iKSQL7w7OAuLo2Nyts95eJ/hLLdUF9D1RyHuJWVgys9dnaT3BM/Hge A3UsmWjcazWJgEk6uy/hRBfB6o0O4GoNRdf7lu5DWStNdxY1HN8c5jSvPUbYZfyB 8g2LTD8CIlI= =d1NF -----END PGP SIGNATURE-----