On 17/02/2011 16:09, Filip Hanik - Dev Lists wrote:
> On 02/17/2011 08:11 AM, Mark Thomas wrote:
>> On 17/02/2011 14:56, Afkham Azeez wrote:
>>   
>>> Hi folks,
>>> What is the advantage of using this connector as opposed to the
>>> default one?
>>> In which scenarios would we tend to use the default connector, and in
>>> which
>>> scenarios will it be more appropriate to use the NIO connector?
>>>      
>> NIO and APR use one thread per currently processing request.
>> BIO uses one thread per connection. Since usually connections>>
>> currently processing request, NIO and APR scale better.
>>
>> BIO has slightly better raw performance than NIO (excluding sendfile).
>>    
> It used to be only when nr-of-clients<nr-of-threads-in-pool.
> However, in tomcat trunk, BIO can handle keep alive on a large set of
> connections as well.

To a point. The Tomcat 7 BIO connector does scale better than the Tomcat
6 BIO but the NIO connector still has better scalability.

In Tomcat 7 the BIO connector sockets are put in a queue and processed
in turn. Processing includes waiting for data to turn up. Once a request
has been processed, a socket using keep-alive goes to the back of the
queue. It is possible for a socket with data to process to be in the
queue whilst all the threads are sat waiting for data to turn up for
sockets in the keep-alive state.

(Tomcat 6 had no queue - once a thread started processing a socket it
was dedicated to that socket until the socket was closed)

In the NIO connector the poller only passes a socket to a processing
thread when there is data to process.

Mark

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to