🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #21247

Re: YOUHAVE transaction and speeding up nocem's

#21247
From: brian moore
Date: Wed, 03 Sep 1997 00:00
53 lines
3422 bytes
In article <5ui1ir$cqv$1@bigred.inka.de>,
	olaf@bigred.inka.de (Olaf Titz) writes:
> This is annoying, but pausing the server should not kill any
> connections. (Or do they time out at the client side?)

Well, when you start getting 500k nocem's that toast tens of thousands of
articles, they take a while to process. :(

> In any case, it would be necessary to flock() the history text file in
> addition to the hash file. Unfortunately, you can't get away with this
> alone because of the second problem mentioned above.

Good, then I won't do it... :).  One of the reasons I like client/server
models is that most of the time you don't even need to worry about locks
with one server acting as the main controller of data.

> ncmspool works like this. It feeds the server "ctlinnd cancel"
> commands. This would be the best way to do it in theory, but the
> overhead for every single article to be cancelled seems a bit high for
> my taste. You have to open up a new socket, send a command, wait for
> response for each single cancel. These are datagram sockets, meaning
> that (a) they can't be used for batches of cancels because of maximum
> datagram size, (b) you need at least to wait for response on every
> command. (And (c) the implementation in libinn makes a new socket for
> every command, but I think this isn't strictly necessary.)

Hrrm.... well, I played a bit and it seems to work fine: basically,
I call ICCopen() to open the socket, then for every call to do_one,
I instead call ICCcancel().  (Oh, and I commented out the pause code in
c-nocem itself.).  It does end up messing up the site (listed as '?')
in the logs instead of being '[NoCeM]', but seems to work fine.  It
probably isn't as fast as the pause/fastcancel/go method, but it doesn't
pause the server when processing huge nocem's either. :)

> To get batch cancel processing into the server, which would
> undoubtedly be a bit cleaner than the fastcancel program, the server
> should have a special channel where it can be feeded commands in bulk
> without much overhead. (Like a command channel operating on a stream
> socket, perhaps even without acknowledgements of the individual
> commands, which are not needed here.) I.e. some major hackery on innd
> itself.

That would be ideal.  libinn does handle most of the grunt work of
calling INN functions, though.  For now, this is fast enough.  Does
ncmspool really call ctlinnd?  Forking tens of thousands of times to
process a nocem is not on my list of fun things.

-- 
Brian Moore                      The opinions expressed above are my own, not
Sysadmin, C/Perl Hacker          necessarily my employers'.

Technical Details
Message-ID: <5uic5l$1ba$1@news.cmc.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
References: <5ud3lb$grv$1@news.cmc.net> <5ui1ir$cqv$1@bigred.inka.de>

Show Full Headers
Complete Article Headers
Message-ID: <5uic5l$1ba$1@news.cmc.net>
Subject: Re: YOUHAVE transaction and speeding up nocem's
Date: Wed, 03 Sep 1997 00:00:00 +0000
From: bem@news.cmc.net (brian moore)
References: <5ud3lb$grv$1@news.cmc.net> <5ui1ir$cqv$1@bigred.inka.de>
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: 269957281
Distribution: inet
X-Complaints-To: abuse@cmc.net
X-Trace: news.cmc.net 873247733 1386 (None) 206.102.31.253
Organization: Chambers Multimedia Connection
Reply-To: bem@news.cmc.net
Newsgroups: news.software.nntp