🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #45231

Re: News routing software

#45231
From: Curt Welch
Date: Sat, 25 Mar 2000 00:00
179 lines
9080 bytes
mouse@nospam.nibble.net wrote:

> Organization: http://www.easyusenet.com via WNews the worlds most
>               powerful web based news reader.

> References: <(null)>
              ^^^^^^^^

How about the world's most buggy newsreader?

Did you write that newsreader as well? Or are you just posting from
easyusenet?

> Hello everyone,
>
> After many weeks of trying to get INN to run correctly as a news router
> under Linux I gave up and started writing my own software.

Yeah, me to.  Well, I didn't give up on making INN work, but I did decide
I was tired of messing with other people's crappy code (that was at the
beginning of the 2.0 stuff).  If I have to deal with crappy code, I'd
rather it be my own :).

> btw- I also
> tried Cyclone and I liked everything except the $15,000.00 price tag.  I
> now have a working beta version and I'm wondering if anyone in this group
> would like try it out and give suggestions and/or bug reports.

Your article has no line breaks.  Each paragraph is one long line.  Very
bogus. I hope this isn't an indication of the quality of your code.

> The end product will support reader access, but for now it's just a
> router.  One design goal was to make one product that could be used for
> either routing or reading.

Yeah, that's what I did as well.  But there is a cost to that design.  If
you only do routing, you can do a lot of things differently that makes
it perform much better as a router.  It's not just as simple as turnning
off a few features.

And tranist servers are a lot simpler to write.  If you want to do a good
job at both, you need to design the server from the ground up to work
well for both.  Tacking on reader support later isn't likely going to
cut it.

> People that do not want to support readers
> should be able to turn off the CPU/IO intensive work that is required to
> maintain the database used for reader access.

It's not as much a CPU issue as a disk issue in my experience.  But CPU
is part of it as well of course.

> I just haven't wrote the
> code to support reader commands yet.

If you don't address all the reader related issues in your initial design,
you will find that you can't make it work correctly later.   The subtle
details will kill you -- or leave you with a crappy news server.

For example, have you thought about the issues of how the group/xover code
"knows" when an article has expired?  A newsreader that returns GROUP
info, or XOVER data, or LISTGROUP, data that's outdated, or just wrong, is
a bad news server.

This is just one of many small issues that you may not think about until
you start writing that other code.  And by the time you get there, if your
basic storage system doesn't have the support you need, you will find that
the only options are to return the best info you can (crappy server), or
do a complete re-design of the server architecture.

> When it's done it will just be a
> matter of defining a <reader></reader> block in the config file.
>
> Another feature is it's simple to setup.  This was my largest complaint
> about INN.

Yeah, me to.  How many times have I seen people ask about the can't init
history file error in this group?  Why doesn't someone working on INN fix
it so INN just creates the damn history file on it's own if it's not there?

The highwind folks were much better about about creating software that just
"worked".

> There is one executable and one config file.  The config file
> is in the style of the Apache web server config files.    Everything is
> stored in cyclic buffers: spool, history,

On a transit machine, you quite offten what a history file which is much
larger than your spool (i.e. the spool may only be big enough for 6 hours
of data, but the history should hold multiple days of old Message-IDs).

On a reader box, you have a huge spool, and for basic transit related
issues (have you seen article X?), you don't need such a large history.
But, the history is also used for fetching articles by Message-ID.  And
any server that has an article in the spool, (i.e. you can read it
using GROUP and ARTICLE NNN commands), but fails when you try to fetch
it by Message-ID, is once again, a crappy server.

If you use a simple fixed size cyclic buffer of some type for history.  And
the admin must define the size of the history file, then you run into the
problem of the admin not setting the size large enough to hold "all" the
Messages-IDs that in the spool.  And most likely, the admin won't even
realize it's a problem.  The users try to find articles by message-id, and
are told it's not on the server.  They just assume that's true, when in
fact it is on the server, and it's just a history file problem that makes
it look like it's not on the server.

A good reader box needs to adjust the size of the history automatically to
make sure that each and every article in the spool has an entry in the
history file.  This is another problem like the one above that you may not
be able to solve once you "add the reader" commands unless you re-design
the article storage system and history file formats from the group up
later.  So think about this as you write your code.

Remeber also that on a reader box you will want to support different
article retentions based on how the admins wants to save things.  The could
for example save one local group in a spool which lists for a full year.
But all other articles expire in about a week.  You don't want to force the
history file to hold _all_ articles for a year just because the 10 article
in the local gorup stay around that long.  But you do need to make sure
that the Message-IDs of those 10 articles stay in the history for a full
year.

I personally find that strict fixed length cyclic buffers don't work as
well on reader boxes as other designs for these reasons.

> queue files, etc...  There is
> no need to run any expire or cron processes.

Yeah, that's a mess.  I too have avoided the need for all external cron
jobs.  You just modify the config file and start the server.  Nothing
else to set up.  INN is such a mess with all it's extra bagage.

There are a few periodic clean-up things that happen internally in the
sever (memory allocation issues mostly) that are someone what like cron
jobs, but it's all done inside the server so the admin never has to think
about it.

> It also will use external
> spam filters.  I have a real nice perl based spam filter that I'm using
> with it.
>
> You could easily max out a 100 Mbit ethernet connection with low end
> hardware.

Low end PCs aren't really all that "low end" anymore :).

> My test machine (P3/500, 256MB RAM, IDE drives) is burning 23
> Mbits of bandwidth, load average of 0.6, CPU at 70% idle and it's even
> running my perl based spamfilter.  It requires about 1 MB of memory for
> each open stream.  This number is directly related to the max article
> size so you can adjust the memory needs.

You will need to change that later.  You can't afford to use fixed size
buffers once you start trying to support 100's of peers or 1000's of
readers.  You have to allocate and free the buffers on the fly as well
as dynamically adjust their size.

> Right now I only have a Linux version.  I'm not releasing the code right
> now, but all the code is standard Unix code.  The only requirement is it
> needs pthreads and mmap.

pthreads and mmap are two things known to have have problems on various
versions of Unix.  You will find it hard to port to a wide range of Unix
systems.  I avoided both in my design.  But without threads, the code gets
a lot more complex to write.

The use of threads is the primary thing that made the Highwind code such
a bitch to port as far I can tell. (not so hard to compile on other
systems, but a real bitch to make it work well).  If easy portability
across a wide range of Unix systems is important, I'd suggest you re-think
that.  If you don't mind sticking to a single platform (or two), then using
threads is probably a fine way to go.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

Technical Details
Message-ID: <20000325144143.934$mi@newsreader.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: <38dc7c3a$1_1@news.nntpserver.com>

Show Full Headers
Complete Article Headers
Message-ID: <20000325144143.934$mi@newsreader.com>
Subject: Re: News routing software
Date: Sat, 25 Mar 2000 00:00:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <38dc7c3a$1_1@news.nntpserver.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
X-Deja-AN: 602329141
X-User: Curt@NewsReader.Com
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5 %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
Organization: NewsReader.Com
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Newsgroups: news.software.nntp