directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Irving, Dave" <dave.irv...@logicacmg.com>
Subject RE: [mina] SocketIoProcessor.Worker creation under heavy load
Date Thu, 27 Oct 2005 09:47:56 GMT

> Interesting. Why not using a Thread Pool for this? 
> It may easily solve this issue as threads will stay for some time and
being reused.

If you did so, I think it would be a pool of 1: There's only ever one
worker in use at a time (AFAIK). 
A "was there anything to do on my last select?" check would still
provide fairly timely worker-shut-down (if that's what the existing code
is aiming for), whilst not causing premature worker closure

> Jose Alberto 

Dave

-----Original Message-----
From: Jose Alberto Fernandez [mailto:jalberto@cellectivity.com] 
Sent: 27 October 2005 10:43
To: Apache Directory Developers List
Subject: RE: [mina] SocketIoProcessor.Worker creation under heavy load

Interesting. Why not using a Thread Pool for this? It may easily solve
this issue as threads will stay for some time and being reused.

Jose Alberto

> -----Original Message-----
> From: Irving, Dave [mailto:dave.irving@logicacmg.com]
> Sent: 27 October 2005 08:45
> To: Apache Directory Developers List
> Subject: [mina] SocketIoProcessor.Worker creation under heavy load
> 
> Hi,
> 
> I've been doing some profiling on an application which sits on Mina - 
> and I came across something interesting.
> My test application is creating "single-shot" connections using
multiple
> client threads at a high rate:
> 
> 	- open connection to MINA server
> 	- send some data
> 	- receive reply data
> 	- close connection
> 
> The Mina server seems very stable, but Im noticing that theres a
fairly
> high creation / destruction rate of SocketIoProcessor.Worker threads.
> After processing sessions from a select, the worker thread checks for 
> more work, and exits if there is none to do:
> 
> if( selector.keys().isEmpty() && newSessions.isEmpty() ) {
>   worker = null;
>   break;
> }
> 
> In my case it seems that quite frequently a new session for a new 
> connection is registered just after this check - and consequently a
new
> worker thread is immediately created.
> 
> Do you think there would be any advantage in leaving the worker about 
> for a bit longer? E.g: Maybe if there's still nothing to do after a 
> further (max 1 second) select -- then -- kill the worker? Or is this 
> likely to not be of any gain?
> 
> Many thanks,
> 
> Dave
> 
> 
> This e-mail and any attachment is for authorised use by the intended
> recipient(s) only. It may contain proprietary material, confidential 
> information and/or be subject to legal privilege. It should not be
copied,
> disclosed to, retained or used by, any other party. If you are not an 
> intended recipient then please promptly delete this e-mail and any 
> attachment and all copies and inform the sender. Thank you.

Mime
View raw message