On Thursday, 28 May 2015 at 02:00:57 UTC, zhmt wrote:
I think it is not problem of gc, it is my fault:
The operations is serialized:
clent send -> server recv -> server send -> client recv,
so if one operation takes too long time, the throughput will
definitely fall down.
I cant explain why it so fast when buffer is big enough, and so
low when buffer is smaller than data size.
I found the root of the problem :
tcp_nodelay, it is default false. After i modify it to true, the
program runs exactly as what I expect.
sorry, it is a low level error.
the throughput is steady now: if buffer size is set to 1,
throughput is about 20K response/second; when buffer size is big
enough ,the throughput is about 60K response/second.
It looks like resonable.