🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
2 messages
2 total messages Started by David Canzi -- non-mailable Thu, 25 Oct 2007 20:17
Linux, nnrpd and TCP_NODELAY.
#78125
Author: 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. |
Re: Linux, nnrpd and TCP_NODELAY.
#78133
Author: David Canzi -- non-mailable
Date: Mon, 29 Oct 2007 04:19
56 lines
3879 bytes
In article <ffqtle$8fk$1@rumours.uwaterloo.ca>,
David Canzi -- non-mailable <dmcanzi@remulak.uwaterloo.ca> wrote:
>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:
>>> 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.

The easiest way turned out to be recompiling nnprd with my added
setsockopt call removed, and swapping it with the nnrpd we've
been using.  For each trial, I ran trn, went to alt.atheism,
downloaded the overview, exited trn.  I did this twice with the
NODELAY nnrpd, them twice with the non-NODELAY nnrpd.  trn used
17 XOVER commands to download the newsgroup overview.  The elapsed
times between the first and last XOVER for the 4 trials are:

Trial 1: 2.63 sec (with NODELAY)
Trial 2: 1.68 sec (with NODELAY)
Trial 3: 1.68 sec (without NODELAY)
Trial 4: 1.62 sec (without NODELAY)

NODELAY doesn't appear to make any difference.  (The first trial
probably took longer because it was the first trial.)

>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.

I have no idea what I was seeing last year.

-- 
David Canzi				| Eternal truths come and go. |
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads