Article View: news.software.nntp
Article #26261Re: Found out why diablo's dnewslink had non-optimal performance
From: Marc Slemko
Date: Sun, 15 Feb 1998 00:00
Date: Sun, 15 Feb 1998 00:00
63 lines
3700 bytes
3700 bytes
In <6c63vf$pq8$1@flea.best.net> dillon@best.net (Matt Dillon) writes: >:In article <6c598n$q6o$1@scanner.worldgate.com>, >:Marc Slemko <marcs@znep.com> wrote: >:>In <6c4t4e$o8j$1@flea.best.net> dillon@best.net (Matt Dillon) writes: >:.. >:>Erm... this isn't exactly true in the typical situation. Any stack >:>that only allows one unacked packet isn't going to work for many >:>useful things. > no, no... one unacked SHORT packet.... it's part of the congestion > control that most tcp stacks have. It gets turned off if I set > TCP_NODELAY, but TCP_NODELAY is a very dangerous option to set and > may result in the remote end setting it as well. That is a different matter. > The reason you don't usually want to use TCP_NODELAY is because it > basically allows hundreds of unacked short packets to be in transit all > at once, even with nagle enabled. TCP_NODELAY == Nagle. The point is that _IF_ your application is written so you know that you are going to shove as much in a packet as you can already, and if it happens to be small then "oh well", and sending it is better than delaying then sending it, then you need to be able to disable Nagle. You can have very serious performance implications by not disabling it in time-critical situations because of the interaction with delayed ack. If you can't or don't want to code your application so it behaves that way, or your situation isn't time-critical in the required sense, then yes you should not disable Nagle. > Here's a typical situation that actually happened: Apache sets this > option, and if you run a CGI which does tiny write()'s back through > the pipe, apache will do tiny writes out the network. An ISP running > Apache had a user running a CGI that did this. Even with a reasonable > TCP window size of, say, 16K, the network got blown away by several > *thousand* 41 byte (1 stream byte) packets per second. Nagle didn't > kick in because there wasn't any packet loss, just a massively delayed > network. Nagle needs to be disabled by Apache because you can have some significant performance problems otherwise, especially when combined with delayed ack. There have been several papers done on this, in addition to common sense experience. I am not sure what version of Apache you are talking about, but I find this difficult to see in 1.2.x because all CGI is buffered unless they deliberately avoid that with a nph- script. In 1.3, it isn't buffered but that is a design decision made on purpose. The CGI needs to deal with being sure it doesn't do silly things, eg. use stdio to avoid it. Apache is quite good at ensuring that it gathers stuff into one write (well, writev) where possible. In fact, it goes so far that it exposes bugs in Navigator where it breaks when the response headers are the wrong length and are in the same packet as the body of the response. Disabling Nagle wasn't the problem here, the problem was the CGI.
Technical Details
Message-ID:
<6c6ed5$fdo$1@scanner.worldgate.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<6c4t4e$o8j$1@flea.best.net> <6c598n$q6o$1@scanner.worldgate.com> <6c63vf$pq8$1@flea.best.net>Show Full Headers
Complete Article Headers
Message-ID: <6c6ed5$fdo$1@scanner.worldgate.com> Subject: Re: Found out why diablo's dnewslink had non-optimal performance Date: Sun, 15 Feb 1998 00:00:00 +0000 From: Marc Slemko <marcs@znep.com> References: <6c4t4e$o8j$1@flea.best.net> <6c598n$q6o$1@scanner.worldgate.com> <6c63vf$pq8$1@flea.best.net> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 325236152 Organization: WorldGate Inc. http://www.worldgate.com/ Newsgroups: news.software.nntp