TCP Sockets - Limiting one write at a time is harming performance (at least on windows)

Alan Bateman Alan.Bateman at Sun.COM
Tue Jun 2 10:19:25 PDT 2009


Leon Finker wrote:
> Hi,
>
> I did some more testing on what seems to be the best combination on multiple
> simultaneous outstanding writes/reads. I find that at least on windows the
> best option for writes is to set SO_SNDBUF size to 0 and schedule writes as
> many as possible and not wait for single write to complete before scheduling
> next one. It doesn't mean that application should schedule writes non-stop.
> There can be a policy that application code can enforce. The data throughput
> increase is 2x-3x in my tests.
>   
If you queue writes to a stream connection then a short-write will 
corrupt your stream.

-Alan.



More information about the nio-dev mailing list