From owner-freebsd-current@FreeBSD.ORG Sat Jan 26 21:00:04 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7420816A421 for ; Sat, 26 Jan 2008 21:00:04 +0000 (UTC) (envelope-from stefan.lambrev@moneybookers.com) Received: from blah.sun-fish.com (blah.sun-fish.com [217.18.249.150]) by mx1.freebsd.org (Postfix) with ESMTP id 31E6A13C46E for ; Sat, 26 Jan 2008 21:00:04 +0000 (UTC) (envelope-from stefan.lambrev@moneybookers.com) Received: by blah.sun-fish.com (Postfix, from userid 1002) id 376951B10EF1; Sat, 26 Jan 2008 22:00:03 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on blah.cmotd.com X-Spam-Level: X-Spam-Status: No, score=-10.6 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.3 Received: from [10.1.1.2] (unknown [192.168.25.10]) by blah.sun-fish.com (Postfix) with ESMTP id CD1AA1B10EEE; Sat, 26 Jan 2008 21:59:59 +0100 (CET) Message-ID: <479B9F4F.5010705@moneybookers.com> Date: Sat, 26 Jan 2008 22:59:59 +0200 From: Stefan Lambrev User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 To: Max Laier References: <479A2389.2000802@moneybookers.com> <200801262017.52091.max@love2party.net> In-Reply-To: <200801262017.52091.max@love2party.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/5562/Sat Jan 26 12:34:23 2008 on blah.cmotd.com X-Virus-Status: Clean Cc: freebsd-current@freebsd.org Subject: Re: FreeBSD 7, bridge, PF and syn flood = very bad performance X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2008 21:00:04 -0000 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% _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?