🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #32876

Re: De-spamming a diablo newsfeed?

#32876
From: Joe Greco
Date: Thu, 12 Nov 1998 00:00
58 lines
3499 bytes
In news.software.nntp article <72ctd4$8is$1@flea.best.net>, dillon@best.net (Matt Dillon) wrote:
::In article <87af1yhw9t.fsf@erlenstar.demon.co.uk>,
::Andrew Gierth  <andrew@erlenstar.demon.co.uk> wrote:
::>>>>>> "Jeremy" == Jeremy  <jeremy@exit109.com> writes:
::>
::> Jeremy> The ideal thing would be for servers like Cyclone and Diablo
::> Jeremy> to have an embedded Perl.
::>
::>Unlikely. You've seen the problems with embedding it in innd, where
::>doing stuff like loading db modules tends to gronk the server.
::>
::> Jeremy> The next best thing would be a little C program that runs on
::> Jeremy> the external filter interface, embeds Perl, and implements
::> Jeremy> the superior INN-style filter interface.  Presumably such a
::> Jeremy> program could suck in articles and parse them faster than
::> Jeremy> regular Perl code.
::>
::>I doubt if the difference would be that great.
::>
::>(Hint: have you tried an approach like setting $/ = "\r\n.\r\n" and
::>reading the whole article in one shot?)
::>
::>-- 
::>Andrew.
:
:    What we really need to do is be able to pass a file descriptor and
:    offset/size information to the filter rather then try to stuff the
:    article to it.  The filter could then mmap() the article.

This fails because it assumes that the article has been written to disk.

I'd been intending to write an extension to diab-filter for quite some
time now, since I feel relatively certain that the big bottleneck is
latency caused by forcing the articles through an IPC pipe, thanks to
additional context switching, etc.

What I'd like is to see an alternative API where a shared memory segment
was defined by the server, the filter is spawned, and the server simply
lays down an int to specify length followed by whatever IPC handshake
data is necessary and then the article.  Probably 8 bytes plus a N-MB
shmem segment (I usually use N=2).  Then the server merely copies its
article to the segment, signals "go" to the filter, and waits for reply.
There should be one context switch, and the article is instantly available
as a char * buffer to the filter.  Optimizations on each side might allow
for the article to _not_ have to be copied into/outof the shared memory
segment, but for me, even a memcpy() is sufficiently fast.

I will write a reference implementation (a diab-filter replacement) if
Jeremy wants to climb on board.  It would even be attractive to replace
that ugly stuff in INN with such an API, and if we could get Highwind to
do it too, then INN/Diablo/Cyclone would finally have a common filter
API.

I'd like to see INN support the pipe stuff too.

... JG

Technical Details
Message-ID: <72f1h4$ncd@newsops.execpc.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-mail
References: <brad-1011981913570001@brad.techos.skynet.be> <72cjf6$foc$1@east44.supernews.com> <87af1yhw9t.fsf@erlenstar.demon.co.uk> <72ctd4$8is$1@flea.best.net>

Show Full Headers
Complete Article Headers
Message-ID: <72f1h4$ncd@newsops.execpc.com>
Subject: Re: De-spamming a diablo newsfeed?
Date: Thu, 12 Nov 1998 00:00:00 +0000
From: jgreco@ns.sol.net (Joe Greco)
References: <brad-1011981913570001@brad.techos.skynet.be> <72cjf6$foc$1@east44.supernews.com> <87af1yhw9t.fsf@erlenstar.demon.co.uk> <72ctd4$8is$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: 411170744
Sender: jgreco@earth.execpc.com
X-Trace: daily-planet.newsops.execpc.com 910887268 23949 (None) 169.207.16.1
Organization: sol.net Network Services - Milwaukee, WI
Newsgroups: news.software.nntp
X-Complaints-To: abuse@execpc.com