🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
1 messages
1 total messages Started by Curt Welch Sun, 02 Nov 1997 00:00
Re: INN / nnrpd process
#22857
Author: 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/

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