The Sun NIO implementation will use writev which will do gathering writes (it's reads that are scattering) if the platform supports it.

I made some modifications to the SocketIoProcessor to take advantage of this but on a 100Mb network could not observe any improvement. We now have a Gb network in our test environment and some more tests so I plan on revisiting this at some point.

One thing to note is that you can only push out data as quickly as your clients can read it. Otherwise you just end up filling up the socket buffer.

RG


"Vinod Panicker" <[EMAIL PROTECTED]>

16/04/2006 04:57
Please respond to mina-dev

       
        To:        [email protected], [EMAIL PROTECTED]
        cc:        
        Subject:        Re: Does mina use scattered writes?



Hi,

On 4/14/06, Luke Hubbard ([EMAIL PROTECTED]) <[EMAIL PROTECTED]> wrote:
> Hi Guys,

<snip/>

> Will making lots of writes have a negative impact on performance?

Theoretically, it should.  Practically, if you switch off TCP_NODELAY,
the NIO frameword should be able to handle it better.  Another problem
you might have in this case is the packet header and the actual
payload coming in independent tcp packets.  I assume that its alright
with you if that happens.

> Or is it better to use a larger buffer even if it cant be shared?

A zero-copy mechanism is most efficient.  Maybe the read-only buffers
would be of help in this case.  I'm not sure about that though -
others would be able to give better suggestions.

> And... does mina use scattered writes under the hood?

AFAIK the NIO library doesn't support this.  Mustang is bringing quite
a few improvements, including support for epoll.  That would be a
blast!

> Hope the above makes sense, and you can point me in the right direction.
> Thanks for your work on an excellent framework.

HTH,
Vinod.



This communication is for informational purposes only. It is not intended
as an offer or solicitation for the purchase or sale of any financial
instrument or as an official confirmation of any transaction. All market prices,
data and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of JPMorgan Chase & Co., its subsidiaries
and affiliates.

Reply via email to