🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
18 messages
18 total messages Started by Mark Hittinger Thu, 04 Sep 1997 00:00
Re: NNRPD resource consumption
#21265
Author: Mark Hittinger
Date: Thu, 04 Sep 1997 00:00
51 lines
2796 bytes

kwl@shell.monmouth.com (Ken Leland) writes:
>                                 At night, during peak, I can have
>10 to 15 of them going full tilt out of 100 readers. System time
>is at 50+percent when this is going on. Idle at 0.
>...
>                                I've always had new nnrpds eatup some 
>extra resources but never anywhere near this much. This seems to have 
>started after I added some more memory recently (from 256 to 512M). 
>...
>Any thoughts on what should I check next?

So you doubled your ram and those nnrpd's (suck feeds) are not quite as
i/o bound as they used to be eh?  They probably didn't show up on top before
waiting on their reads :-)

When we tuned up our I/O subsystems here we saw major problems with cycle
consumption by suck feed connected nnrpds.  They can easily swamp your
processor(s).  Tricks like pre-created active hash (or actived), sorted
mmap'ed overview files, and shared active files don't help.  In fact,
in can make it worse!

You might want to do some experiments like so:  Get a copy of top and watch
those bad boys (maybe even toggle your tracing on to see their suck commands).

Measure your average nnrpd process run-down cpu time consumption.  You may
find that a typical nnrpd will exit with less than 20 seconds of processor
consumed.  You may discover that any nnrpd that consumes more than 20 seconds
of cycles is probably a suck feed.

When they get beyond a certain level renice them down below your typical
NICE_KIDS.  You can try this manually at first just to get a flavor of what
I'm talking about.  The idle time won't come back but your news server(s) might
provide a little more fairness to the real human point-and-clickers.

With a hot i/o subsystem and good network connectivity the suck feeds will
take all the cycles (and other resources) that you permit them to.  They
will try to consume any resources freed up by whatever optimizations you
care to make :-)  Thats why I said it could get worse :-)

Just something to mull over :-)  And I don't want to restart the anti-suck
debate BTW. :-)

Regards,

Mark Hittinger
Netcom/Dallas
bugs@freebsd.netcom.com

Re: NNRPD resource consumption
#21273
Author: Tim Russell
Date: Fri, 05 Sep 1997 00:00
51 lines
2902 bytes
kwl@shell.monmouth.com (Ken Leland) writes:

>I initially thought I had dedicated (T1) customer(s) doing a job on me,
>but it wasn't the case. These nnrpd cpu eaters are normal 33.6 dialups,
>and they are usually in XOVER. 

>Will definitely put this solution in my bag of tricks for the next
>class of nuisance though.

    On looking through the NNRPD code recently to see just what the hell
was going on, I noticed the following:

      1) Joe User is a news freak.  He checks like every 10 minutes for
         new articles.

      2) Joe fires up an XOVER on a group that has, say, 37,000 articles
         in it.  The XOVER request, however, is only for, say, the last
         four articles, which are new to him.

      3) NNRPD satisfies this request by opening the .overview file, which
         is, say, 8M in size, and proceeding to read through the entire
         file until it gets to the record number it needs, then it spits
         out records.

    So basically, every time someone enters a group with an 8M overview file,
the effect is that of reading through said file locally on the system.
Needless to say, get 30 or so of these going, and you have one seriously
disk-bound system.

    If your expireover keeps blowing off, as mine does, due to lack of memory,
since that program reads the entire damn .overview file it's working on into
a memory database, so much the worse.  More stuff for the NNRPD's to read
through.

    I think that work /really really/ needs to be done on making the .overview
files an actual database rather than just a text file.  That's where the big
huge performance hit is.

    It could help a lot to simply keep another file of 32-bit integers that
point to the start of .overview lines.  That file could be accessed by
lseek()ing to the appropriate integer for the line one wants, and using the
number returned for an lseek() on the .overview file.

