Requests to a CouchDB instance on the same machine have about 40ms latency when HTTP keepalive is used by the client, about 0-1ms latency when the client does not use keepalive. What causes this latency?
Asked
Active
Viewed 383 times
1 Answers
2
This is caused by Nagle's algorithm. CouchDB sends the HTTP headers and the response body in separate calls, causing the kernel to not deliver the response body for 40ms.
As a workaround, you can use this LD_PRELOAD shim to completely turn off Nagle's algorithm for the database process.
thejh
- 141
- 2