Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jan 2008 22:27:31 +0100
From:      Max Laier <max@love2party.net>
To:        freebsd-current@freebsd.org
Cc:        Stefan Lambrev <stefan.lambrev@moneybookers.com>
Subject:   Re: FreeBSD 7, bridge, PF and syn flood = very bad performance
Message-ID:  <200801262227.36970.max@love2party.net>
In-Reply-To: <479B9F4F.5010705@moneybookers.com>
References:  <479A2389.2000802@moneybookers.com> <200801262017.52091.max@love2party.net> <479B9F4F.5010705@moneybookers.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart1320325.ad8KbAYg12
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Saturday 26 January 2008, Stefan Lambrev wrote:
> Max Laier wrote:
> > On Friday 25 January 2008, Stefan Lambrev wrote:
> >> Greetings,
> >>
> >> Does anyone try to see PF with "keep state" in action when under syn
> >> flood attack?
> >> I tried to get some help in freebsd-pf@, because the test firewall,
> >> that I build hardly can handle 2-5MB/s syn flood.
> >> Unfortunately I do not saw useful advice.
> >> The problem is that a quad core bridge firewall running freebsd 7
> >> amd64 with PF is near useless and can't handle "small" SYN ddos.
> >>
> >> Here is the schema that I'm testing:
> >> web server (freebsd) - freebsd (bridged interfaces) - gigabit switch
> >> - clients + flooders
> >> In this configuration ~25MB/s syn flood (and I think this limit is
> >> because of my switch) is not a problem and the web server responds
> >> without a problem.
> >> With this configuration netperf -l 610 -p 10303 -H 10.3.3.1 shows
> >> 116MB/s stable speed , so I guess there are no problems with cables,
> >> hardware and etc :)
> >>
> >> But when I start pf (see below the config file) the traffic drops to
> >> 2-3MB/s and the web server is hardly accessible.
> >> It seems that device polling helps a lot in this situation, and at
> >> least the bridge firewall is accessible. Without "polling" the
> >> firewall is so heavily loaded
> >> that even commands like "date" take few seconds to finish, with 2
> >> cores at ~100% idle at same time.
> >>
> >> I have "flat profiles" from hwpmc, and I think it indicates a
> >> problem:
> >>
> >> (bridge, pf enabled, polling enabled, sched_ule - I have profiles
> >> and for other combinations too if needed)
> >>   %   cumulative   self              self     total
> >>  time   seconds   seconds    calls  ms/call  ms/call  name
> >>  24.0  268416.00 268416.00        0  100.00%         =20
> >> _mtx_lock_sleep
> >
> > Can you build a kernel with LOCK_PROFILING and try to figure out
> > which lock is causing this?
>
> Yes I can build kernel with LOCK_PROFILING.
> But I have no idea how to use it :)
> Can you point me to some documentation?

man LOCK_PROFILING

basically:
# sysctl debug.lock.prof.enable=3D1 && sleep 60 && \
  sysctl debug.lock.prof.enable=3D0 && \
  sysctl debug.lock.prof.stats > log

while under attack to sample one minute of lock statistics.

=2D-=20
/"\  Best regards,                      | mlaier@freebsd.org
\ /  Max Laier                          | ICQ #67774661
 X   http://pf4freebsd.love2party.net/  | mlaier@EFnet
/ \  ASCII Ribbon Campaign              | Against HTML Mail and News

--nextPart1320325.ad8KbAYg12
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)

iD8DBQBHm6XIXyyEoT62BG0RAvotAJ4jJFM0qpH91Y2ByEKyKTRmObD72QCfdniT
PfTCHdbKTS0Kb/Bkwd5DXlM=
=X5lq
-----END PGP SIGNATURE-----

--nextPart1320325.ad8KbAYg12--



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