--
Tim Russell      System Admin, Probe Technology      email: russell@probe.net
            PGP RSA: C992 109C 6D7F 8D91 062E 817E 00D3 287A
   "The worst censorship is self-censorship, because fear has no limits."
                                               -- Grady Ward

Re: NNRPD resource consumption
#21281
Author: coneill
Date: Fri, 05 Sep 1997 00:00
63 lines
3770 bytes

russell@probe.net (Tim Russell) writes:
>     On looking through the NNRPD code recently to see just what the hell
> was going on, I noticed the following:
> 
>       1) Joe User is a news freak.  He checks like every 10 minutes for
>          new articles.
> 
>       2) Joe fires up an XOVER on a group that has, say, 37,000 articles
>          in it.  The XOVER request, however, is only for, say, the last
>          four articles, which are new to him.
> 
>       3) NNRPD satisfies this request by opening the .overview file, which
>          is, say, 8M in size, and proceeding to read through the entire
>          file until it gets to the record number it needs, then it spits
>          out records.
> 
>     So basically, every time someone enters a group with an 8M overview file,
> the effect is that of reading through said file locally on the system.
> Needless to say, get 30 or so of these going, and you have one seriously
> disk-bound system.
> 
>     If your expireover keeps blowing off, as mine does, due to lack of memory,
> since that program reads the entire damn .overview file it's working on into
> a memory database, so much the worse.  More stuff for the NNRPD's to read
> through.
> 
>     I think that work /really really/ needs to be done on making the .overview
> files an actual database rather than just a text file.  That's where the big
> huge performance hit is.
> 
>     It could help a lot to simply keep another file of 32-bit integers that
> point to the start of .overview lines.  That file could be accessed by
> lseek()ing to the appropriate integer for the line one wants, and using the
> number returned for an lseek() on the .overview file.

I'm hoping to integrate this into 1.6/1.7

Overview Indices
 - Adds a flat binaries index that as stored in the same directory as the
   overview text file, but in another file.  The index stores the article
   number along with the offset that the overview record starts at.
 - NNRPD reads the index into memory when overview is opened as uses the
   index to locate articles in the overview text file instead of linear
   searching.
 - We instrumented NNRPD to report the amount of overview data read from
   disk compared to what was actually sent to the client.  We were seeing
   about 50% more overview data read per day than article data, even though
   only sent about 10% of the overview data to the client.  With indices,
   the overhead to search overhead to reduced to about 10% as opposed to an
   order of magnitude.

I haven't seen anyone suggest structure for overview that's better than this.

Anyone have ideas on how to improve on the above?  I've thought about a CNFS
style mechanism, but I think we gain a lot currently by having the
records (at least logically) sequential.  I also think we need to
rewrite expireover so that it doesn't bother to sort the overview
entries anymore.  If we do that then we can eliminate the memory
footprint and cpu overhead of expireover.

Re: NNRPD resource consumption
#21288
Author: Christopher Sedore
Date: Fri, 05 Sep 1997 00:00
78 lines
4261 bytes

[...]
>Overview Indices
> - Adds a flat binaries index that as stored in the same directory as
the
>  overview text file, but in another file.  The index stores the
article
>   number along with the offset that the overview record starts at.
> - NNRPD reads the index into memory when overview is opened as uses
the
>  index to locate articles in the overview text file instead of linear
>  searching.
> - We instrumented NNRPD to report the amount of overview data read
from
>   disk compared to what was actually sent to the client.  We were
seeing
>   about 50% more overview data read per day than article data, even
though
>   only sent about 10% of the overview data to the client.  With
indices,
>   the overhead to search overhead to reduced to about 10% as opposed
to an
>  order of magnitude.
>
>I haven't seen anyone suggest structure for overview that's better than
this.
>
>Anyone have ideas on how to improve on the above?  I've thought about a
CNFS
>style mechanism, but I think we gain a lot currently by having the
>records (at least logically) sequential.  I also think we need to
>rewrite expireover so that it doesn't bother to sort the overview
>entries anymore.  If we do that then we can eliminate the memory
>footprint and cpu overhead of expireover.

