[Mono-dev] Nagle and NoDelay for HttpWebRequest

Avery Pennarun apenwarr at gmail.com
Fri Apr 10 17:17:01 EDT 2009

On Fri, Apr 10, 2009 at 1:06 AM, Gonzalo Paniagua Javier
<gonzalo.mono at gmail.com> wrote:
> A couple of months ago, due to performance issues under certain
> circumstances (lots of small packets and TLS involved), we started
> setting the NoDelay option on all the sockets created for
> HttpWebRequest. That code was released as part of 2.4.


Note that disabling nagle is actually fighting the symptom, not the
root of your problem.  If you have tons of small requests, Nagle is
trying to *improve* speeds by batching multiple packets together, and
it does that by including a small delay when you send small packets.

If you could find a way for the client to pipeline multiple requests
(ie. sending the next request before the answer comes back from the
first one), then you'll avoid packet latency, which is usually an even
worse performance killer than nagle.

Plus, if you could batch multiple requests into each request, that
would be even better still.

Have fun,


More information about the Mono-devel-list mailing list