From owner-freebsd-pf@FreeBSD.ORG Thu Jul 5 15:06:28 2007 Return-Path: X-Original-To: freebsd-pf@freebsd.org Delivered-To: freebsd-pf@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D60BE16A400 for ; Thu, 5 Jul 2007 15:06:28 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.171]) by mx1.freebsd.org (Postfix) with ESMTP id 6C01713C43E for ; Thu, 5 Jul 2007 15:06:28 +0000 (UTC) (envelope-from max@love2party.net) Received: from [88.66.38.139] (helo=amd64.laiers.local) by mrelayeu.kundenserver.de (node=mrelayeu2) with ESMTP (Nemesis), id 0MKwtQ-1I6SuJ3HeA-0003OP; Thu, 05 Jul 2007 17:06:25 +0200 From: Max Laier Organization: FreeBSD To: freebsd-pf@freebsd.org Date: Thu, 5 Jul 2007 17:08:17 +0200 User-Agent: KMail/1.9.7 References: <810a540e0707050222s55a62641je0138e931832e86@mail.gmail.com> In-Reply-To: <810a540e0707050222s55a62641je0138e931832e86@mail.gmail.com> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1387552.7bBZdNJTva"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200707051708.24137.max@love2party.net> X-Provags-ID: V01U2FsdGVkX191pwevU/AJiXSjCpMgWOaltDgKkGv4FA8OOwJ flugpZA16Tp6tv7OPGNMe7jxJFL6xtoF6aXMugeF5UvvFa+hwJ v4xf7LX1rwQSC74xrjqgydbR4XKVz2u3szhK8aMDgU= Cc: Subject: Re: Losing connections/performance with PF turned on X-BeenThere: freebsd-pf@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Technical discussion and general questions about packet filter \(pf\)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Jul 2007 15:06:28 -0000 --nextPart1387552.7bBZdNJTva Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 05 July 2007, Pat Maddox wrote: > We're doing some stress testing on our server, and noticed that when > we turn PF on, we lose connections and have a drastic reduction in > performance. My guess would be that you are exhausting the ephemeral port range of the=20 querying box. pf has quite strict (maybe too strict) enforcement of the=20 TIME_WAIT silence periode. There are several ways to work around this=20 (which only is a problem while benchmarking): - use shorter state timeouts. "tcp.closed" in particular - increase the ephemeral port range on the query node net.inet.ip.portrange.[hi]{last,first} see ip(4) for details. - Use a more realistic benchmark (i.e. coming from more than one IP) In order to verify that this is indeed the problem look for state-mismatch= =20 counter increases in the "pfctl -si" output or debug messages on the=20 console while running with "pfctl -xm". > We used SIEGE for 120 seconds, 50 connections, on req/conn > > Firewall On: > > Num Users: 50 > Availability: 97.23 % > Transaction rate: 58.02 trans/sec > Concurrency: 3.80 > Successful: 6994 > Failed: 198 > Longest Req: 9.06s > > Firewall Off: > > Num Users: 50 > Availability: 100 % > Transaction rate: 94.62 trans/sec > Concurrency: 1.76 > Successful: 11342 > Failed: 0 > Longest Req: 0.51s =2E.. =2D-=20 =46reeBSD Status reports due: 07/07/07 :-) /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart1387552.7bBZdNJTva Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBGjQloXyyEoT62BG0RAt0qAJ460qwrJPvDODa2/HoWV0GndI7aXQCbB6j+ B7m0YVs2mHORAvZbGwEgNFM= =G096 -----END PGP SIGNATURE----- --nextPart1387552.7bBZdNJTva--