I've implemented a CNFS style mechanism in my own reader code, and am
now working on enhancing it with caching.  My methodology involves
storing a pointer to the overview data (minus article number) in the
history.  To track groups, I have a database that tracks the articles in
each group and maintains pointers into the history db.

It works quite well and scales better than the overview file methodology
currently used (I've only tested it up to 33,000 articles, though :).
You do lose a lot by skipping through the the history, though not as
much as I had originally thought.  One of the advantages I like is that
it will return overview data up to the instant it finishes working
through the database (including new inserts and cancel processing)--no
rebuilds or expires are necessary.

I'm thinking now of doing a cyclical cache for the overview data.  It
would almost turn out to work like a cyclical LFS as I have it designed
now.  This would give the best of all worlds: complete cyclical
operation, instant article addition, and better reading since overview
data will be grouped together in the file.  Plus, you could really
"cache" instead of keeping all the data for all groups allowing on the
fly generation with caching for the next request for the same data.

I'm planning on doing what I think of as a "page based" cache.  In my
group database, each db page (maybe better said "bucket") tracks 30
articles.  I'm going to add an offset into the cache for each page.
This will give me within 30 article accuracy without having to store a
pointer per article (which makes db caching harder because of the added
storage of a 4 byte int per article).

I'm curious if people have some stats on overview vs article storage
requirements.  My measurements so have been imprecise and are a little
off of what INN does because I only write one copy of the overview
regardless of crossposts at this point.  I'm just concerned about
whether there is any reason to allow for >32bit offsets into overview
data (my max storage size presently is 1TB per store at 32 stores max.
Each store has its own overview data store, though).

-Chris



Re: NNRPD resource consumption
#21292
Author: Matt Dillon
Date: Fri, 05 Sep 1997 00:00
36 lines
2029 bytes
:In article <5uo3j0$fah@dfw-ixnews1.ix.netcom.com>,
:Mark Hittinger <bugs@freebsd.netcom.com> wrote:
:>kwl@shell.monmouth.com (Ken Leland) writes:
:>>                                 At night, during peak, I can have
:>>10 to 15 of them going full tilt out of 100 readers. System time
:>>is at 50+percent when this is going on. Idle at 0.
:>>...
:>>                                I've always had new nnrpds eatup some 
:>>extra resources but never anywhere near this much. This seems to have 
:>>started after I added some more memory recently (from 256 to 512M). 
:>>...
:>>Any thoughts on what should I check next?
:>
:>So you doubled your ram and those nnrpd's (suck feeds) are not quite as
:>i/o bound as they used to be eh?  They probably didn't show up on top before
:>waiting on their reads :-)
:>
:>When we tuned up our I/O subsystems here we saw major problems with cycle
:>consumption by suck feed connected nnrpds.  They can easily swamp your
:>processor(s).  Tricks like pre-created active hash (or actived), sorted
:>mmap'ed overview files, and shared active files don't help.  In fact,
:>in can make it worse!

    Ah, easy solution:  Hack nnrpd to set the SO_SNDBUF socket option to
    something small like 2K.  This should reduce the impact of suck-feeds
    over fast network links.

						-Matt

:>Mark Hittinger
:>Netcom/Dallas
:>bugs@freebsd.netcom.com


Re: NNRPD resource consumption
#21293
Author: Ken Leland
Date: Fri, 05 Sep 1997 00:00
59 lines
2973 bytes

In article <5upqc7$6tf$1@jake.probe.net>,
Tim Russell <russell@probe.net> wrote:
>
>kwl@shell.monmouth.com (Ken Leland) writes:
>
>>I initially thought I had dedicated (T1) customer(s) doing a job on me,
>>but it wasn't the case. These nnrpd cpu eaters are normal 33.6 dialups,
>>and they are usually in XOVER. 
>
>    On looking through the NNRPD code recently to see just what the hell
>was going on, I noticed the following:
>
>      1) Joe User is a news freak.  He checks like every 10 minutes for
>         new articles.

