directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Therning <>
Subject Re: [MINA] IoSession and method write (performance)
Date Mon, 02 Jan 2006 18:48:11 GMT
Alessandro Torrisi wrote:
> ...
> Now the question is, according to you it's better to write on the IoSession 
> one single time with a big message or fragment the big message in more
> writes ?

If you have to write 1000 lines you should in most cases not call
session.write() 1000 times. For every call to session.write() a
messageSent() event will be triggered which will consume threads from
your thread pool and CPU. So it's probably a good thing to keep the
number of calls to session.write() down by writing the lines in larger

Just don't make the chunks too large (typically several MB) or you could
risk running out of memory (depending on the characteristics of your


View raw message