You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Ortwin Glück <od...@odi.ch> on 2007/01/18 19:29:31 UTC

NIO: epoll

Oleg,

Does the stuff below sound interesting? Could it speed up the NIO 
implementation compared to blocking IO on Linux?

Odi

 From the JDK-1.5.0_10 release notes at
http://java.sun.com/j2se/1.5.0/ReleaseNotes.html#150_10

"Support for epoll

The Linux downloads of this update release include an implementation of 
java.nio.channels.spi.SelectorProvider that is based on the epoll I/O 
event notification facility. The epoll facility is available in the 
Linux 2.6 kernel, and is more scalable than the traditional poll system 
call. This epoll-based implementation may improve the performance of 
server applications that use the New I/O API and that register hundreds 
of channels with a selector. For more information, refer to the epoll(4) 
and poll(2) man pages.

The epoll-based implementation of SelectorProvider is not selected by 
default. To select it, specify a property value from the command line as 
follows:

java 
-Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.EPollSelectorProvider
"

---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Re: NIO: epoll

Posted by Robert Olofsson <ro...@khelekore.org>.
Ortwin Glück wrote:
> Does the stuff below sound interesting? Could it speed up the NIO 
> implementation compared to blocking IO on Linux?  ...
>  From the JDK-1.5.0_10 release notes at
> http://java.sun.com/j2se/1.5.0/ReleaseNotes.html#150_10
> "Support for epoll  ...

Yes, epoll is nice. I do not have any benchmarks for it though.
SUN 1.6.0 jvm uses epoll as the default selector.
I did a few trivial benchmarks for 1.5 vs 1.6, but that is soo much
more than epoll.

I did also find a bug in the epoll selector. There are patches
that fixes it and it will probably be good in 1.6.0_01 and hopefully
also 1.5.0_11.

http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6481709

I am not sure if this bug will bite you or not, but a http
server or a http clients both sounds like something that will do socket
_and_ file io at the same time, so be careful about epoll until the
next bugfix release.

/robo

---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Re: NIO: epoll

Posted by Ortwin Glück <od...@odi.ch>.

Oleg Kalnichevski wrote:
> Odi,
> 
> I believe it when I see it. Probably it will, but every time NIO stuff
> gets more efficient, Java also gets more efficient at managing threads,
> so at the end of the day blocking I/O still yields better raw
> throughput.

Yeah, I also see the problem with it being so new - and probably buggy 
(see Roberts email).

> I'll start running benchmarks HttpCore vs HttpCore NIO vs AsyncWeb on a
> regular basis once again after we manage to get HttpClient 4.0 ALPHA1
> out the door.

Early enough :-)

> Cheers
> 
> Oleg  


-- 
[web]  http://www.odi.ch/
[blog] http://www.odi.ch/weblog/
[pgp]  key 0x81CF3416
        finger print F2B1 B21F F056 D53E 5D79 A5AF 02BE 70F5 81CF 3416

---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Re: NIO: epoll

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Thu, 2007-01-18 at 19:29 +0100, Ortwin Glück wrote:
> Oleg,
> 
> Does the stuff below sound interesting? Could it speed up the NIO 
> implementation compared to blocking IO on Linux?
> 

Odi,

I believe it when I see it. Probably it will, but every time NIO stuff
gets more efficient, Java also gets more efficient at managing threads,
so at the end of the day blocking I/O still yields better raw
throughput.

I'll start running benchmarks HttpCore vs HttpCore NIO vs AsyncWeb on a
regular basis once again after we manage to get HttpClient 4.0 ALPHA1
out the door.

Cheers

Oleg  


> Odi
> 
>  From the JDK-1.5.0_10 release notes at
> http://java.sun.com/j2se/1.5.0/ReleaseNotes.html#150_10
> 
> "Support for epoll
> 
> The Linux downloads of this update release include an implementation of 
> java.nio.channels.spi.SelectorProvider that is based on the epoll I/O 
> event notification facility. The epoll facility is available in the 
> Linux 2.6 kernel, and is more scalable than the traditional poll system 
> call. This epoll-based implementation may improve the performance of 
> server applications that use the New I/O API and that register hundreds 
> of channels with a selector. For more information, refer to the epoll(4) 
> and poll(2) man pages.
> 
> The epoll-based implementation of SelectorProvider is not selected by 
> default. To select it, specify a property value from the command line as 
> follows:
> 
> java 
> -Djava.nio.channels.spi.SelectorProvider=sun.nio.ch.EPollSelectorProvider
> "
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org