🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #78125

Linux, nnrpd and TCP_NODELAY.

#78125
From: David Canzi -- non-mailable
Date: Thu, 25 Oct 2007 20:17
59 lines
4147 bytes
This started in news.admin.ent-abuse.policy when somebody mentioned
that, for clients, pattern-matching and junking thousands of
flood posts in a newsgroup under flooding attack was slow, one
tenth of a second per article.  I recognized the symptom...

I reported my experience of observing responses from our news
server to a client delayed a tenth of a second, of modifying
nnrpd.c to set TCP_NODELAY on the socket used for communicating
with the client, and seeing the delay disappear.  Andrew [Gierth?]
was skeptical:

In article <slrnfi05a9.cp4.andrew+nonews@atlantis.supernews.net>,
Andrew - Supernews  <andrew@supernews.net> wrote:
>On 2007-10-25, David Canzi -- non-mailable <dmcanzi@remulak.uwaterloo.ca>
>wrote:
>> In article <slrnfhvkaq.cp4.andrew+nonews@atlantis.supernews.net>,
>> Andrew - Supernews  <andrew@supernews.net> wrote:
>>>On 2007-10-24, David Canzi -- non-mailable <dmcanzi@remulak.uwaterloo.ca>
>>>wrote:
>>>> I observed this behaviour on our news server, running inn.  In some
>>>> operating systems the default behaviour of an internet socket is
>>>> to collect outbound data for a tenth of a second before sending,
>>>
>>>This only applies if the sender is doing consecutive small sends without
>>>intervening receives. If you do send-receive-send-receive then there is
>>>no particular need to set TCP_NODELAY.
>>
>> I watched the NNTP traffic between my workstation and the news
>> server and saw every response from the server delayed a 10th of
>> a second, no matter how trivial the request.  I patched nnrpd.c,
>> and the delay disappeared.  The 10th of a second delay probably
>> only affects sockets accepting incoming connections and not
>> sockets connecting outbound.
>
>No, the direction of connection is irrelevent. (However, this is more
>relevent in news.software.nntp; could you post your OS details and the
>actual packet trace there?)

This happened running innd under Linux.  It happened last year.
I no longer have the packet dumps.  I may be able to construct
a toy server and client later on and provide packet dumps, but
it'll have to be after hours.

I've run into trouble with you whenever I've strayed into
theorizing, so to be on the firmest possible ground I will report
my observations without trying to interpret them.

After upgrading our news server, I noticed and a co-worker
noticed that downloading overviews in trn was much slower.
I also noticed that processing of some of my more adventurous
killfiles was slower.  I dumped packets and the timestamps showed
that server responses were delayed a tenth of a second, no matter
how trivial the processing required to answer the client's request.

After modifying nnrpd to set TCP_NODELAY, overview downloading
and killfile processing were both much faster.

-- 
David Canzi				| Eternal truths come and go. |
Technical Details
Message-ID: <ffqtle$8fk$1@rumours.uwaterloo.ca>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!newsfeed.stanford.edu!newsfeed.news.ucla.edu!nrc-news.nrc.ca!utnut!news.uwaterloo.ca!not-for-mail
References: <tskirvin.20071015145146$5c92@cairo.ks.uiuc.edu> <slrnfhvkaq.cp4.andrew+nonews@atlantis.supernews.net> <ffot1o$iro$1@rumours.uwaterloo.ca> <slrnfi05a9.cp4.andrew+nonews@atlantis.supernews.net>

Show Full Headers
Complete Article Headers
Message-ID: <ffqtle$8fk$1@rumours.uwaterloo.ca>
Subject: Linux, nnrpd and TCP_NODELAY.
Date: Thu, 25 Oct 2007 20:17:50 +0000
From: dmcanzi@remulak.uwaterloo.ca (David Canzi -- non-mailable)
References: <tskirvin.20071015145146$5c92@cairo.ks.uiuc.edu> <slrnfhvkaq.cp4.andrew+nonews@atlantis.supernews.net> <ffot1o$iro$1@rumours.uwaterloo.ca> <slrnfi05a9.cp4.andrew+nonews@atlantis.supernews.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.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!newsfeed.stanford.edu!newsfeed.news.ucla.edu!nrc-news.nrc.ca!utnut!news.uwaterloo.ca!not-for-mail
Newsgroups: news.software.nntp
Organization: IPR - Institute for Phlogiston Research
Lines: 59
NNTP-Posting-Host: remulak.uwaterloo.ca
X-Trace: rumours.uwaterloo.ca 1193343470 8692 129.97.109.26 (25 Oct 2007
X-Complaints-To: abuse@uwaterloo.ca
NNTP-Posting-Date: Thu, 25 Oct 2007 20:17:50 +0000 (UTC)
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
Originator: dmcanzi@remulak.uwaterloo.ca (David Canzi -- non-mailable)