Thread View: news.software.nntp
26 messages
26 total messages
Started by Brad Knowles
Mon, 27 Sep 1999 00:00
Diablo vs. INN questions...
Author: Brad Knowles
Date: Mon, 27 Sep 1999 00:00
Date: Mon, 27 Sep 1999 00:00
60 lines
3293 bytes
3293 bytes
Folks,
I think I'm beginning to understand just a bit more how Diablo works
as compared to INN. I would like confirmation or clarification as to the
following.
For INN:
1. When receiving an article, it is written into shared memory,
and from then on only a pointer to this shared memory is passed around.
2. When executing the perl filter, a copy of the program is
always kept running (a la apache w/ mod_perl), and a pointer to the
article (stored in shared memory) is passed.
3. When this article is to be offerred to one or more peers, a
pointer to this shared memory is passed to the routine that writes the
article to a spool file to be read by innfeed, and depending on the
feeding method (0 to 3), if an innfeed process is not currently running or
is not currently idle, a new one will be fired up to handle this article
(up to the maximum simultaneous connections that have been configured).
Otherwise the article id is written to one of the existing spool files via
an algorithm that either guarantees absolute minimum latency to offer that
article to a particular peer, or maximizes the number of articles per
second, or some combination of the two.
For Diablo:
1. When receiving an article, it is written into memory that is
private to that particular child of the Diablo daemon, and therefore if
the article is to be passed around it must copy the data as opposed to
using a pointer to shared memory.
2. When executing the perl filter, a copy of the program is
typically kept running (a la apache w/ mod_perl), but the article has to
be fed in on stdin (i.e., copied), instead of a pointer to the appropriate
shared memory area being passed.
3. When this article is to be offered to one or more peers, it is
written to the end of the currently active spool file for that peer, and
this spool file is being read by a single dnewslink process. Only if
there is a backlog of spool files for that peer will multiple dnewslink
processes be started up so as to have more than one simultaneous
connection open.
Did I get all that correct? If so, it sounds to me like there are
some pretty obvious performance enhancements to be added to Diablo....
;-)
--
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>
Are you a USENET news server administrator outside of North America or
Western Europe? Would you like a newsfeed from a site in the Freenix
Top 100? If so, please contact me via private e-mail for details.
Re: Diablo vs. INN questions...
Author: Russ Allbery
Date: Mon, 27 Sep 1999 00:00
Date: Mon, 27 Sep 1999 00:00
54 lines
3241 bytes
3241 bytes
Brad Knowles <brad@shub-internet.org> writes: > For INN: > 1. When receiving an article, it is written into shared memory, and > from then on only a pointer to this shared memory is passed around. No, not quite. Remember, INN is at its heart a monolithic daemon. There's just one innd process. It handles incoming connections in a select loop and writes feed data to outgoing connections as defined in newsfeeds. So there's no shared memory involved; there's just normal, ordinary heap memory. > 2. When executing the perl filter, a copy of the program is always kept > running (a la apache w/ mod_perl), and a pointer to the article (stored > in shared memory) is passed. Under INN, the Perl filter isn't a process. It's embedded directly inside innd; innd links with the Perl libraries. This is the reason why the Perl filter is so much faster in innd than in the external process implementation of Diablo and Cyclone. Because innd is a monolithic process, unlike Diablo's forking model, you can do that and still maintain history across all incoming articles. > 3. When this article is to be offerred to one or more peers, a pointer > to this shared memory is passed to the routine that writes the article > to a spool file to be read by innfeed, and depending on the feeding > method (0 to 3), if an innfeed process is not currently running or is > not currently idle, a new one will be fired up to handle this article > (up to the maximum simultaneous connections that have been configured). > Otherwise the article id is written to one of the existing spool files > via an algorithm that either guarantees absolute minimum latency to > offer that article to a particular peer, or maximizes the number of > articles per second, or some combination of the two. No, innd doesn't know anything about outgoing feeds at all. It just knows how to write designated data to another program or to a file. innfeed is a separate process that handles all outgoing feeds in a standard configuration; innd writes the article out to disk and then tells innfeed its storage token and all sites that it should be sent to, and innfeed reads it back in from disk and blasts it out to those sites, opening new connections as necessary. If INN were really using shared memory, you could take the disk out of that loop, and then INN would have a latency comparable to NNTPrelay or Cyclone. Similarly, if you were to thread innfeed and then make innd at least thread-safe, you could just pass the article in memory to an innfeed thread and get similar speed. -- Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
Re: Diablo vs. INN questions...
Author: Kjetil Torgrim Homme
Date: Mon, 27 Sep 1999 00:00
Date: Mon, 27 Sep 1999 00:00
23 lines
1587 bytes
1587 bytes
[Brad Knowles] > Did I get all that correct? If so, it sounds to me like there > are some pretty obvious performance enhancements to be added to > Diablo.... ;-) Well, the Diablo design didn't concentrate on latency at all, the intended configuration would run the batches every five minutes. The realtime feeds are a hack. But if you are willing to sacrifice latency, you get very good throughput even on modest machines. Lars Olafsen has patched our Diablo[1] so that the dnewslink listens on a pipe rather than polling the feed file every second. This improves latency quite a bit (it's down to less than a second), but INN is of course faster still. Kjetil T. [1] The patches have been sent to Matt, but I'm not sure if they will make it into the official release of Diablo.
Re: Diablo vs. INN questions...
Author: Andrew Gierth
Date: Mon, 27 Sep 1999 00:00
Date: Mon, 27 Sep 1999 00:00
42 lines
2464 bytes
2464 bytes
>>>>> "Brad" == Brad Knowles <brad@shub-internet.org> writes: Brad> Folks, Brad> I think I'm beginning to understand just a bit more how Brad> Diablo works as compared to INN. I would like confirmation or Brad> clarification as to the following. Brad> For INN: what version of INN? Brad> 1. When receiving an article, it is written into Brad> shared memory, not in any version up to and including 2.2.1, I haven't looked at the -current stuff but I highly doubt that it does this Brad> 2. When executing the perl filter, a copy of the Brad> program is always kept running (a la apache w/ mod_perl), and a Brad> pointer to the article (stored in shared memory) is passed. not quite; the perl filter is run in an interpreter embedded into innd, no shared memory is required. Brad> 3. When this article is to be offerred to one or more Brad> peers, a pointer to this shared memory is passed to the routine Brad> that writes the article to a spool file to be read by innfeed, also wrong; the storage token that gets written to innfeed (normally via a pipe, not via a spool file) is a reference to the article in the spool; innfeed will read the article from there. innfeed does not spawn additional processes; one innfeed process handles all the connections for the sites that you funnel to it simultaneously. (It's possible to start more than one innfeed if you like, but you should normally only do this if each innfeed will be handling a totally different set of articles, e.g. small vs large.) -- Andrew.
Re: Diablo vs. INN questions...
Author: Russell Vincent
Date: Mon, 27 Sep 1999 00:00
Date: Mon, 27 Sep 1999 00:00
17 lines
1316 bytes
1316 bytes
Brad Knowles <brad@shub-internet.org> wrote: > For Diablo: > 2. When executing the perl filter, a copy of the program is > typically kept running (a la apache w/ mod_perl), but the article has to > be fed in on stdin (i.e., copied), instead of a pointer to the appropriate > shared memory area being passed. No, the perl filter reads the article from disk (or more likely the buffer cache/mmap'ed version of the file) as it was only just written to disk. The filter is fed the article location and size. -Russell
Re: Diablo vs. INN questions...
Author: Brad Knowles
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
36 lines
2443 bytes
2443 bytes
In article <yl4sggteag.fsf@windlord.stanford.edu>, Russ Allbery
<rra@stanford.edu> wrote:
> Remember, INN is at its heart a monolithic daemon. There's just one innd
> process. It handles incoming connections in a select loop and writes feed
> data to outgoing connections as defined in newsfeeds.
Hmm. I didn't know that INN operated as a single daemon with incoming
connections handled by select. For some reason, I thought that it used a
shared memory forking model....
> Under INN, the Perl filter isn't a process. It's embedded directly inside
> innd; innd links with the Perl libraries.
Hmm, here's yet another thing I didn't know about INN. The more I
learn, the more I realise how little I know.
> If INN were really using shared memory, you could take the disk out of
> that loop, and then INN would have a latency comparable to NNTPrelay or
> Cyclone. Similarly, if you were to thread innfeed and then make innd at
> least thread-safe, you could just pass the article in memory to an innfeed
> thread and get similar speed.
Hmm. Myself, I think I'd be inclined to go the shared memory route,
although threading is also very attractive. I would be inclined to think
that the shared memory solution would be easier to program, although I
speak from complete ignorance. ;-)
--
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>
Are you a USENET news server administrator outside of North America or
Western Europe? Would you like a newsfeed from a site in the Freenix
Top 100? If so, please contact me via private e-mail for details.
Re: Diablo vs. INN questions...
Author: bill davidsen
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
33 lines
2279 bytes
2279 bytes
In article <37f0580c$0$7749@news.execpc.com>, Joe Greco <jgreco@ns.sol.net> wrote: | Which is what makes filtering under INN a perfect bitch; you have to use | Perl. Some of us prefer to code filters in C, or shell, or whatever. Some | of us still do not speak Perl. They would be even faster in assembler! Of course they would take forever to write, etc. The reason for using perl is that it has the string manipulation most filters really need, extended regular expressions, etc. C is just not a good string processing language. I would use it for something which had to be exceptionally fast, but news filters only need to be vary fast, and perl does that well. My timer stats usually show history lookup and perl filters use about the same cpu, and I can live with that. BTW: I am not a perl enthusiast, but I am not only a tool using mammal, but a "right tool" using mammal, and perl is a better tool than C in terms of time to write code, and code readability (means more maintainable, obviously). I still do log analysis in AWK, because the mawk interpreter is way faster then perl on linux, BSD, Solaris and AIX, at least when you have to read in a bunch of lines and look at them. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc When taking small children to a carnival, always have them go potty *before* you let them go on the rides, and let them eat all the junk food and candy *after*.
Re: Diablo vs. INN questions...
Author: Russell Vincent
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
25 lines
1699 bytes
1699 bytes
Joe Greco <jgreco@ns.sol.net> wrote: > There's no perl filter. There's just an external filter module. Sorry, you are right. I was thinking the right thing, but typed perl. > Now for the correct description, since the filter doesn't operate in the > manner you describe... :-/ That depends on where you consider the filter as starting. I was thinking of it starting from your code that is conditionally compiled. Strictly speaking, you are correct, though. I am just being pedantic. :-) > Diablo offered a bit of a challenge for filtering, since it does > forking per-process reception of articles and didn't really offer a central > point where one could put the filter into the inbound feed. Yep - a bit like trying to hack radius authentication into dreaderd. There is an easy way and and then there is better way. :-) -Russell
Re: Diablo vs. INN questions...
Author: Joe Greco
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
56 lines
3555 bytes
3555 bytes
In news.software.nntp article <1rn1u6y649.fsf@ganglot.ifi.uio.no>, Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote: :[Joe Greco] : :> :Well, the Diablo design didn't concentrate on latency at all, the :> :intended configuration would run the batches every five minutes. The :> :realtime feeds are a hack. :> :> Hey, come on, that was mostly _my_ hack... :-( don't go insulting the :> hacks. : :Sorry! ;-) : :> :Lars Olafsen has patched our Diablo[1] so that the dnewslink listens :> :on a pipe rather than polling the feed file every second. This :> :improves latency quite a bit (it's down to less than a second), but :> :INN is of course faster still. :> :> Why's that? : :Uhm, well, we haven't timed it on the same hardware, so it's just a :hunch. The problem is that the select loop in the diablo master :process is "overwhelmed" by all the incoming and outgoing :communication, so it takes time between each time it visits a feed. Argument in favor of my outgoing feed process idea, methinks... Seriously, though, I'd think that this by itself wouldn't be a real bottleneck. Many programs manage to talk to huge fleets of descriptors in a select oriented model, including dreaderd, X11, your average IRC server, and INN - to name a very few. If you're running into performance bottlenecks, it is probably more because you're also running a filter alongside Diablo, which is causing a lock-step delay in the select loop processing. Yeah, yeah, I know it's a crappy architecture, but this thread has already covered some potential improvements. And I can say it's a crappy architecture since I chose that way to implement the filter and I _know_ it's crappy. :You see, the communication with the dnewslink process is via a two-way :pipe. dnewslink tells the diablo master how many bytes it has read :from the pipe, so that the master knows when to stop jamming data into :the pipe, avoiding write() blocking. We chose this method since it :was portable, but I am sure there are better ways of doing this :communication. Yeah, use nonblocking I/O and buffer up the overflow (or write it into batch files). That's portable too, but admittedly a bit more difficult to code up. Ultimately, you need something like that to be able to work with nntplink or innfeed or the feed-tool-of-your-choice though, and if I ever get some free time, I'd really like to work on that. But my real problem is (shhh! don't tell anyone!) I'm not a real programmer, I'm just a hacker who is good with C, and such large architectural changes on someone else's code is a bit more than I usually like to tackle. ... JG
Re: Diablo vs. INN questions...
Author: Joe Greco
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
63 lines
4083 bytes
4083 bytes
In news.software.nntp article <7soniq$n3f$1@wave.pipex.net>, Russell Vincent <russellv-n@nosp.uk.uu.net> wrote:
:Brad Knowles <brad@shub-internet.org> wrote:
:
:> For Diablo:
:
:> 2. When executing the perl filter, a copy of the program is
:> typically kept running (a la apache w/ mod_perl), but the article has to
:> be fed in on stdin (i.e., copied), instead of a pointer to the appropriate
:> shared memory area being passed.
:
:No, the perl filter reads the article from disk (or more likely
:the buffer cache/mmap'ed version of the file) as it was only just
:written to disk. The filter is fed the article location and size.
There's no perl filter. There's just an external filter module.
Now for the correct description, since the filter doesn't operate in the
manner you describe... :-/
Diablo offered a bit of a challenge for filtering, since it does
forking per-process reception of articles and didn't really offer a central
point where one could put the filter into the inbound feed.
Diablo's operation involves doing history lookups and article acceptance in
its subprocesses, and then communicating that data back to the master
process, which mainly accepts new connections and handles the batch files.
So I punted (a bit)... I modified the master process. It takes the just-
received article, retrieves it from disk (since the child - not the master -
had a copy), and feeds it to the filter. Based on the return from the
filter, the article may or may not be fed to sites. But it will still be
on spool.
One likely optimization would be to notify the child process to remove the
just-received article in the event that the article was filtered and no
feed object received a copy of the article ("onlyspam" option). I didn't
actually do this, although somebody probably should. It would also require
some minor consideration about the case where someone was using the Diablo
server as a pure spool server. I can't think of any case where someone
would have no outbound feeds, AND run a filter, AND still want to retain
the article even if the filter rejected it. I mean, what'd the point of a
filter be then. But maybe someone else can think of a reason.
Another likely optimization would be to spawn the filter logic off into
a subprocess, and have the diablo children deal with it in some more
direct manner. This would potentially allow for things like the use of
shared memory to pass the article from diablo child to diablo filter,
would remove a significant bottleneck in the main diablo process, and
would probably only require minor modifications to the main/child diablo
communications channel to pass the filter-return-status.
More along the lines of latency optimizations, it'd be interesting to
extend the diablo feed mechanism into something more INN-ish. Again,
this could be done by spinning off an outbound-feed process, which the
diablo children would talk to directly, instead of the parent. Give it
the ability to do INN-style funnel feeds, program feeds, pipe feeds,
etc. I've never been a huge fan of the /news/dqueue thing, although it
works great for some purposes. It sucks for "rtflush" feeding to fifty
peer objects in a directory with a thousand entries.
... JG
Re: Diablo vs. INN questions...
Author: Russell Vincent
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
16 lines
1341 bytes
1341 bytes
Mike Horwath <drechsau+usenet@yuck.net> wrote: > Are you going to share that hack so that it can be included in the > next Diablo release? Of course. I am just waiting for some time to test and improve it somewhat. It currently fires up an external process for every dreaderd, which isn't quite what I had in mind. :-) Getting my head around the Diablo dreaderd way of doing things has been quite an experience. -Russell
Re: Diablo vs. INN questions...
Author: bill davidsen
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
30 lines
2245 bytes
2245 bytes
In article <37f05ee5$0$7747@news.execpc.com>, Joe Greco <jgreco@ns.sol.net> wrote: | More along the lines of latency optimizations, it'd be interesting to | extend the diablo feed mechanism into something more INN-ish. Again, | this could be done by spinning off an outbound-feed process, which the | diablo children would talk to directly, instead of the parent. Give it | the ability to do INN-style funnel feeds, program feeds, pipe feeds, | etc. I've never been a huge fan of the /news/dqueue thing, although it | works great for some purposes. It sucks for "rtflush" feeding to fifty | peer objects in a directory with a thousand entries. Don't hold back, tell us how you really feel! Actually, I have to agree, the current mechanism suffers some scaling limitations. That said, I would love to see all the people working on Diablo get their code merged and stable before embarking on a rethink of the feed mechanism. There are a lot of useful enhancements in various stages of stability, and that would be a good starting point. You have a number of people who want to try the features, but it's not only a moving target, but perhaps several moving targets ;-) -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc When taking small children to a carnival, always have them go potty *before* you let them go on the rides, and let them eat all the junk food and candy *after*.
Re: Diablo vs. INN questions...
Author: Russ Allbery
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
46 lines
2605 bytes
2605 bytes
Joe Greco <jgreco@ns.sol.net> writes: > Russ Allbery <rra@stanford.edu> wrote: >> Under INN, the Perl filter isn't a process. It's embedded directly >> inside innd; innd links with the Perl libraries. > Which is what makes filtering under INN a perfect bitch; you have to use > Perl. Some of us prefer to code filters in C, or shell, or whatever. > Some of us still do not speak Perl. You can use either Perl or Python, you could use Tcl if you felt like fixing the bit rot in that code but no one working on INN seems to care about Tcl any more, and it would actually be reasonably easy to add a C filtering interface on platforms that support dlopen(). Hm. >> This is the reason why the Perl filter is so much faster in innd than >> in the external process implementation of Diablo and Cyclone. Because >> innd is a monolithic process, unlike Diablo's forking model, you can do >> that and still maintain history across all incoming articles. > Apples and oranges have nothing to do with each other. The Perl filter > is so much faster simply because it doesn't have to do quite as much > putzing around with copying the article around. You missed the inference between my sentences. The filter in INN is faster than the filter in Diablo because it's embedded. You could embed the filter in Diablo as well and get the same speed, but you'd lose global history. > I can build a two-process filter system that takes your embedded Perl > filter and beats the pulp out of it, performancewise, simply because I > can program in a compiled language. So can I. It's downright trivial to add code to innd/perl.c to create another XS callback, and I intend to lift the slowest parts of my filter to C for speed. > I'd much rather see a common filter API devised. Sorry, not interested unless it's embedded. Anything that isn't embedded is too slow. -- Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
Re: Diablo vs. INN questions...
Author: bill davidsen
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
29 lines
2146 bytes
2146 bytes
In article <yl4sggteag.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> wrote: | If INN were really using shared memory, you could take the disk out of | that loop, and then INN would have a latency comparable to NNTPrelay or | Cyclone. Similarly, if you were to thread innfeed and then make innd at | least thread-safe, you could just pass the article in memory to an innfeed | thread and get similar speed. On any reasonable transit machine the disk is out of the loop. The article is still in disk cache for all node which can keep up, and the only thing added is the memory to memory copy from the disk cache to user buffers. And if you are mmaping articles I'm not even sure that is required, if the o/s has the balls intestinal fortitude to mmap a disk buffer to user space. In any case, compared to network and disk latency I don't think you have an significant delay here. If you were really trying to get absolute max transit speed there are other ugly tricks you could do, and the next time I'm "between jobs" I may sit down and do that, just to see how fast you can go. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc When taking small children to a carnival, always have them go potty *before* you let them go on the rides, and let them eat all the junk food and candy *after*.
Re: Diablo vs. INN questions...
Author: Russ Allbery
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
41 lines
2731 bytes
2731 bytes
bill davidsen <davidsen@tmr.com> writes: > C is just not a good string processing language. I would use it for > something which had to be exceptionally fast, but news filters only need > to be vary fast, and perl does that well. My timer stats usually show > history lookup and perl filters use about the same cpu, and I can live > with that. With a crappy CPU, that isn't true, yet. There are some parts of Perl filtering that really need to be lifted to C. The MD5 code itself is already C, of course; the next big speed win will be lifting the binary check, which can be done far more efficiently in optimized C than by invoking the full power of a regex engine on it (for one thing, properly designed you wouldn't have to do *any* backtracking, which is a huge win). The next big win would be lifting the MD5 fuzziness to C, which would be a lot harder since it's fairly complex regexes. After that, everything in my filter is noise; it operates only on headers, which is equivalently fast in Perl as in C really and in any case fast enough that other parts of a news server are slow enough to make it irrelevant. Cleanfeed may have some other stuff that could be improved, mostly the badguys body-scanner regexes, but I don't use any of that. My INN 2.3 test machine is (intentionally) a SPARC 20, so that I can see the impact of a crappy CPU on the relative timings for various operations. Sep 28 11:14:21 headwall.Stanford.EDU innd: ME time 600135 idle 369479(70784) artwrite 26850(2561) artlink 0(0) hiswrite 38563(5343) hissync 169(535) sitesend 8051(4807) artctrl 2260(156) artcncl 2409(166) hishave 42709(39889) hisgrep 400(65) perl 37291(5240) overv 0(0) This is typical. History bites; there has to be a way to speed it up. (On this particular machine, I'm beating the crap out of a fairly slow disk with the history file, so I'm not surprised it's so slow.) I'm pretty sure that with some work, I can halve that Perl time. -- Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
Re: Diablo vs. INN questions...
Author: Joe Greco
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
38 lines
2712 bytes
2712 bytes
In news.software.nntp article <yl4sggteag.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> wrote: :Brad Knowles <brad@shub-internet.org> writes: :> 2. When executing the perl filter, a copy of the program is always kept :> running (a la apache w/ mod_perl), and a pointer to the article (stored :> in shared memory) is passed. : :Under INN, the Perl filter isn't a process. It's embedded directly inside :innd; innd links with the Perl libraries. Which is what makes filtering under INN a perfect bitch; you have to use Perl. Some of us prefer to code filters in C, or shell, or whatever. Some of us still do not speak Perl. :This is the reason why the Perl :filter is so much faster in innd than in the external process :implementation of Diablo and Cyclone. Because innd is a monolithic :process, unlike Diablo's forking model, you can do that and still maintain :history across all incoming articles. Apples and oranges have nothing to do with each other. The Perl filter is so much faster simply because it doesn't have to do quite as much putzing around with copying the article around. I can build a two-process filter system that takes your embedded Perl filter and beats the pulp out of it, performancewise, simply because I can program in a compiled language. Using shared memory helps. Some. But only really with big articles. Been there, done that. I'd much rather see a common filter API devised. The Cyclone paradigm, which I grabbed for Diablo, is very simplistic and elegant at the same time, but I'd agree that it could benefit from shared memory. I don't personally think that writing INN-specific hacks to filters is a real good way to encourage diversity in the NNTP server world, and would much prefer to see the effort spent on devising a unified filter model that'll work with INN, Cyclone, Diablo, and NNTPRelay - at a minimum. ... JG
Re: Diablo vs. INN questions...
Author: Russ Allbery
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
18 lines
1415 bytes
1415 bytes
Brad Knowles <brad@shub-internet.org> writes: > Hmm. Myself, I think I'd be inclined to go the shared memory route, > although threading is also very attractive. I would be inclined to > think that the shared memory solution would be easier to program, > although I speak from complete ignorance. ;-) Shared memory is probably easier to program (although it can still be very annoying to deal with), but threading is really the direction to go for the long term since once you're threaded it becomes much easier to make more data shared, whereas with shared memory it can still be a lot of work. Since both will be a lot of work, I'd rather go with the long-term solution. -- Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
Re: Diablo vs. INN questions...
Author: greg andruk
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
20 lines
1426 bytes
1426 bytes
Joe Greco <jgreco@ns.sol.net> wrote: > Russ Allbery <rra@stanford.edu> wrote: >> Under INN, the Perl filter isn't a process. It's embedded directly inside >> innd; innd links with the Perl libraries. > Which is what makes filtering under INN a perfect bitch; you have to use > Perl. There are also TCL and Python filters for innd. > Some of us prefer to code filters in C, or shell, or whatever. > Some of us still do not speak Perl. It's straightforward to implement, for example, a Highwind-style piped interface with either Perl or Python. I'm not sure that the TCL interface has access to enough of the article to get that one right, but two out of three's pretty good.
Re: Diablo vs. INN questions...
Author: Joe Greco
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
44 lines
3106 bytes
3106 bytes
In news.software.nntp article <7sr01r$ong$1@newssvr02.news.prodigy.com>, davidsen@tmr.com (bill davidsen) wrote: :In article <37f0580c$0$7749@news.execpc.com>, :Joe Greco <jgreco@ns.sol.net> wrote: : :| Which is what makes filtering under INN a perfect bitch; you have to use :| Perl. Some of us prefer to code filters in C, or shell, or whatever. Some :| of us still do not speak Perl. : : They would be even faster in assembler! Of course they would take :forever to write, etc. The reason for using perl is that it has the :string manipulation most filters really need, extended regular :expressions, etc. I don't know about your dialect of C, but mine does happen to have extended regular expressions. As part of libc, even. But you do need to specify REG_EXTENDED. : C is just not a good string processing language. I would use it for :something which had to be exceptionally fast, but news filters only need :to be vary fast, and perl does that well. My timer stats usually show :history lookup and perl filters use about the same cpu, and I can live :with that. : : BTW: I am not a perl enthusiast, but I am not only a tool using :mammal, but a "right tool" using mammal, and perl is a better tool than :C in terms of time to write code, and code readability (means more :maintainable, obviously). I still do log analysis in AWK, because the :mawk interpreter is way faster then perl on linux, BSD, Solaris and AIX, :at least when you have to read in a bunch of lines and look at them. I'm a library-building intelligent right tool using mammal, and I happen to be of the opinion that I can do the sorts of filtering that I happen to want to do in C faster, more easily, and better than I could in Perl - not the least of which is because I can bang out the code in C in a few hours, while I'd have to actually learn Perl first. Part of it is because I already have an impressive set of C library functions to deal with Usenet articles, which may (and often does) reduce the "few hours" to an hour or so. Of course, the fantastic thing is that I use these same library functions for other Usenet-related tasks, such as DSRS and the UPS, my sol.* hierarchy cancelbot, etc. ... JG
Re: Diablo vs. INN questions...
Author: Joe Greco
Date: Tue, 28 Sep 1999 00:00
Date: Tue, 28 Sep 1999 00:00
27 lines
1715 bytes
1715 bytes
In news.software.nntp article <1r7llcmch6.fsf@haey.ifi.uio.no>, Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote: :[Brad Knowles] : :> Did I get all that correct? If so, it sounds to me like there :> are some pretty obvious performance enhancements to be added to :> Diablo.... ;-) : :Well, the Diablo design didn't concentrate on latency at all, the :intended configuration would run the batches every five minutes. The :realtime feeds are a hack. Hey, come on, that was mostly _my_ hack... :-( don't go insulting the hacks. :But if you are willing to sacrifice :latency, you get very good throughput even on modest machines. : :Lars Olafsen has patched our Diablo[1] so that the dnewslink listens :on a pipe rather than polling the feed file every second. This :improves latency quite a bit (it's down to less than a second), but :INN is of course faster still. Why's that? ... JG
Re: Diablo vs. INN questions...
Author: bill davidsen
Date: Wed, 29 Sep 1999 00:00
Date: Wed, 29 Sep 1999 00:00
39 lines
2625 bytes
2625 bytes
In article <37f10f2b$0$10182@news.execpc.com>, Joe Greco <jgreco@ns.sol.net> wrote: | In news.software.nntp article <7sr01r$ong$1@newssvr02.news.prodigy.com>, davidsen@tmr.com (bill davidsen) wrote: | : They would be even faster in assembler! Of course they would take | :forever to write, etc. The reason for using perl is that it has the | :string manipulation most filters really need, extended regular | :expressions, etc. | | I don't know about your dialect of C, but mine does happen to have | extended regular expressions. As part of libc, even. But you do | need to specify REG_EXTENDED. The issue is more that of time to write the string stuff in C using procedure calls, the readability of the code afterward, etc. Regular expressions work fine in C, but they are not a known familiar part of the language which can be maintained by readily available programmers. It's a lot easier to find people who know perl than C regex, and the code is far easier to understand, at least if it's well written. [ points about string and regex libraries ] The problem with extensions is that you have to write, document, and maintain them. Where I am is not where I will be in a few years, I don't want to be tied supporting stuff because no one else understands what I did, however fast and elegant. Obviously you can do this stuff in C, it's questionable if that's a good decision based on total cost of ownership of the code. And I bet you can learn perl faster than you learned Diablo! -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc When taking small children to a carnival, always have them go potty *before* you let them go on the rides, and let them eat all the junk food and candy *after*.
Re: Diablo vs. INN questions...
Author: Joe Greco
Date: Wed, 29 Sep 1999 00:00
Date: Wed, 29 Sep 1999 00:00
59 lines
3756 bytes
3756 bytes
In news.software.nntp article <7stak5$vpc$1@newssvr02.news.prodigy.com>, davidsen@tmr.com (bill davidsen) wrote: :In article <37f10f2b$0$10182@news.execpc.com>, :Joe Greco <jgreco@ns.sol.net> wrote: :| In news.software.nntp article <7sr01r$ong$1@newssvr02.news.prodigy.com>, davidsen@tmr.com (bill davidsen) wrote: : :| : They would be even faster in assembler! Of course they would take :| :forever to write, etc. The reason for using perl is that it has the :| :string manipulation most filters really need, extended regular :| :expressions, etc. :| :| I don't know about your dialect of C, but mine does happen to have :| extended regular expressions. As part of libc, even. But you do :| need to specify REG_EXTENDED. : : The issue is more that of time to write the string stuff in C using :procedure calls, the readability of the code afterward, etc. Regular :expressions work fine in C, but they are not a known familiar part of :the language which can be maintained by readily available programmers. : : It's a lot easier to find people who know perl than C regex, and the :code is far easier to understand, at least if it's well written. Well written and Perl don't belong in the same sentence, unless you're one of the 5% of software developers who claims to be fluent in Perl that actually has a clue about how to write good (and also secure) Perl. In my experience, the percentage of C programmers who can write good (and also secure) C is somewhat higher, partly because C has less ambiguity. : [ points about string and regex libraries ] : : The problem with extensions is that you have to write, document, and :maintain them. Where I am is not where I will be in a few years, I don't :want to be tied supporting stuff because no one else understands what I :did, however fast and elegant. : : Obviously you can do this stuff in C, it's questionable if that's a :good decision based on total cost of ownership of the code. And I bet :you can learn perl faster than you learned Diablo! TCO is meaningless around here. I'm a one-man shop. There's no worry about supporting stuff because it's a sure bet that I've got to... because no one else ever will. This is a bit different than the production type environment you might find at an ISP with the associated high rates of turnover... when I stop supporting it, *.nntp.sol.net, my readers, and my transit servers will go away. Poof. Not that I'm planning on it, or anything. And you lose on the Perl bet. I've been trying to learn Perl since 1995 (although I think I did figure out how to write some Perl stuff in the years predating that). I only started working with Diablo in 1997. And we're all aware that I can at least make a Diablo system work, which is more than I can say about what I can do with a Perl program today. Grin!, ... JG
Re: Diablo vs. INN questions...
Author: Kjetil Torgrim Homme
Date: Wed, 29 Sep 1999 00:00
Date: Wed, 29 Sep 1999 00:00
34 lines
2066 bytes
2066 bytes
[Joe Greco] > :Well, the Diablo design didn't concentrate on latency at all, the > :intended configuration would run the batches every five minutes. The > :realtime feeds are a hack. > > Hey, come on, that was mostly _my_ hack... :-( don't go insulting the > hacks. Sorry! ;-) > :Lars Olafsen has patched our Diablo[1] so that the dnewslink listens > :on a pipe rather than polling the feed file every second. This > :improves latency quite a bit (it's down to less than a second), but > :INN is of course faster still. > > Why's that? Uhm, well, we haven't timed it on the same hardware, so it's just a hunch. The problem is that the select loop in the diablo master process is "overwhelmed" by all the incoming and outgoing communication, so it takes time between each time it visits a feed. You see, the communication with the dnewslink process is via a two-way pipe. dnewslink tells the diablo master how many bytes it has read from the pipe, so that the master knows when to stop jamming data into the pipe, avoiding write() blocking. We chose this method since it was portable, but I am sure there are better ways of doing this communication. Kjetil T.
Re: Diablo vs. INN questions...
Author: Lars Henrik B๏ฟฝler Olafsen
Date: Thu, 30 Sep 1999 00:00
Date: Thu, 30 Sep 1999 00:00
43 lines
2751 bytes
2751 bytes
jgreco@ns.sol.net (Joe Greco) writes:
> In news.software.nntp article <1rn1u6y649.fsf@ganglot.ifi.uio.no>, Kjetil Torgrim Homme <kjetilho@haey.ifi.uio.no> wrote:
[..]
> :Uhm, well, we haven't timed it on the same hardware, so it's just a
> :hunch. The problem is that the select loop in the diablo master
> :process is "overwhelmed" by all the incoming and outgoing
> :communication, so it takes time between each time it visits a feed.
[..]
> If you're running into performance
> bottlenecks, it is probably more because you're also running a filter
> alongside Diablo, which is causing a lock-step delay in the select loop
> processing.
Kjetil forgot to mention the host this runs on ... SS10/Solaris 2.5.1
with old ( 4-6 yrs ) 1 and 2 GB disks. ( Despite this, it seems to
hold its own when looking at the freenix top1000[1] ).
As to why the CNFS INN seems faster, I havent a clue. Maybe the INN
monolithic arcitecture helps? ( e.g Diablo needs to pass header info
between the diablo processes through pipes etc ).
[..]
> :You see, the communication with the dnewslink process is via a two-way
> :pipe. dnewslink tells the diablo master how many bytes it has read
> :from the pipe, so that the master knows when to stop jamming data into
> :the pipe, avoiding write() blocking. We chose this method since it
> :was portable, but I am sure there are better ways of doing this
> :communication.
>
> Yeah, use nonblocking I/O and buffer up the overflow (or write it into
> batch files).
Actually it allready does this :-) When the pipe and internal buffer (
150 article-refs ) fills up, it writes new article-refs to regular batch
files, and leaves the rest to cron'ed dnewslinks.
-Lars
[1]: comparing eg. newsfeed.online.no ( Cyclone / #279 ) to us
( news-feed.ifi.uio.no - #310 ).
Re: Diablo vs. INN questions...
Author: Kai Henningsen
Date: Fri, 01 Oct 1999 00:00
Date: Fri, 01 Oct 1999 00:00
41 lines
2720 bytes
2720 bytes
rra@stanford.edu (Russ Allbery) wrote on 28.09.99 in <ylwvtalwwi.fsf@windlord.stanford.edu>: > bill davidsen <davidsen@tmr.com> writes: > > > C is just not a good string processing language. I would use it for > > something which had to be exceptionally fast, but news filters only need > > to be vary fast, and perl does that well. My timer stats usually show > > history lookup and perl filters use about the same cpu, and I can live > > with that. > > With a crappy CPU, that isn't true, yet. There are some parts of Perl > filtering that really need to be lifted to C. The MD5 code itself is > already C, of course; the next big speed win will be lifting the binary > check, which can be done far more efficiently in optimized C than by > invoking the full power of a regex engine on it (for one thing, properly > designed you wouldn't have to do *any* backtracking, which is a huge win). Has anyone ever thought about a regex optimizer for Perl? Unless you're using exotic features, regexes can actually be compiled not only into a nondeterministic finite automaton, which I gather perl does, but into a deterministic finite automaton. Which means you no longer need backtracking. (Lex does this sort of thing, I believe.) Compiling to a DFA isn't cheap (but it's also not all that hard to do), but when you use it to match huge amounts of data, it still pays. That would have the advantage of still being able to easily change the exact regex. > The next big win would be lifting the MD5 fuzziness to C, which would be a > lot harder since it's fairly complex regexes. See above. Kai -- http://www.westfalen.de/private/khms/ "... by God I *KNOW* what this network is for, and you can't have it." - Russ Allbery (rra@stanford.edu)
Re: Diablo vs. INN questions...
Author: Kai Henningsen
Date: Fri, 01 Oct 1999 00:00
Date: Fri, 01 Oct 1999 00:00
29 lines
2033 bytes
2033 bytes
jgreco@ns.sol.net (Joe Greco) wrote on 29.09.99 in <37f268df$0$10178@news.execpc.com>: > Well written and Perl don't belong in the same sentence, unless you're > one of the 5% of software developers who claims to be fluent in Perl that > actually has a clue about how to write good (and also secure) Perl. Subtract all the script kiddies first, and the ratio becomes *much* better. C doesn't seem to have this particular type of followers. > In my experience, the percentage of C programmers who can write good (and > also secure) C is somewhat higher, partly because C has less ambiguity. ROTFL. Read comp.std.c sometimes and see experts argue what the standard actually means. Hell, it happens regularly that not even the committee members can agree on the correct interpretation. As for secure, if you can make it run under "perl -wTMstrict" without complaints and you've gone a long way in the right direction. Kai -- http://www.westfalen.de/private/khms/ "... by God I *KNOW* what this network is for, and you can't have it." - Russ Allbery (rra@stanford.edu)
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