From owner-freebsd-net Wed Nov 1 9:18:35 2000 Delivered-To: freebsd-net@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id 5DDD137B4C5 for ; Wed, 1 Nov 2000 09:18:32 -0800 (PST) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.0/8.11.0) with ESMTP id eA1HISn31605 for ; Wed, 1 Nov 2000 10:18:29 -0700 (MST) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id KAA16816 for ; Wed, 1 Nov 2000 10:18:28 -0700 (MST) Message-Id: <200011011718.KAA16816@harmony.village.org> To: net@freebsd.org Subject: Traffic throttling Date: Wed, 01 Nov 2000 10:18:28 -0700 From: Warner Losh Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Greetings net list. I hope this is the right place to ask. Our upstream ISP charges us based on how much bandwidth we use at the 95th percentile. We want to limit the bandwidth that we use so that we consistantly come in at a certain level. One trivial way to do this would be: ipfw pipe 1 config bw 32Kbit/s which would guarantee, more or less, that we never exceed 32kpbs. However, the 95th percentile measurement that our isp does is the 95th percentile of the 5 minute averages of usage. there's no reason we couldn't use 200kbps of our pipe for 1 minute to download a port distribution and let the other 4 minutes go relatively idle. For that matter, 5% of the 5 minute time slices is 432 of them. These samples are eliminated from consideration, so it doesn't matter what they are. Last night I used 20 of them to update all my source trees from since before BSDcon via cvsup and rsync (depending on the project). :-) After looking at the logs for a few weeks, I think that even a simple ipfw pipe 1 config bw 64Kbit/s would cover our butts, but again we're left with the desire to push the envelope further than this. Now to my question, what's the best way to throttle things based on the above rules so that each month we are guarnateed (or nearly so) to have our 95th percentile of usage be below a certain level. I know the answer will likely involve thinks like "divert" and "write a deamon to" but if anybody had any suggestions for how to proceed, I'd love that. Maybe someone has already written such a tool, but I fear I'll need to write it. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message