🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #9309

how to speed up innd

#9309
From: T. William Wells
Date: Sun, 14 Jul 1996 00:00
75 lines
4129 bytes
Throw it away! :-) That's about what I did. You've probably read
my rants about how disk I/O ups network latency and how this is an
O(n**2) effect of the size of the newsfeed. Well, it's true and
I've now some hard evidence.

I've been struggling for nearly six months to make my news server
keep up. I fixed all sorts of local problems, harassed my feeds
into fixing theirs, then went on an optimizing rampage.

Nothing helped. At the last, I could just keep up -- if nothing
interfered with the normal flow of news. Otherwise I'd fall behind
and take weeks to catch up.

Not until I totally disconnected article receipt from article
filing did matters improve. On my system, there's now this stupid
nntp daemon sitting on the nntp port (it doesn't even do
streaming) which creates rnews batches in a 70M spool area. A
single rnews process feeds that into innd. (I don't even do an
msgidd equivalent!)

Just for reference, I have three full incoming newsfeeds, two
approximately half outgoing newsfeeds, and a typical peak-time
load of 10-20 nnrpds. This is on a 100MHz Pentium with (what I
think are 11ms) SCSI drives on an Adaptec 2940 controller. The
operating system is FreeBSD2.1. I'd always suspected that that
mcahine would have no problem keeping up with a feed....

To repeat what's going on: innd is disk-limited. That means that
disk I/O _always_ increases network latency. To a point, that
isn't a problem, especially with streaming. But, beyond that
point, there can be *huge* delays -- and those delays affect _all_
incoming feeds.

When I say "huge" I *mean* huge -- one of my statistics programs
has seen innd slow down to two articles per *minute*. It's disk
syncs that are the killer but even a few massively cross-posted
articles can result in lots of disk activity -- even if that
activity is in the cross-post daemon.

There are two lessons I've learned from this exercise. The first
is that the Unix file system, used naively, is a major bottleneck.
When I did stats earlier this year, it was taking nearly five
times the actual news volume's worth of disk access just to file
the news -- most of that spent in reading directory entries. At
some point, I hope to recode things to use smaller directories, by
filing articles using a nnnnnnn/nnn scheme rather than just
shoving all articles into one directory. This should have a
dramatic effect on disk throughput though, of course, only a live
test will prove it.

The second is that one cannot let disk transfers interfere with
network transfers. The processes that receive news need to do the
absolute minimum disk activity needed to "get the job done" --
and *not* wait on innd or anyone else to do it. Network latency,
once spent, is time _gone_ -- and it's one of the things that is
usually not under control of the news admin.

My current incoming daemon just accepts ihaves, checks for dups by
reading the active file, reads the article, acks the article and
then writes it to a batch.  That's all. It relies on the disk
cache to minimize history index lookup disk hits -- no dbzincore
here.  That has the side-effect of partially ameliorating the
msgidd lack; without buffering it gets whatever innd has recently
written.  (No hard stats here; when my system is fully up-to-date,
I'll see what I can get.)

The only problem with my current system is that it doesn't scale
all that well. The spool area probably has to be O(n) in the
number of newsfeeds; with no msgidd equivalent, you're gonna get
a lot of dups. Well, I'll see about writing one if it looks like
my dup stats are *too* horrible.


Technical Details
Message-ID: <4sc8e0$q8u@twwells.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

Show Full Headers
Complete Article Headers
Message-ID: <4sc8e0$q8u@twwells.com>
Subject: how to speed up innd
Date: Sun, 14 Jul 1996 00:00:00 +0000
From: bill@twwells.com (T. William Wells)
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: 168356942
Organization: None, Mt. Laurel, NJ
Newsgroups: news.software.nntp