Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Jul 2007 17:08:17 +0200
From:      Max Laier <max@love2party.net>
To:        freebsd-pf@freebsd.org
Subject:   Re: Losing connections/performance with PF turned on
Message-ID:  <200707051708.24137.max@love2party.net>
In-Reply-To: <810a540e0707050222s55a62641je0138e931832e86@mail.gmail.com>
References:  <810a540e0707050222s55a62641je0138e931832e86@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200707051708.24137.max>