From owner-freebsd-java@FreeBSD.ORG Sat Jun 25 01:49:37 2011 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 96DE2106564A for ; Sat, 25 Jun 2011 01:49:37 +0000 (UTC) (envelope-from ronald-freebsd8@klop.yi.org) Received: from smtp-out0.tiscali.nl (smtp-out0.tiscali.nl [195.241.79.175]) by mx1.freebsd.org (Postfix) with ESMTP id 54F648FC0C for ; Sat, 25 Jun 2011 01:49:37 +0000 (UTC) Received: from [212.182.167.131] (helo=sjakie.klop.ws) by smtp-out0.tiscali.nl with esmtp (Exim) (envelope-from ) id 1QaI08-0001zB-7M; Sat, 25 Jun 2011 03:49:36 +0200 Received: from 212-182-167-131.ip.telfort.nl (localhost [127.0.0.1]) by sjakie.klop.ws (Postfix) with ESMTP id 8576C1537; Sat, 25 Jun 2011 03:49:31 +0200 (CEST) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: freebsd-java@freebsd.org, "Luis Neves" References: <201106241650.09920.achill@matrix.gatewaynet.com> Date: Sat, 25 Jun 2011 03:49:30 +0200 MIME-Version: 1.0 From: "Ronald Klop" Message-ID: In-Reply-To: User-Agent: Opera Mail/11.11 (FreeBSD) Content-Transfer-Encoding: quoted-printable Cc: Subject: Re: How to socket accept filters? X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 01:49:37 -0000 On Fri, 24 Jun 2011 22:17:15 +0200, Luis Neves =20 wrote: > On 06/24/2011 03:49 PM, Ronald Klop wrote: > > On Fri, 24 Jun 2011 15:50:09 +0200, Achilleas Mantzios > > wrote: > > > >> =CE=A3=CF=84=CE=B9=CF=82 Friday 24 June 2011 13:00:24 =CE=BF/=CE=B7= Luis Neves =CE=AD=CE=B3=CF=81=CE=B1=CF=88=CE=B5: > >>> Hello, > >>> > >>> Is there any way to enable accept filters for a socket in =20 > Java/FreeBSD? > >>> I'm particularly interested in enabling the http accept filter. > >>> > >> > >> You can do it in OS level maybe. ipfw, pf etc... > >> I used to run ipfw, but now i switched to pf, it seems more powerfu= l. > > > > He means accf_http(9) I presume. That is something else than firewal= l > > filtering. > > That is correct. > > > >>> Any pointers? > >>> Thanks. > > > > I have never seen it in use and google is also silent about it. You > > could create a patch for openjdk or use some native code in java. > > Ok. > > > Out of curiosity: What are you doing that optimizing accept() is wor= th > > the effort? > > > I'm trying to optimize a webserver/adserver that has to deal with =20 > several thousand connections. I don't know if optimizing accept() is =20 > worth the effort, it seems that several webservers (Nginx, Varnish, =20 > Apache, Mongrel, Lighttpd) enable this when running on FreeBSD and I'm = =20 > hoping they do this for a good reason... but you make a good point, I =20 > should measure the effect that enabling accf_http has before going that= =20 > route. Did you already try a profiler like jprofiler or yourkit? Ronald.