2

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?

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.