From owner-freebsd-java@FreeBSD.ORG Fri Jun 24 20:40:09 2011 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F25D106568A for ; Fri, 24 Jun 2011 20:40:09 +0000 (UTC) (envelope-from freebsd-java@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 323438FC14 for ; Fri, 24 Jun 2011 20:40:08 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QaCw6-0003B1-Tp for freebsd-java@freebsd.org; Fri, 24 Jun 2011 22:25:06 +0200 Received: from bl13-90-62.dsl.telepac.pt ([85.246.90.62]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Jun 2011 22:25:06 +0200 Received: from luis.neves by bl13-90-62.dsl.telepac.pt with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 24 Jun 2011 22:25:06 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-java@freebsd.org From: Luis Neves Date: Fri, 24 Jun 2011 21:17:15 +0100 Lines: 45 Message-ID: References: <201106241650.09920.achill@matrix.gatewaynet.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: bl13-90-62.dsl.telepac.pt User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Thunderbird/3.1.10 In-Reply-To: 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: Fri, 24 Jun 2011 20:40:09 -0000 On 06/24/2011 03:49 PM, Ronald Klop wrote: > On Fri, 24 Jun 2011 15:50:09 +0200, Achilleas Mantzios > wrote: > >> Στις Friday 24 June 2011 13:00:24 ο/η Luis Neves έγραψε: >>> Hello, >>> >>> Is there any way to enable accept filters for a socket in 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 powerful. > > He means accf_http(9) I presume. That is something else than firewall > 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 worth > the effort? I'm trying to optimize a webserver/adserver that has to deal with several thousand connections. I don't know if optimizing accept() is worth the effort, it seems that several webservers (Nginx, Varnish, Apache, Mongrel, Lighttpd) enable this when running on FreeBSD and I'm hoping they do this for a good reason... but you make a good point, I should measure the effect that enabling accf_http has before going that route. Thanks! -- Luis Neves