Lets add to this hypothesis that Joe likes to download the finer articles
in the alt.binaries.pictures.erotica.* newsgroups. 
(my news logs indicate this would indeed be an an average Joe).

And presumably he does not want to miss the latest ones in the group of 
his choosing, as he waits breathlessly for the next one to arrive.

It turns out that because articles in these groups are often (usually) 
*heavily* crossposted a .overview file for many of these can easily be 
4Megs long on only 3 days worth of articles.

>
>      2) Joe fires up an XOVER on a group that has, say, 37,000 articles
>         in it.  The XOVER request, however, is only for, say, the last
>         four articles, which are new to him.
>
>      3) NNRPD satisfies this request by opening the .overview file, which
>         is, say, 8M in size, and proceeding to read through the entire
>         file until it gets to the record number it needs, then it spits
>         out records.

Ouch, I can hear my overview disk screaming right now.

>    So basically, every time someone enters a group with an 8M overview file,
>the effect is that of reading through said file locally on the system.
>Needless to say, get 30 or so of these going, and you have one seriously
>disk-bound system.

OK, This is sounding very much like my situation. I wonder if there are
any new readers out there that automates this terrible process of checking
every minute for the latest incoming article. Or perhaps the suggestion
Mark made is valid that having removed other bottlenecks the overview
system now has the capacity of eating my cpu.

Time to get the overview speedup patches and see how they help.

Just another day in the news dungeon.

Ken Leland
Monmouth Internet

Re: NNRPD resource consumption
#21294
Author: Ron Echeverri
Date: Fri, 05 Sep 1997 00:00
17 lines
1166 bytes

In article <5upijp$2oi@shell.monmouth.com>,
Ken Leland <kwl@shell.monmouth.com> wrote:
[to matt dillon]
>Noted your wire-pulling response to the /dev/null thread. Am trying to
>figure out does news make you strange or do only strange people do news.

Yes.

rone
-- 
Ron Echeverri		<URL:http://www.ennui.org/~rone/>	<rone@best.net>
Systems/Usenet Administration			  "This is _my_ ISP, _i_ do the
Best Internet Communications, Inc.	     ass-kicking around here!" -rpwhite

Re: NNRPD resource consumption
#21299
Author: Ken Leland
Date: Fri, 05 Sep 1997 00:00
55 lines
2670 bytes

In article <5uo3j0$fah@dfw-ixnews1.ix.netcom.com>,
Mark Hittinger <bugs@freebsd.netcom.com> wrote:

>
>So you doubled your ram and those nnrpd's (suck feeds) are not quite as
>i/o bound as they used to be eh?  They probably didn't show up on top before
>waiting on their reads :-)
>

Looking real likely. Every improvement is rewarded with another 
challenge. Thats why I love it so.

>consumed.  You may discover that any nnrpd that consumes more than 20 seconds
>of cycles is probably a suck feed.

I definitely have two distinct classes of nnrpd cpu useage as you point out.
When I check the heavies by pid with ps, they seem to typically be in XOVER.
That is why I had checked my overview permissions and ownerships before.

Is this typical of readers that suck?  What are suck signature
commands / command sequences?  Its as though they were searching
the entire spool for an article subject with a magic phrase in it.
(no thats not a feature suggestion to reader developers)

If they were just pulling articles, one after the next (at dialup speeds), 
I don't think they would be nearly so harmful as what I am seeing.

We don't have a new reader out there that does "newnews" by alternate
means could we?

>When they get beyond a certain level renice them down below your typical
>NICE_KIDS.  You can try this manually at first just to get a flavor of what
>I'm talking about. The idle time won't come back but your news server(s) might
>provide a little more fairness to the real human point-and-clickers.

It may be time for a DEAD_KIDS parameter. 

Or, more difficult for suckmeisters to work around: logging followed by 
warn and shoot (the personal touch).

My concern is that even if they are sufficiently reniced, they will still
commit zillions of disk seeks that get in the way of basic function,
like taking on new articles.

