🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by Tony Rentschler Thu, 15 Feb 2001 12:01
launching nnrpd
#50628
Author: Tony Rentschler
Date: Thu, 15 Feb 2001 12:01
26 lines
2151 bytes
I have a Sparc Solaris 2.6 reader machine running INN 2.2.2 that hosts
100-200 concurrent readers, most of whom are pulling news
programatically. This means the readers are generally "busy," and
connect and disconnect every few minutes.

Would it be more efficient to launch nnrpd from inetd rather than have
INN fork() to handle the readers? On the face of it, this looks more
efficient, but I don't know enough about Solaris 2.6 forking to know how
expensive it really is in this situation. The incoming feed, which INN
could receive on a port other than 119, is quite modest - less than 1 gb
per day.

Along the same lines, are there any advantages/disadvantages to
launching nnrpd from inetd as opposed to starting it up with the "-D"
option? From the man pages, I see that nnrpd -D requires a restart if
the configuration files are changed - a disadvantage, to my mind.

Thanks,
Tony

-- 
Tony Rentschler         Project Lead
The Associated Press    50 Rockefeller Plaza
New York, NY 10020      (212) 621-1985
trentschler@ap.org
Re: launching nnrpd
#50648
Author: Russ Allbery
Date: Thu, 15 Feb 2001 23:32
33 lines
2548 bytes
Tony Rentschler <walterr@bellatlantic.net> writes:

> I have a Sparc Solaris 2.6 reader machine running INN 2.2.2 that hosts
> 100-200 concurrent readers, most of whom are pulling news
> programatically. This means the readers are generally "busy," and
> connect and disconnect every few minutes.

> Would it be more efficient to launch nnrpd from inetd rather than have
> INN fork() to handle the readers?

Yes.  I recommend that configuration; I think it's cleaner for a whole
bunch of reasons.  (Note, however, that INN has some basic rate limiting
that it does in front of nnrpd that you lose unless your inetd-equivalent
can also do the same thing, if you care; I haven't cared so far.)

> Along the same lines, are there any advantages/disadvantages to
> launching nnrpd from inetd as opposed to starting it up with the "-D"
> option? From the man pages, I see that nnrpd -D requires a restart if
> the configuration files are changed - a disadvantage, to my mind.

I don't entirely trust nnrpd -D yet; it has some oddities.  I prefer to
use an inetd equivalent (I use tcpserver).  But that may just be me.  In
theory, it could be a bit quicker since the parent could set up the active
file and storage subsystem and whatnot and hand it off to the children
more quickly than them setting it all up themselves, but I'm not sure
that's the case.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Re: launching nnrpd
#50655
Author: Charlie Chatterbox
Date: Fri, 16 Feb 2001 06:22
8 lines
1682 bytes
:: I don't entirely trust nnrpd -D yet; it has some oddities.  I prefer to
:: use an inetd equivalent (I use tcpserver).  But that may just be me.  In

Hmmm, oddities?  Care to go into detail, apart from those already
known?  I'm using -D to start two of the three nnrpds on our play
swerver, and I see no more problems there than with the third one
that shouldn't do what it does but they all do anyway.
Re: launching nnrpd
#50659
Author: Sven Paulus
Date: Fri, 16 Feb 2001 13:27
51 lines
3338 bytes
Charlie Chatterbox <autocyberretributionmeowbot@pl0nk.invalid> wrote:
> :: I don't entirely trust nnrpd -D yet; it has some oddities.  I prefer to
> :: use an inetd equivalent (I use tcpserver).  But that may just be me.  In
> Hmmm, oddities?  Care to go into detail, apart from those already
> known?  I'm using -D to start two of the three nnrpds on our play
> swerver, and I see no more problems there than with the third one
> that shouldn't do what it does but they all do anyway.

There are some little problems, but I haven't found time recently
to produce patches:

        do {
            clen = sizeof(csa);
            fd = accept(lfd, (struct sockaddr *) &csa, &clen);
            if (fd < 0)
                continue;
 
            for (i = 0; (pid = fork()) < 0; i++) {
                if (i == MAX_FORKS) {
                    syslog(L_FATAL, "cant fork (dropping connection): %m");
>>                  continue;
                }
                syslog(L_NOTICE, "cant fork (waiting): %m");
                sleep(1);
            }
            if (pid != 0)
                close(fd);
        } while (pid != 0);

The marked line was a goto to the topmost line in the first version of -D.
That paragraph got changed to a do-{-}-while-construct, but this continue
has to continue the while-loop and not the for-loop (otherwise if forking
fails continuosly, the parent nnrpd would loop forever, even if the client
is gone away in the meantime). So, adding "&& (i<=MAX_FORKS)" might be a
good idea. It's nothing serious, but it's clearly wrong the way it is.

The second thing is, the signal handler for SIGHUP is set up after
forking the child process. So, if you want to be clever and set all the
child processes into trace-mode using "killall -HUP nnrpd", the parent
process dies. Maybe it should ignore SIGHUP or even to something clever
(rereading inn.conf, which might be easier for nnrpd than it is for innd).

I have some basic rate and connection limiting code ready for nnrpd, but
it needs some clean up and I have to adopt it to inn-current, since I wrote
it for 2.2. Maybe I'll find some spare time ...

Apart from this, I don't see any problems using nnrpd -D. It's stable and
it's fast (-> copy-on-write for the child processes).

Sven
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