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:[EMAIL PROTECTED] > 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.