>Just something to mull over :-)  And I don't want to restart the anti-suck
>debate BTW. :-)

Not much of a debate here :)  Thanks for your help.

Ken Leland
Monmouth Internet

Re: NNRPD resource consumption
#21301
Author: Ken Leland
Date: Fri, 05 Sep 1997 00:00
39 lines
2275 bytes
In article <5uphmp$86q$1@flea.best.net>, Matt Dillon <dillon@best.net> wrote:
>:In article <5uo3j0$fah@dfw-ixnews1.ix.netcom.com>,
>:Mark Hittinger <bugs@freebsd.netcom.com> wrote:
>:>kwl@shell.monmouth.com (Ken Leland) writes:
>:>>                                 At night, during peak, I can have
>:>>10 to 15 of them going full tilt out of 100 readers. System time
>:>>is at 50+percent when this is going on. Idle at 0.
>:>>...
>:>So you doubled your ram and those nnrpd's (suck feeds) are not quite as
>:>i/o bound as they used to be eh?  They probably didn't show up on top before
>:>waiting on their reads :-)
>:>
>:>When we tuned up our I/O subsystems here we saw major problems with cycle
>:>consumption by suck feed connected nnrpds.  They can easily swamp your
>:>processor(s).  Tricks like pre-created active hash (or actived), sorted
>:>mmap'ed overview files, and shared active files don't help.  In fact,
>:>in can make it worse!
>
>    Ah, easy solution:  Hack nnrpd to set the SO_SNDBUF socket option to
>    something small like 2K.  This should reduce the impact of suck-feeds
>    over fast network links.
>

I initially thought I had dedicated (T1) customer(s) doing a job on me,
but it wasn't the case. These nnrpd cpu eaters are normal 33.6 dialups,
and they are usually in XOVER. 

Will definitely put this solution in my bag of tricks for the next
class of nuisance though.

Noted your wire-pulling response to the /dev/null thread. Am trying to
figure out does news make you strange or do only strange people do news.
Have tentatively concluded the former.

Ken Leland
Monmouth Internet

Re: NNRPD resource consumption
#21302
Author: coneill
Date: Fri, 05 Sep 1997 00:00
15 lines
1278 bytes

dillon@best.net (Matt Dillon) writes:
>     Ah, easy solution:  Hack nnrpd to set the SO_SNDBUF socket option to
>     something small like 2K.  This should reduce the impact of suck-feeds
>     over fast network links.

It also means that your nnrpd are going to take more context
switches. The way we've done it here is that we've modified the
overview code so that it's not cpu bound anymore and that we can
actually stream overview records to the client, filling their TCP
window.  We intentionally set the window size to 32k so that the
process sleeps while the kernel handles emptying the buffers.

Re: NNRPD resource consumption
#21358
Author: Joe Greco
Date: Mon, 08 Sep 1997 00:00
63 lines
3269 bytes

In news.software.nntp article <5uq11i$j3e@shell.monmouth.com>, kwl@shell.monmouth.com (Ken Leland) wrote:
:In article <5upqc7$6tf$1@jake.probe.net>,
:Tim Russell <russell@probe.net> wrote:
:>
:>kwl@shell.monmouth.com (Ken Leland) writes:
:>
:>>I initially thought I had dedicated (T1) customer(s) doing a job on me,
:>>but it wasn't the case. These nnrpd cpu eaters are normal 33.6 dialups,
:>>and they are usually in XOVER. 
:>
:>    On looking through the NNRPD code recently to see just what the hell
:>was going on, I noticed the following:
:>
:>      1) Joe User is a news freak.  He checks like every 10 minutes for
:>         new articles.
:
:Lets add to this hypothesis that Joe likes to download the finer articles
:in the alt.binaries.pictures.erotica.* newsgroups. 
:(my news logs indicate this would indeed be an an average Joe).
:
:And presumably he does not want to miss the latest ones in the group of 
:his choosing, as he waits breathlessly for the next one to arrive.
:
:It turns out that because articles in these groups are often (usually) 
:*heavily* crossposted a .overview file for many of these can easily be 
:4Megs long on only 3 days worth of articles.
:
:>
:>      2) Joe fires up an XOVER on a group that has, say, 37,000 articles
:>         in it.  The XOVER request, however, is only for, say, the last
:>         four articles, which are new to him.
:>
:>      3) NNRPD satisfies this request by opening the .overview file, which
:>         is, say, 8M in size, and proceeding to read through the entire
:>         file until it gets to the record number it needs, then it spits
:>         out records.
:
:Ouch, I can hear my overview disk screaming right now.

