🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #22857

Re: INN / nnrpd process

#22857
From: Curt Welch
Date: Sun, 02 Nov 1997 00:00
86 lines
3797 bytes
jemurray@concentric.net (Jason E. Murray) wrote:
> I have a question about what happens when you connect to a
> news server (specifically what nnrpd is doing when you connect).

> Does any one know of any document that would tell me exactally
> what nnrpd does when it receives a connection.

The source is always the best place.  In this case, inn/nnrpd/group.c

> I am trying to figure out why the below is taking so long on my
> news server:

> chdir("news/software/readers")                  = 0
> open(".", O_RDONLY|O_NDELAY)                    = 7
> fcntl(7, F_SETFD, 0x00000001)                   = 0
> fstat(7, 0xEFFFD4F8)                            = 0

> chdir("/var/spool/news")                        = 0

> getdents(7, 0x00046890, 1048)                   = 700
> getdents(7, 0x00046890, 1048)                   = 708
> getdents(7, 0x00046890, 1048)                   = 704
> getdents(7, 0x00046890, 1048)                   = 384
> getdents(7, 0x00046890, 1048)                   = 0
> close(7)                                        = 0
> write(1, " 2 1 1   1 5 3   4 8 4 7".., 43)      = 43
> time()                                          = 878446022

from group.c, parts of the function GRPscandir():

/*
**  Fill in ARTnumbers with the numbers of the articles in the current
**  group.
*/
STATIC void
GRPscandir(dir)

...
    if (chdir(dir) < 0)
        return;
    dp = opendir(".");
    if (dp == NULL) {
        syslog(L_ERROR, "%s cant opendir %s %m", ClientHost, dir);
        return;
    }

    while ((ep = readdir(dp)) != NULL) {

...


All it's doing is reading the directory to get the file names
so it will know which articles are there and which aren't.  The
write() is just producing the answer to a "GROUP" command
which tells the newsreader the min and max article numbers
as well as an accurate count of the total articles in the goroup.

> it does this for each group that a a person is subscribed to,

That's because the newsreader is issuing a GROUP command for every group.
That's common behavior.

> the
> getdents() take about 1 second a piece and for some groups it does this
> upto 20-30 times. If you are subscribed to a bunch of groups it will
> sometimes take about 5-10 minutes to perform the above process (this is
> annoying).

My server can do a group command on 30 groups in about 3 seconds.

> Any ideas, suggestions, and/or comments are welcome...  If you would like
> anymore info just let me know...  Thanks.

It sounds like you have a very slow filesytems for some reason.  Why, I
don't know.  Maybe some system params are set wrong?  Maybe you don't
have enough memory for caching disk I/O?  Is the spool NFS mounted over
a slow network?  Or is your server just overloaded?

Does it take a long time to do an ls -f on those directories as well?

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

Technical Details
Message-ID: <19971102010954.876$5z@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: <slrn65o27h.5oi.jemurray@eternity.concentric.net>

Show Full Headers
Complete Article Headers
Message-ID: <19971102010954.876$5z@newsreader.com>
Subject: Re: INN / nnrpd process
Date: Sun, 02 Nov 1997 00:00:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <slrn65o27h.5oi.jemurray@eternity.concentric.net>
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: 286539706
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: KCW Consulting
X-Url: http://CurtWelch.Com/
Newsgroups: news.software.nntp