From 12e5775bd00b4b55f9a93d73de0f8b53f57eda54 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 27 Oct 2016 14:30:41 -0700 Subject: [PATCH 1/2] Disable Nagle's algorithm in libuv endpoints --- src/core/lib/iomgr/tcp_uv.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/lib/iomgr/tcp_uv.c b/src/core/lib/iomgr/tcp_uv.c index 05d6eeb2408..0dd4beaae18 100644 --- a/src/core/lib/iomgr/tcp_uv.c +++ b/src/core/lib/iomgr/tcp_uv.c @@ -315,6 +315,8 @@ grpc_endpoint *grpc_tcp_create(uv_tcp_t *handle, char *peer_string) { gpr_log(GPR_DEBUG, "Creating TCP endpoint %p", tcp); } + uv_tcp_nodelay(handle, 1); + memset(tcp, 0, sizeof(grpc_tcp)); tcp->base.vtable = &vtable; tcp->handle = handle; From 04d2829fe60adbcead1efe1ff8b5da70898329d0 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 27 Oct 2016 14:36:57 -0700 Subject: [PATCH 2/2] Add comment --- src/core/lib/iomgr/tcp_uv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/lib/iomgr/tcp_uv.c b/src/core/lib/iomgr/tcp_uv.c index 0dd4beaae18..3860fe3e9b5 100644 --- a/src/core/lib/iomgr/tcp_uv.c +++ b/src/core/lib/iomgr/tcp_uv.c @@ -315,6 +315,7 @@ grpc_endpoint *grpc_tcp_create(uv_tcp_t *handle, char *peer_string) { gpr_log(GPR_DEBUG, "Creating TCP endpoint %p", tcp); } + /* Disable Nagle's Algorithm */ uv_tcp_nodelay(handle, 1); memset(tcp, 0, sizeof(grpc_tcp));