What you could _try_ is using my overviews patch that does an MMAP
of the .overview file (http://www.nntp.sol.net/patches/nov.mmap.patch)

You should compile with -DNOV_MMAP.  You can try compiling with
-DNOV_UNORDERED too.

This has the DOWNside of reading the entire .overview file when you
execute a GROUP command.  However, once read, the file is mmap'd and
a list of pointers is generated, so that further accesses are fast.

In particular, this technique does NOT suffer horribly like the normal
NOV implementation, if you should choose to do something strange like
scan backwards through your NOV data.

In general, things seem better here with this patch.

Oh - one side note.  The apparent size of your nnrpd processes will
grow, due to the mmap'ing.  That should not be a real problem though.

... JG

Re: NNRPD resource consumption
#21362
Author: Forrest J. Cavalier III
Date: Mon, 08 Sep 1997 00:00
27 lines
1661 bytes

In article <86iuwfv14m.fsf@blah.erols.com>, coneill@blah.erols.com wrote...

[snip of description of two-level overview indexes]

>I haven't seen anyone suggest structure for overview that's better than this.
>

Maybe not more efficient, (and I don't have code) but if you split the
current .overviews into blocks of 100 messages  (e.g. .over100-199  
.over200-299) then you might be able to do away with the second level index 
file and still reap most of the benefits.

>Anyone have ideas on how to improve on the above?  I've thought about a CNFS
>style mechanism, but I think we gain a lot currently by having the
>records (at least logically) sequential.  I also think we need to
>rewrite expireover so that it doesn't bother to sort the overview
>entries anymore.  If we do that then we can eliminate the memory
>footprint and cpu overhead of expireover.

...And expireover could just delete files.

Forrest


Re: NNRPD resource consumption
#21372
Author: Ken Leland
Date: Mon, 08 Sep 1997 00:00
42 lines
2369 bytes
In article <5v12u9$qhd$1@earth.execpc.com>,
Joe (certainly not an average one) Greco <jgreco@ns.sol.net> wrote:
>:>kwl@shell.monmouth.com (Ken Leland) writes:
>:
>:Lets add to this hypothesis that Joe likes to download the finer articles
>:in the alt.binaries.pictures.erotica.* newsgroups. 
>:(my news logs indicate this would indeed be an an average Joe).
>:
>:It turns out that because articles in these groups are often (usually) 
>:*heavily* crossposted a .overview file for many of these can easily be 
>:4Megs long on only 3 days worth of articles.
>:
>
>What you could _try_ is using my overviews patch that does an MMAP
>of the .overview file (http://www.nntp.sol.net/patches/nov.mmap.patch)

Thanks! I think I found my way out of the woods again this weekend
but I will begin investigating your overview patch for our future needs
(this stuff never seems to get better).

What had happened to my news server was that I had not correctly
specified all of the *jobs* instances in my expire.ctl file. - Which
meant that I had 1-2 weeks of alt/jobs, us/jobs, misc/jobs... etc.

So, It turns out that the readers that were going into CPU overload
were spawned by those people who were looking for new work.

Paring them down to 1 day, made things, as they say, mmmmm much better.
Monster nnrpd cpu sessions have disappeared for now.

And as a modest side benefit, my average per article ARTwrite has
dropped down to 30-40msec from 50-60 msec. 

So for the time being, customers are happy, idle time is way up, and
the sun is shining. Who knows how many more dead bodies (performance-wise)
are buried in my news system. Only the shadow knows.

Ken Leland
Monmouth Internet

Re: NNRPD resource consumption
#21391
Author: Darrell Fuhriman
Date: Tue, 09 Sep 1997 00:00
29 lines
1900 bytes

coneill@blah.erols.com writes:

> Overview Indices
>  - Adds a flat binaries index that as stored in the same directory as the
>    overview text file, but in another file.  The index stores the article
>    number along with the offset that the overview record starts at.

I had contemplated putting Berkeley DB in nnrpd... even did some
work to that effect but I've not finished it.  That should
provide the ability to do everything you've suggested and require
less implementation costs.

> I haven't seen anyone suggest structure for overview that's better than this.

> Anyone have ideas on how to improve on the above?  I've thought about a CNFS
> style mechanism, but I think we gain a lot currently by having the
> records (at least logically) sequential.  I also think we need to
> rewrite expireover so that it doesn't bother to sort the overview
> entries anymore.  If we do that then we can eliminate the memory
> footprint and cpu overhead of expireover.

Same benefit from using DB.  Avi came up with an idea for a
cyclic overview that was quite clever.. you should bug him about
it.


Re: NNRPD resource consumption
#21404
Author: coneill
Date: Tue, 09 Sep 1997 00:00
35 lines
2305 bytes

Darrell Fuhriman <darrell@grumblesmurf.net> writes:
> coneill@blah.erols.com writes:
> > Overview Indices
> >  - Adds a flat binaries index that as stored in the same directory as the
> >    overview text file, but in another file.  The index stores the article
> >    number along with the offset that the overview record starts at.
> 
> I had contemplated putting Berkeley DB in nnrpd... even did some
> work to that effect but I've not finished it.  That should
> provide the ability to do everything you've suggested and require
> less implementation costs.

The problem is that Berkeley DB always checks for existance, giving
you a increasing insert time proportional to the size of the db.  At
least that was true with 1.86, I haven't done any performance testing
with 2.x

> > Anyone have ideas on how to improve on the above?  I've thought about a CNFS
> > style mechanism, but I think we gain a lot currently by having the
> > records (at least logically) sequential.  I also think we need to
> > rewrite expireover so that it doesn't bother to sort the overview
> > entries anymore.  If we do that then we can eliminate the memory
> > footprint and cpu overhead of expireover.
> 
> Same benefit from using DB.  Avi came up with an idea for a
> cyclic overview that was quite clever.. you should bug him about
> it.

The problem I've always seen with cyclic overview is that it seems
like you'd have a problem keeping overview from expiring faster than
the articles w/o careful balancing.

Re: NNRPD resource consumption
#21578
Author: Rahul Dhesi
Date: Tue, 16 Sep 1997 00:00
14 lines
1189 bytes
In <5vmdsa$4pt$1@news0.xs4all.nl> johnpc@xs4all.nl (Jan-Pieter Cornet) writes:

>My patches, instead, simple mmap the file and then perform a binary
>search on the overview file to search the correct record.

Note that a binary search can be done with seeks, without doing mmap.
This might save you some memory.

(The standard perl module look.pl implements the algorithm.)
-- 
Rahul Dhesi <dhesi@spams.r.us.com>

Re: NNRPD resource consumption
#21594
Author: Jan-Pieter Cornet
Date: Tue, 16 Sep 1997 00:00
67 lines
3687 bytes
In article <5v12u9$qhd$1@earth.execpc.com>,
Joe Greco <jgreco@ns.sol.net> wrote:
>In news.software.nntp article <5uq11i$j3e@shell.monmouth.com>, kwl@shell.monmouth.com (Ken Leland) wrote:
>:In article <5upqc7$6tf$1@jake.probe.net>,
>:Tim Russell <russell@probe.net> wrote:
>:>
>:>      2) Joe fires up an XOVER on a group that has, say, 37,000 articles
>:>         in it.  The XOVER request, however, is only for, say, the last
>:>         four articles, which are new to him.
>:>
>:>      3) NNRPD satisfies this request by opening the .overview file, which
>:>         is, say, 8M in size, and proceeding to read through the entire
>:>         file until it gets to the record number it needs, then it spits
>:>         out records.
>:
>:Ouch, I can hear my overview disk screaming right now.
>
>What you could _try_ is using my overviews patch that does an MMAP
>of the .overview file (http://www.nntp.sol.net/patches/nov.mmap.patch)

I've also made patches that mmap the .overview files, available from
http://www.xs4all.nl/~johnpc/inn/ .

>This has the DOWNside of reading the entire .overview file when you
>execute a GROUP command.  However, once read, the file is mmap'd and
>a list of pointers is generated, so that further accesses are fast.

My patches, instead, simple mmap the file and then perform a binary search
on the overview file to search the correct record. This has the advantage
of not having to scan through the entire file (and because the search
is skewed, usually only reads a small percentage). Lookups in increasing
order, as XOVER usually does, are especially fast.

>In particular, this technique does NOT suffer horribly like the normal
>NOV implementation, if you should choose to do something strange like
>scan backwards through your NOV data.

My patches would do a binary search every time, although it only needs
a very few iterations, as the position of the last match is used as the
first search.

>In general, things seem better here with this patch.

Likewise. We had a newsserver that was completely disk-hogged on the
overview disk, and after this patch, the overview disk hardly had
anything to do anymore.

>Oh - one side note.  The apparent size of your nnrpd processes will
>grow, due to the mmap'ing.  That should not be a real problem though.

It depends on lot on how good the mmap implementation in your OS is.

Another side note: I jumped in to this discussion halfway through, so
I might miss something radical (like my patches are for 1.5.1, not (yet)
for 1.6x). Also, I didn't compare my patches to any patches mentioned here,
but I would be very interested in the results if anyone would :)

Cheers,

--
#! ##### Jan-Pieter Cornet ##### <johnpc@xs4all.net> ##### perl
++$_;$!=$_+++$_;($:,$,,$/,$*)=$!=~/.(.)...(.)(.).(.)/;$!=$_+$_;
($@,$\,$~)=$!=~/(.)(.).(.)/; $_="$,$/$:"; $@++; $~="$~$_";($_)=
\$$=~/\((.)/;$|=++$_;$_++;$|++;$~="$~ $@$:";`$~$/$\$*$, $|>&$_`

Re: NNRPD resource consumption
#21674
Author: Stephen R. van den Berg
Date: Thu, 18 Sep 1997 00:00
39 lines
2399 bytes

Rahul Dhesi <c.c.eiftj@16.usenet.us.com> wrote:
>In <5vmdsa$4pt$1@news0.xs4all.nl> johnpc@xs4all.nl (Jan-Pieter Cornet) writes:
>>My patches, instead, simple mmap the file and then perform a binary
>>search on the overview file to search the correct record.

>Note that a binary search can be done with seeks, without doing mmap.
>This might save you some memory.

Why is it that people always seem to think that doing it with seeks
instead of mmapping, will save memory?

When you lseek() to a spot, then read(), the kernel will read in that page
into a buffer in memory, then copy the results to userspace.
When you lseek() to the next spot, and read(), the kernel will read that
page into a *new* and most likely different buffer in memory (so as not
to thrash the buffer-cache), then copy it to userspace.
The buffers are marked as unmodified and will be discarded as soon as the
kernel thinks it needs more/new bufferspace.

When mmap()ping, the kernel copies the page that is being accessed
into buffer-space and maps that buffer directly into the process.
The buffers are marked as unmodified and will be discarded as soon as the
kernel thinks it needs more/new bufferspace.

In both cases the kernel buffers the data in memory, in the non-mmapped case,
there is an extra copy involved.  The amount of real memory used is the same
in both cases, since only those pages will be populated that are actually
being used.

What am I missing?
-- 
Sincerely,                                                          srb@cuci.nl
           Stephen R. van den Berg (AKA BuGless).
"Real Life?  I've played that game.  The plot stinks but the
 graphics are awesome."

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