🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #12153

Re: INN 1.5b1: stable enough for a production system?

#12153
From: Richard Michael Todd
Date: Thu, 07 Nov 1996 00:00
64 lines
3117 bytes
>On 6 Nov 1996 19:56:05 -0500, Alec H. Peterson <chuckie@panix.com> wrote:
> : 1) For some reason, innd seems to love to hammer the hell out of the
> :    newslib disk.  My guess is that the buffering for the history file
> :    is not working properly, although it could be something else.

>I also see this, on FreeBSD2.1.5R, also not running mmap.  It's not so
>bad that I've backed off 1.5b1 but there does seem to be an inordinate
>amount of activity on newslib's fs

Ah.  This is, indeed, a bug in INN1.5b1 that I've already reported to James 
Brister.  Lemme see if I can dig up the mail message...

To: inn-bugs@isc.org
Subject: Bug in main loop code (innd/chan.c)
Date: Fri, 25 Oct 1996 01:13:44 -0500

Observe the code in chan.c, around line 802, that looks like this:
        if (Now.time > LastUpdate + 60) {
            HISsync();
            if (ICDactivedirty) {
                ICDwriteactive();
                ICDactivedirty = 0;
            }
        }

This code is supposed to flush the active file and history db every minute or
so.  However, LastUpdate is only set once, at the beginning of CHANreadloop.
So every time through the select loop after the first minute innd is up and
functioning Now.time is > LastUpdate+60 and the active file is written. As
I read this ktrace data, on one news server I run this works out to 264 
active file writes in a 3 minute period, or over one active file write/second.
I think that's a tad excessive. :-)

Anyway, here's the obvious patch (reset LastActive after the write).  I also
went ahead and changed the interval from 60 to Timeout.tv_sec, that being
the interval the active file gets written out at when little activity is 
going on and select() actually gets to timeout.  You may want to keep the 
interval at 60, that's up to you.

Index: chan.c
===================================================================
RCS file: /ecn/src0/communications/INN-CVS-Repository/inn/innd/chan.c,v
retrieving revision 1.2
diff -u -r1.2 chan.c
--- chan.c	1996/10/21 20:40:53	1.2
+++ chan.c	1996/10/25 05:41:38
@@ -799,12 +799,13 @@
 	/* Update the "reasonably accurate" time. */
 	if (GetTimeInfo(&Now) < 0)
 	    syslog(L_ERROR, "%s cant gettimeinfo %m", LogName);
-	if (Now.time > LastUpdate + 60) {
+	if (Now.time > LastUpdate + TimeOut.tv_sec) {
 	    HISsync();
 	    if (ICDactivedirty) {
 		ICDwriteactive();
 		ICDactivedirty = 0;
 	    }
+	    LastUpdate = Now.time;
 	}
 
 	if (count == 0) {

Technical Details
Message-ID: <55tn2a$dn7$1@independence.ecn.ou.edu>
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: <55l30f$d04@papaioea.manawatu.gen.nz>

Show Full Headers
Complete Article Headers
Message-ID: <55tn2a$dn7$1@independence.ecn.ou.edu>
Subject: Re: INN 1.5b1: stable enough for a production system?
Date: Thu, 07 Nov 1996 00:00:00 +0000
From: rmtodd@mailhost.ecn.uoknor.edu (Richard Michael Todd)
References: <55l30f$d04@papaioea.manawatu.gen.nz>
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: 195148118
Organization: Z'Ha'Dum Tours, Inc.
Newsgroups: news.software.nntp