-
1. Re: Why bother with APR?
mladen.turk Jul 25, 2007 10:21 AM (in response to dmlloyd)The major usage of APR is to provide a high concurrency for Servlet like
engines changing the connection model from thread/connection to
thread/request beyond many others like OS sendfile support etc.
Comparing NIO to that model gives you few times performance
decrease over the APR.
Last time I compared Glassfish with Tomcat+APR it was 10 times (!) slower.
His other document
http://developers.sun.com/learning/javaoneonline/j1sessn.jsp?sessn=TS-2992&yr=2007&track=5
says on slide 20 that Tomcat is still 10% faster then Grizzly (even without APR)
Nevertheless, benchmarks are like assholes. Everyone has one.
Regards,
Mladen -
2. Re: Why bother with APR?
rmaucher Jul 25, 2007 12:13 PM (in response to dmlloyd)Actually, I think NIO is pointless. First, the API is more complex and not GC friendly, but more importantly, APR is already in production pretty much everywhere inside httpd.
OTOH, NIO is implemented as a bunch of native code inside the JVM, so it results in having more native code, and it's also more difficult to maintain (if you run into an NIO bug, there's no way to fix it except to update the whole JVM). -
3. Re: Why bother with APR?
mladen.turk Jul 25, 2007 12:14 PM (in response to dmlloyd)Also speaking about performance:
http://labs.jboss.com/file-access/default/members/jbossweb/freezone/index.html
There are lots of other nice looking images if you are interested :)
I didn't publish them, just because I don't think the speed itself is that important.
I agree that if some concepts from APR backported to NIO would be very valuable. Especially the fast non-blocking/blocking transition. -
4. Re: Why bother with APR?
dmlloyd Jul 25, 2007 12:42 PM (in response to dmlloyd)"remy.maucherat@jboss.com" wrote:
Actually, I think NIO is pointless.
I didn't ask, "Who here thinks NIO is pointless". I asked if there were any good benchmarks comparing NIO to APR in terms of performance.
I've also heard things like "APR is more flexible", but I haven't seen any information to back that up either. -
5. Re: Why bother with APR?
timfox Jul 25, 2007 1:56 PM (in response to dmlloyd)"david.lloyd@jboss.com" wrote:
"remy.maucherat@jboss.com" wrote:
Actually, I think NIO is pointless.
I didn't ask, "Who here thinks NIO is pointless". I asked if there were any good benchmarks comparing NIO to APR in terms of performance.
I've also heard things like "APR is more flexible", but I haven't seen any information to back that up either.
I believe the RHM team compared NIO (using Apache MINA) to Apache APR and also to asynchronous IO using direct Linux OS calls (i.e. not going through the APR abstraction layer).
I believe the direct hooks gave the best performance, NIO was pretty good, and APR not so good due to the overhead of having to find a common API over all OSs.
Sorry for the vaguities, but this is what I remember them mentioning. Don't know if their findings were correct or not.
BTW we (JBM) definitely need NIO for handling large number of connections. APR is a "nice to have" if it gives radically better performance than NIO, but I'm not particularly bothered about it. -
6. Re: Why bother with APR?
trustin Sep 19, 2007 12:39 AM (in response to dmlloyd)"timfox" wrote:
I believe the RHM team compared NIO (using Apache MINA) to Apache APR and also to asynchronous IO using direct Linux OS calls (i.e. not going through the APR abstraction layer).
I believe the direct hooks gave the best performance, NIO was pretty good, and APR not so good due to the overhead of having to find a common API over all OSs.
Sorry for the vaguities, but this is what I remember them mentioning. Don't know if their findings were correct or not.
BTW we (JBM) definitely need NIO for handling large number of connections. APR is a "nice to have" if it gives radically better performance than NIO, but I'm not particularly bothered about it.
Is there any written report related with their findings?
I am with Tim in that APR is a nice-to-have. Some platform's NIO performance might not be better than APR and vice versa, so it would be nice if users can choose what the best is for their running platform.