Le 1/5/13 1:27 PM, Jeff MAURY a écrit :
> Regarding the message size, I noticed that Mina2 writes only a sub part of
> the message (size is computed from the receive buffer size if I remember
> correctly) whereas Netty tries to write the buffer buffer to the socket. So
> If you did the same in Mina3, it may explain why it is slow

This can perfectly well be the reason for the horible performances we
get when dealing with huge messages : as Jeff suggested, the HeapBuffer
might be copied totally into a DirectBuffer when trying to write the
message, regardless of the SendBufferSize. If so (ouch), we will do that
1000 times for a 64Mb message and a SendBufferSIze of 64Kb...

I will experiment another solution for MINA 3 : allocating a
DirectBuffer once for each thread, with a SendBufferSize size, and use
this buffer to write into the socket. I'm also wondering if it would not
be better to copy the HeapBuffer into a DirectBuffer before trying to
write the message, as we may avoid copying the data from the Heap buffer
into the DirectBuffer many times.

Interesting thread !

-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com 

Reply via email to