mirror of https://github.com/grpc/grpc-java.git
Disable Nagle's algorithm, this was exposed by our internal micro benchmark, the streamingInputCall() method happened to have the write-write-read pattern which added 40ms extra delay.
According to our micro benchmark, this change improves the performance, see https://screenshot.googleplex.com/cfxjPGxkgF.png for the previous results, there were 4 out of 6 scenarios had higher latency than netty transport. https://screenshot.googleplex.com/Rq92tYMvBE.png shows the results after this change, the latencies in all scenarios are less than netty transport. This commit fixes #60.
This commit is contained in:
parent
a375eccbea
commit
eb2d65bb0c
|
|
@ -208,6 +208,7 @@ public class OkHttpClientTransport implements ClientTransport {
|
|||
// We assume the sslSocketFactory will verify the server hostname.
|
||||
socket = sslSocketFactory.createSocket(socket, authorityHost, address.getPort(), true);
|
||||
}
|
||||
socket.setTcpNoDelay(true);
|
||||
source = Okio.buffer(Okio.source(socket));
|
||||
sink = Okio.buffer(Okio.sink(socket));
|
||||
} catch (IOException e) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue