How to socket accept filters?

Luis Neves luis.neves at gmail.com
Fri Jun 24 20:40:09 UTC 2011


On 06/24/2011 03:49 PM, Ronald Klop wrote:
 > On Fri, 24 Jun 2011 15:50:09 +0200, Achilleas Mantzios
 > <achill at matrix.gatewaynet.com> 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



More information about the freebsd-java mailing list