You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@mina.apache.org by David Rosenstrauch <da...@darose.net> on 2009/06/18 21:04:14 UTC

NIO performance

Just wondering what thoughts the MINA/NIO brain trust here might have 
about a blog post I came upon a while back.  The author (a pretty well 
known hard-core developer who's worked for Google, as well as his own 
startups) makes the case that NIO is actually significantly slower than 
traditional blocking Java I/O when used in conjunction with NPTL threading.

Apparently, NPTL allows the traditional blocking I/O to scale beyond 
just a few hundred or thousand threads, thereby making it a viable 
option again for large-scale multi-threaded servers.

Curious if anyone's got any thoughts/experiences that either confirm or 
refute what he's saying.

http://mailinator.blogspot.com/2008/02/kill-myth-please-nio-is-not-faster-than.html

Thanks,

DR

Re: NIO performance

Posted by David Rosenstrauch <da...@darose.net>.
David Rosenstrauch wrote:
> Emmanuel Lecharny wrote:
>> David Rosenstrauch wrote:
>>> Tried to search through the gmane archives (as well as my local disk 
>>> archives) on both "Tyma" and "mailinator" but didn't turn up 
>>> anything. Would you happen a pointer?
>> http://www.mail-archive.com/dev@mina.apache.org/msg07525.html
>>
>> Dev list.
> 
> 
> Ah, that explains it.
> 
> Thanks,
> 
> DR

Very interesting reading.  Thanks much for the ref!

DR

Re: NIO performance

Posted by David Rosenstrauch <da...@darose.net>.
Emmanuel Lecharny wrote:
> David Rosenstrauch wrote:
>> Tried to search through the gmane archives (as well as my local disk 
>> archives) on both "Tyma" and "mailinator" but didn't turn up anything. 
>> Would you happen a pointer?
> http://www.mail-archive.com/dev@mina.apache.org/msg07525.html
> 
> Dev list.


Ah, that explains it.

Thanks,

DR

Re: NIO performance

Posted by Emmanuel Lecharny <el...@apache.org>.
David Rosenstrauch wrote:
> David Rosenstrauch wrote:
>> Mark Webb wrote:
>>> This was discussed in length on this mailing list back when the
>>> article was posted.  I vaguely remember the discussion, other than it
>>> happened.
>>>
>>> Checking the archives should give you what you are looking for.
>>>
>>> --Mark
>>
>> Ah, didn't realize.  Will go RTFM.  Sorry for the noise.
>>
>> DR
>
> Tried to search through the gmane archives (as well as my local disk 
> archives) on both "Tyma" and "mailinator" but didn't turn up anything. 
> Would you happen a pointer?
http://www.mail-archive.com/dev@mina.apache.org/msg07525.html

Dev list.

-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: NIO performance

Posted by David Rosenstrauch <da...@darose.net>.
David Rosenstrauch wrote:
> Mark Webb wrote:
>> This was discussed in length on this mailing list back when the
>> article was posted.  I vaguely remember the discussion, other than it
>> happened.
>>
>> Checking the archives should give you what you are looking for.
>>
>> --Mark
> 
> Ah, didn't realize.  Will go RTFM.  Sorry for the noise.
> 
> DR

Tried to search through the gmane archives (as well as my local disk 
archives) on both "Tyma" and "mailinator" but didn't turn up anything. 
Would you happen a pointer?

Thanks,

DR

Re: NIO performance

Posted by David Rosenstrauch <da...@darose.net>.
Emmanuel Lecharny wrote:
> This is a really interesting post. In fact, it was somehow the first 
> time someone did such a extensive comparison, and it's quite a valuable 
> piece of work.
> 
> So why choose NIO over BIO ? There are many reasons. Here are some of 
> them :
> - You need scalability. BIO will scale less easily than NIO (but you 
> will have to go above the 10 thousands connections
> - You need to handle many thousands connections, like 100 000. No way to 
> do that with BIO, as you won't be able to launch more than 32 000 
> threads. NIO does not suffer from such a limt.
> 
> You also have to put that in perspective : when MINA started, the new 
> JVM was 1.4, and creating tens of thousands threads was not an option at 
> all back then.
> 
> Now, I think that we should consider offering the very same API, but 
> extend it to BIO (if possible without a lot of work).
> 
> Of course, this is not something we can target for 2.0, but may be for 
> 3.0 (we have started to think about the future, and it's available here :
> 
> http://cwiki.apache.org/confluence/display/MINA/MINA+3.0+design

Thanks for the info, Emmanuel.

DR

Re: NIO performance

Posted by Emmanuel Lecharny <el...@apache.org>.
David Rosenstrauch wrote:
> Mark Webb wrote:
>> This was discussed in length on this mailing list back when the
>> article was posted.  I vaguely remember the discussion, other than it
>> happened.
>>
>> Checking the archives should give you what you are looking for.
>>
>> --Mark
>
> Ah, didn't realize.  Will go RTFM.  Sorry for the noise.
No problem.

This is a really interesting post. In fact, it was somehow the first 
time someone did such a extensive comparison, and it's quite a valuable 
piece of work.

So why choose NIO over BIO ? There are many reasons. Here are some of them :
- You need scalability. BIO will scale less easily than NIO (but you 
will have to go above the 10 thousands connections
- You need to handle many thousands connections, like 100 000. No way to 
do that with BIO, as you won't be able to launch more than 32 000 
threads. NIO does not suffer from such a limt.

You also have to put that in perspective : when MINA started, the new 
JVM was 1.4, and creating tens of thousands threads was not an option at 
all back then.

Now, I think that we should consider offering the very same API, but 
extend it to BIO (if possible without a lot of work).

Of course, this is not something we can target for 2.0, but may be for 
3.0 (we have started to think about the future, and it's available here :

http://cwiki.apache.org/confluence/display/MINA/MINA+3.0+design


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org



Re: NIO performance

Posted by David Rosenstrauch <da...@darose.net>.
Mark Webb wrote:
> This was discussed in length on this mailing list back when the
> article was posted.  I vaguely remember the discussion, other than it
> happened.
> 
> Checking the archives should give you what you are looking for.
> 
> --Mark

Ah, didn't realize.  Will go RTFM.  Sorry for the noise.

DR

Re: NIO performance

Posted by Mark Webb <el...@gmail.com>.
This was discussed in length on this mailing list back when the
article was posted.  I vaguely remember the discussion, other than it
happened.

Checking the archives should give you what you are looking for.

--Mark


On Thu, Jun 18, 2009 at 3:04 PM, David Rosenstrauch<da...@darose.net> wrote:
> Just wondering what thoughts the MINA/NIO brain trust here might have about
> a blog post I came upon a while back.  The author (a pretty well known
> hard-core developer who's worked for Google, as well as his own startups)
> makes the case that NIO is actually significantly slower than traditional
> blocking Java I/O when used in conjunction with NPTL threading.
>
> Apparently, NPTL allows the traditional blocking I/O to scale beyond just a
> few hundred or thousand threads, thereby making it a viable option again for
> large-scale multi-threaded servers.
>
> Curious if anyone's got any thoughts/experiences that either confirm or
> refute what he's saying.
>
> http://mailinator.blogspot.com/2008/02/kill-myth-please-nio-is-not-faster-than.html
>
> Thanks,
>
> DR
>