🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #70872

[slrn] multi-connection slrnpull patch available

#70872
From: Jurriaan (note: this is a workin...
Date: Sat, 20 Jan 2001 08:23
152 lines
5790 bytes
I'm making a patch available at http://www.xs4all.nl/~thunder7
which will allow slrnpull to download multiple groups at the same
time. It will compile on any unix I know and using cygwin32, also
on win32 systems.

By releasing this patch, I invite people to test it. Use it at your own
risk. Please let me know how it works for you.

Thanks,
Jurriaan



Here is the readme:



RATIONALE
---------

If you have a slow link to your ISP, it seems a single connection to
your news-server cannot fully saturate the link.

I have a single ISDN link, 64 kBaud, and an optimal connection would get
something like 7.8 kilobytes/s. When fetching headers only, and there are
many new groups with small numbers of headers, I only get 5.5 kilobytes/s.
When fetching a number of large messages, I do get 7.8 kilobyte/s -
but that doesn't happen that often.


BASIC SETUP
-----------

The solution to this problem is simple: try to download a number of
groups in parallel.

The basic actions taken by slrnpull can be summarized like this:

1 - startup, read initialization data etc.
2 - pull news for each group
3 - write changes in active file etc.

step 2 can be run in parallel with this patch.


DETAILED SETUP
--------------

The patch uses only the calls fork() and wait(), and thus compiles cleanly
on any unix I can think of. It should also compile on cygwin32, so it
should still be possible to compile a windows executable. It probably
won't compile with 'standard' windows C compilers, but have a look at
http://go.to/suckmt for a similar program and look at the amount of extra
source needed to get something that compiles both on unix and on windows.

This is a minimalistic approach, which doesn't expand the source too much,
and sacrifices win32 compatibility (with some compilers) and memory to do
so. I don't know if fork() and wait() exist on VMS.

Step 2 creates a list of groups, then fetches articles for each in turn.

With the patch, each group gets a number (from 1 to the number of
processes).  Then slrnpull fork()'s itself and each sub-process processes
those groups whose numbers match it's own number. It then saves all the
changed information in the group and some speed statistics in temporary
files and exits. It uses more memory than needed, since each process gets
a list of all the groups in memory. It just won't use all of them.

The main program waits until all sub-processes are finished, collects
the information from files, and continues with step 3.


KNOWN BUGLETS
-------------

The groups are numbered they would be pulled without this patch,
so if you are unlucky and every third group is a large one, this patch
will fail. Either re-configure your slrnpull.conf, use another number
of processes and hope for better luck, just accept it or write a better
patch :-)
It would be more elegant to have a 'coordinator' process that would hand
out groups to whatever sub-process that was finished with its work, but
that would require a much larger patch - see http://go.to/suckmt for
an implementation like that.

The processes are not synchronized in any way with respect to each
other, so to prevent garbage on the screen, the continues update of the
baud rate etc. has been stopped. Each group is still displayed as it
is selected. It may happen that two processes try this at exactly the
right time and garbage is still displayed, but that won't influence the
operation of slrnpull.

Even with this patch, slrnpull won't post articles in multiple processes.
I find I post a lot less than I read, and while posting, I seem to use
the bandwidth I have. YMMV.

OPERATION
---------

There is one new parameter: -mt <number>, where number is a number
between 1 and the maximum number of fetching processes (default 5,
change it in slrnfeat.h if you feel like it).


RESULTS
-------

Some timings I took:

1 process   7'58
3 processes 5'49 (+36% speed)
5 processes 5'10 (+54% speed)

another run:

1 process   2'25 
2 processes 1'33 (+36% to speed)
3 processes 1'37 (+33%)
4 processes 1'24 (+42%)
5 processes 1'25 (+41%)
6 processes 1'23 (+43%)
7 processes 1'25 (+41%)
8 processes 1'23 (+43%)
9 processes 1'34 (+35%)

If you use too much threads, I don't imagine you'll win as much, and
you might arouse the anger the BOFH on the other end. YMMV.


INSTALLATION
------------

To install, apply the patch and set SLRN_HAS_MULTI_THREAD_PULL to 1
in slrnfeat.h.  Then recompile.


QUESTIONS, COMMENTS, RANDOM RHETORIC
------------------------------------

email me: thunder7@xs4all.nl

I also read news.software.readers on usenet (using slrn, of course).



-- 
BOFH excuse #414:

tachyon emissions overloading the system
GNU/Linux 2.2.19pre7 SMP 2x1402 bogomips load av: 0.00 0.00 0.00
Technical Details
Message-ID: <slrn96iiad.e73._hate_spam_thunder7@middle.of.nowhere>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeeds.belnet.be!news.belnet.be!transit.news.xs4all.nl!no_spam_here

Show Full Headers
Complete Article Headers
Message-ID: <slrn96iiad.e73._hate_spam_thunder7@middle.of.nowhere>
Subject: [slrn] multi-connection slrnpull patch available
Date: Sat, 20 Jan 2001 08:23:31 +0000
From: no_spam_here@rivierenland.xs4all.nl (Jurriaan (note: this is a working address!))
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!supernews.google.com!sn-xit-02!supernews.com!isdnet!newsfeeds.belnet.be!news.belnet.be!transit.news.xs4all.nl!no_spam_here
Newsgroups: news.software.readers
Organization: XS4ALL Internet BV
Lines: 151
NNTP-Posting-Host: rivierenland.xs4all.nl
X-Trace: news1.xs4all.nl 979979011 15061 194.109.14.47 (20 Jan 2001 08:23:31 GMT)
X-Complaints-To: abuse@xs4all.nl
NNTP-Posting-Date: 20 Jan 2001 08:23:31 GMT
User-Agent: slrn/0.9.6.3 (GNU/Linux)