🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
56 messages
56 total messages Page 1 of 2 Started by Sylvio Runge Fri, 29 Oct 1999 00:00
Page 1 of 2 • 56 total messages
NoCeM & INN2.3
#41199
Author: Sylvio Runge
Date: Fri, 29 Oct 1999 00:00
10 lines
927 bytes
Hello,

Does someone have NoCeM and INN2.3 to run?
c-nocem from  Olaf Titz will only run with inn  < v2.3 and the
NocemOnSpool has problems with the new
CNFS-storage-format .

S.

Re: NoCeM & INN2.3
#41201
Author: Sylvio Runge
Date: Sat, 30 Oct 1999 00:00
9 lines
1130 bytes
Russ Allbery wrote:
> 
Wouldn't it be to be integrated  a large idea the NoCeM-support into the
INN?
Each time one must tinker around it again executably to get. :)

S.

Re: NoCeM & INN2.3
#41198
Author: Thomas Tonino
Date: Sun, 31 Oct 1999 00:00
16 lines
1355 bytes
Russ Allbery wrote:

> I'm currently playing with some ideas for a standardized history API.
> Could you let me know what calls you need?  Maybe I can solve this problem
> for you once and for all.

It would be an excellent plan. The Highwind/whatever-they-are-called-now
software uses a binary history file format. Seems like a good idea for
performance (but definitely not for debugging) reasons.

The API could make testing a bit less painful.


Thomas

History (was: Re: NoCeM & INN2.3)
#41202
Author: Andrew
Date: Sun, 31 Oct 1999 00:00
63 lines
4262 bytes
In article <yl7lk3llie.fsf@windlord.stanford.edu>, Russ Allbery wrote:
>A couple nights ago, I spent four or five hours going through the existing
>dbz and history code in INN and figuring out how it worked.  Currently,
>lib/dbz.c really needs to be split into two files, one for tagged hash and
>one for normal history, and a common API stuck in front of them.  There's
>way too much ifdef stuff going on inside there.

Too right. I did something similar recently, and I was finding Emacs'
hideif-mode extremely useful :-)

>I'm also seriously considering a binary history file format, now that the
>contents are basically identical for each line and are all fixed-width
>fields.  For one thing, it would reduce the amount of data INN has to
>write out for the history file by a factor of three (helping both
>performance and some of the large file limits that people are already
>running into), and for another it would let the offsets stored in the
>index hashes be by record rather than by byte, which gives another four or
>five bits at the top of the offset to play with, which means that one
>could potentially do tagged hash even smaller than it is now.  But I
>haven't looked at that very much.

The other huge win you can get, with a little cunning, is to get rid
of the need to rebuild the hash table during expire, and do a true
cyclic history. That reduces the peak memory requirements by half.
Also, using a cyclic scheme means that you can preallocate the hash tables
at the optimum size and junk the apparently bug-ridden overflow code.

My design is based loosely on dbz, inspired more by the tagged-hash version
than the newer format, and is designed to scale up to hundreds of millions
of entires, or beyond, without excessive resource usage. It even behaves
tolerably well without using mmap, though this doesn't really reduce the
real memory requirements.

>While I was at it, I think it would be a good idea to roll the history
>cache from INN into the API as something you can optionally request when
>you initialize the API.  It's chummy enough with the history file already,
>and that would provide a few additional interesting benefits.  Like, for
>example, it's then only one step further to integrate the WIP cache in
>with the history cache, which would reduce the number of queries one has
>to do for incoming articles and let them all go through a standard API....

I didn't go quite this far; what I'm doing in my new code is to
effectively layer the history cache on top of the base history
API. There are a bunch of tools where the cache doesn't make sense,
whereas the main code doesn't really need to see anything _other_
than the cache API.

>And while I'm at it, I can make sure the lot of it can be easily made
>thread-safe.  History should actually support simultaneous readers without
>much trouble at all, although I think writes will still have to be
>serialized.

There are ways to get around this too; my dbz-derivative can actually
allow multiple concurrent writes from different processes or threads
(though I'm not actually doing that at the moment because of the locking
overheads). But even without that, there's still a rather obvious
approach to allow more concurrency on write operations.

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: NoCeM & INN2.3
#41215
Author: Katsuhiro Kondou
Date: Mon, 01 Nov 1999 00:00
13 lines
1514 bytes
In article <yl7lk3llie.fsf@windlord.stanford.edu>,
	Russ Allbery <rra@stanford.edu> wrote;

} I'm also seriously considering a binary history file format, now that the
} contents are basically identical for each line and are all fixed-width
} fields.

It'd not be so difficult for non-tagged hash code.
You can see the hint from what extendeddbz code does.
-- 
Katsuhiro Kondou

Re: NoCeM & INN2.3
#41219
Author: greg andruk
Date: Tue, 02 Nov 1999 00:00
11 lines
1293 bytes
Russ Allbery <rra@stanford.edu> wrote:

> the memory to run full regular dbz isn't that hard.  But it still should
> be pretty easy to do, and push comes to shove the current tagged hash
> implementation should continue working fine if we do the API right.

If the API is done really, really right, it ought to be possible to
stick *any* database underneath.  Important here is that backing text
files (if any) are not exposed to the applications.

Re: History (was: Re: NoCeM & INN2.3)
#41220
Author: Andrew
Date: Tue, 02 Nov 1999 00:00
46 lines
3323 bytes
In article <yld7ttpbug.fsf@windlord.stanford.edu>, Russ Allbery wrote:
>Well, the overflow code isn't so much buggy as just old and a rotted.  It
>was originally written for the case of either direct disk access or
>in-memory caching of the history file, and it relies on file holes when it
>extends the file.  I'm not sure if the code was ever checked with mmap to
>make sure that the mmap'd region extends properly when the first table
>overflows.

It never tries to extend the mmap region - access to overflow tables is
always via read/write (which is why excessive overflows murder the
performance).

>Anyway, replacement of records in place is another huge benefit of a
>binary history file format, yes.  (Well, a fixed-width format; you can get
>it without going binary, but I don't see much point.)  I was thinking
>about that more in the context of moving articles from one storage method
>to another than in the context of doing away with expire, but the latter
>would certainly be a nice bonus.  (expireover would still have to run, of
>course, and may still have to throttle the server on reading servers to
>deal with changing article history entries to non-article history entries,
>so it's not *that* exciting.)

In my case, I can do the necessary updates in another thread inside the
server anyway. Avoiding having to ever throttle in normal operation is a
goal of mine, and I have the luxury of not having to support non-threaded
systems.

>The trick, of course, is that right now the history file uses an extremely
>simple data structure; it's a pure hash table with linear probing.
[...]
>The obvious thing to do would be to put some amount of the arrival time
>into the mmap'd portion of the hash table, maybe only 16 bits of it to
>avoid increasing memory usage too badly, although you have to distinguish
>between history entries that are safe to expire (no corresponding article
>on the spool) and history entries that have to be retained.

Hmm... my solution was more subtle than that, and much more general-purpose
(I intend to use my code for lots of other things besides the history file,
including but not limited to the active file, the history cache, and
probably some spam-filtering databases too).

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: NoCeM & INN2.3
#41225
Author: greg andruk
Date: Tue, 02 Nov 1999 00:00
13 lines
1520 bytes
Russ Allbery <rra@stanford.edu> wrote:

> (A thread-safe header parsing library that doesn't use the ugly
> globals that INN currently uses to parse headers is the other thing
> that's going through my mind.)

I'll try to get cracking on the the ctlchan.c vaporware.  I'm ending
up having to do lots of the same things innd will want to do, while
converting the article parser from QIO to the direct storage mangler
calls we're using now.  Maybe the same stuff can be used in both
places.

Re: NoCeM & INN2.3
#41233
Author: bill davidsen
Date: Tue, 02 Nov 1999 00:00
41 lines
2933 bytes
In article <yl7lk3llie.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:

| I'm also seriously considering a binary history file format, now that the
| contents are basically identical for each line and are all fixed-width
| fields.  For one thing, it would reduce the amount of data INN has to
| write out for the history file by a factor of three (helping both
| performance and some of the large file limits that people are already
| running into), and for another it would let the offsets stored in the
| index hashes be by record rather than by byte, which gives another four or
| five bits at the top of the offset to play with, which means that one
| could potentially do tagged hash even smaller than it is now.  But I
| haven't looked at that very much.
| 
| The advantage of wrapping an API around it first is that decisions like
| binary file formats can be stuck behind a standard API, and that way we
| get nearly transparent backwards compatibility.

  Just please do this carefully, as there are MANY tools to read the
current format. In particular I regularly get a request to refeed the
last half day worth of articles or something, and being able to grab the
cookie for sm right out of the file is vastly useful. Of course having
the group name in the old format made it easy to reoffer just one group,
but I have tools for that now, as well.

  I also use several tools to look at the times, and I bet other sites
do as well. This is useful for identifying various feed problems, etc.

  I would like any history form which eliminated rebuilding everything in
expire. However, I think a real database, allowing deletes, would be
superior in some ways, since "remember as long as you can" isn't optimal
in all cases. We could have a real expire again, which made things go
away after a fixed length of time.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: NoCeM & INN2.3
#41236
Author: greg andruk
Date: Tue, 02 Nov 1999 00:00
18 lines
1712 bytes
Russ Allbery <rra@stanford.edu> wrote:

> Anyway, yes, all access to the history file for doing everything will need
> to go through the API, if we're going to support both text and binary
> formats in the history file.  Which means using grephistory rather than
> fgrep to look through history stuff etc., and Barry would probably be even
> more annoyed at me for hiding interesting things from his pager, but ah
> well.

Oh well, at this point with the hash and token representations,
regular grep isn't very useful anyway.

The possiblities I'm thinking about are being able to pull the
database writes out of innd without all the pain that currently
entails.  With that pesky detail out of the way, all sorts of
interesting opportunities for innd hackage open up.

Re: NoCeM & INN2.3
#41242
Author: bostic
Date: Wed, 03 Nov 1999 00:00
39 lines
2289 bytes
In article <7vq0aa$93v$1@newssvr02.news.prodigy.com>,
  davidsen@tmr.com (bill davidsen) wrote:
> In article <7vpog2$2qm$1@nnrp1.deja.com>,  <bostic@bostic.com> wrote:
>
> | And yes, Berkeley DB can do better than 500 queries a second on
> | commodity hardware. :-)  I regularly see multiple thousands of
> | queries a second on fairly low-end x86 hardware.
>
> On what size database, with what keys? If you were using the actual
> message-id rather than a hash, and if you were looking at a typical
> history database with perhaps 8-10 million entries, then I'm impressed
> as all get out, and I have to look at bdb again.
>
> But several people have reported that they did not see the results you
> report, as desirable as having a real database would be.

What tests have people run?  Do you have the test program around that
shows their results?  (My tests are just based on timing the test suite
that comes with Berkeley DB.)

I'm happy to help someone work up a test if there aren't any already
available.  Give me the key/data description and an access pattern,
and I'll write the test.

Regards,
--keith


=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Keith Bostic                    bostic@bostic.com
394 E. Riding Dr.               +1-978-287-4781
Carlisle, MA 01741              http://www.bostic.com



Sent via Deja.com http://www.deja.com/
Before you buy.

Re: NoCeM & INN2.3
#41246
Author: bostic
Date: Wed, 03 Nov 1999 00:00
58 lines
3321 bytes
In article <ylg0yomrmj.fsf@windlord.stanford.edu>,
  Russ Allbery <rra@stanford.edu> wrote:

>>> Precisely.  :)  Any API will obviously be designed with some eye to
>>> thread safeness as well.  (A thread-safe header parsing library that
>>> doesn't use
>
>> Not just thread safeness, but safe concurrent access by different
>> _processes_ as well, if the backend can do that. Then programs like
>> fastcancel or a rewritten expire wouldn't have to pause the server at
>> all.
>
> The problem is that writing a backend that can do that is pretty hard,
and
> I'm worried about the performance hit on INN.  Maybe optionally using
> fcntl range locking on the history file and having a ctlinnd command
to
> turn it on or off?  Hurm.

Fcntl range locking is too slow for any real thread usage --
doing a system call for an uncontested lock isn't reasonable.
If you look underneath Berkeley DB, there's a lot of work
invested in doing locking mutexes that don't require system
calls.  It's a portability nightmare, of course, but if you're
going to run any significant numbers of threads or processes
in an application, you have to do it.

>> (I've already played with the idea of simply trying Berkeley Berkeley
>> DB for that and see it fail spectacularly in the performance area,
and
>> then write a specialized replacement.)
>
> dbz is impressively simple and fast for what it does.  It's basically
> living at one end of the memory vs. performance curve; I'm really not
sure
> how you could get it much faster than it is already (well, apart from
> improving the hash algorithm, which I'm going to look at -- MD5 is
> dog-slow and there are better algorithms out there).

I've never looked inside of INN, so it's fair to say that I don't
understand the problem.  However, it seems to me that INN is a
database problem, and wouldn't it make sense to try a database
solution?  I don't know what the scaling and recoverability
requirements of INN are, but Berkeley DB already offers real
scalability and thread support, not to mention recoverability
after failure.

And yes, Berkeley DB can do better than 500 queries a second on
commodity hardware. :-)  I regularly see multiple thousands of
queries a second on fairly low-end x86 hardware.

--keith


Sent via Deja.com http://www.deja.com/
Before you buy.

Re: NoCeM & INN2.3
#41254
Author: bill davidsen
Date: Wed, 03 Nov 1999 00:00
21 lines
1696 bytes
In article <7vpog2$2qm$1@nnrp1.deja.com>,  <bostic@bostic.com> wrote:

| And yes, Berkeley DB can do better than 500 queries a second on
| commodity hardware. :-)  I regularly see multiple thousands of
| queries a second on fairly low-end x86 hardware.

On what size database, with what keys? If you were using the actual
message-id rather than a hash, and if you were looking at a typical
history database with perhaps 8-10 million entries, then I'm impressed
as all get out, and I have to look at bdb again.

But several people have reported that they did not see the results you
report, as desirable as having a real database would be.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: NoCeM & INN2.3
#41255
Author: greg andruk
Date: Wed, 03 Nov 1999 00:00
39 lines
2836 bytes
Russ Allbery <rra@stanford.edu> wrote:

[header parsing code]

> Take a look at the binary search trees that innd builds.  I think I need
> to continue supporting that in any rewrite, although I don't see any real
> reason to use a tree; a binary search on an array should work just as
> well.

I have a search by name in there now, but it's not a binary search.
The number of headers in the vast majority of articles is small enough
that I'm thinking the serial scan on the first chars, followed by a
compare on a potential match, might be plenty fast enough.  Sorting
costs too, after all.

The #defined constants for direct access to the first instance of a
"known" header are still supported, so this all should work out
happily, I think.

>  My initial idea was to have the caller allocate an array of header
> structs, pre-sorted in the right order to do a binary search, and then
> pass the header parsing code that and the article headers and have it
> fill in the header content for each of the headers found.

I've got something like this going, basically a big tangle of pointers
gets built to allow search by name, retrieval from the traditional
INN-style header struct, and reassembly into their original order via
writev() or simliar.  Callas to add and delete header lines are in
there too.  This API will solve the problem of getting "unknown"
heaeders into the filters, too.

> With maybe some extra fluff for required headers, duplicate headers, and
> the like.

That's incorporated into the traditional-style struct.  Basically, I
took the ARTHEADER and HEADER from innd and nnrpd and merged them,
with two sets of HTstd and friends, one each for transit and posting.

Re: NoCeM & INN2.3
#41256
Author: greg andruk
Date: Wed, 03 Nov 1999 00:00
15 lines
1421 bytes
Russ Allbery <rra@stanford.edu> wrote:

> it be different for every site.  Given that, hashes like djb's hash128,
> which is considerably faster than MD5, become viable options.

Speaking of djb, one interesting toy to play with is rdbm, a modified
version of cdb.  It's maybe not exactly what news wants in its current
form, but the engine is quite fast and presents some interesting
possibities, if a clean way can be found to address its appetite for
memory.  OTOH, there are plenty of sites with ample RAM that might be
able to use this as-is.

It lives at <URL:http://www.math.fu-berlin.de/~leitner/rdb/>

Re: INN history API (was: NoCeM & INN2.3)
#41259
Author: Katsuhiro Kondou
Date: Wed, 03 Nov 1999 00:00
16 lines
1708 bytes
In article <ylk8o0l9zd.fsf_-_@windlord.stanford.edu>,
	Russ Allbery <rra@stanford.edu> wrote;

} > since "remember as long as you can" isn't optimal in all cases. We could
} > have a real expire again, which made things go away after a fixed length
} > of time.
} 
} We'll have that for INN 2.3 anyway; Katsuhiro's working on it.  You can do

Yes, most of the overview code is done and some of
scripts (e.g. news.daily) is currently modified.
The work will be done soon.
-- 
Katsuhiro Kondou

Re: NoCeM & INN2.3
#41264
Author: Andrew
Date: Wed, 03 Nov 1999 00:00
71 lines
4484 bytes
In article <7vpog2$2qm$1@nnrp1.deja.com>, bostic@bostic.com wrote:
>Fcntl range locking is too slow for any real thread usage --
>doing a system call for an uncontested lock isn't reasonable.

That depends on the frequency of calls, of course....

The main problem with fcntl and threads is that fcntl locks don't
work between threads in the same process; any lock acquired via
fcntl belongs to the whole process, not to the calling thread.

I've used SysV semaphores for some fairly demanding applications (in
a former life, doing non-Usenet stuff). The system call overhead was
not a major issue in those cases; in fact, the ability to recover
from a process failure without deadlocks was well worth the cost in
that particular application. (Which, incidentally, was a record
locking and transaction management system built on top of an existing
ISAM-style database, so I do have some experience in this field.)

>If you look underneath Berkeley DB, there's a lot of work
>invested in doing locking mutexes that don't require system
>calls.  It's a portability nightmare, of course, but if you're
>going to run any significant numbers of threads or processes
>in an application, you have to do it.

BerkeleyDB's mutexes _suck_ if you put more than a minimal amount
of load on them, due to the fact that they use time-delayed retry
rather than any mechanism of signalling the waiting process when
a lock becomes free. This is even documented in mutex/README.

We use BerkeleyDB, as you know, in some moderately stressful internal
applications (e.g. within our authentication system) and in several
places I've found that the only way to get acceptable performance out
of it is to put pthread mutexes around whole groups of db operations
to keep the load on the db's internal locks down.

If it weren't for the fact that they use the same locking primitives
for mutexes and for long-term waits (by having a thread block on one of
its own locks and have that lock freed by another thread), I'd have
tried rewriting the db locks to use pthread calls instead.

>I've never looked inside of INN, so it's fair to say that I don't
>understand the problem.  However, it seems to me that INN is a
>database problem, and wouldn't it make sense to try a database
>solution?  I don't know what the scaling and recoverability
>requirements of INN are, but Berkeley DB already offers real
>scalability and thread support, not to mention recoverability
>after failure.

The basic problem is: new articles arrive at the rate of 10 or so per
second, and in the transit environment you have a number (tens or
hundreds) of incoming feeds all offering you articles at about this rate
which you may or may not already have. In consequence you have a _lot_
of lookups happening for entries that don't exist, and the database as
a whole is large enough that you won't want to have it all incore.

Now if I understand the way that BerkeleyDB's hash method works, then
the lookups for nonexistent entries will overwhelm the cache, as pages
get read in to locate the data that isn't there.

>And yes, Berkeley DB can do better than 500 queries a second on
>commodity hardware. :-)  I regularly see multiple thousands of
>queries a second on fairly low-end x86 hardware.

On databases of 10, 20 or 100 million records, which are being
simultaneously added to at the rate of 10 or so records per second?

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: INN history API (was: NoCeM & INN2.3)
#41265
Author: bill davidsen
Date: Wed, 03 Nov 1999 00:00
91 lines
5561 bytes
In article <ylk8o0l9zd.fsf_-_@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:

| > In particular I regularly get a request to refeed the last half day
| > worth of articles or something, and being able to grab the cookie for sm
| > right out of the file is vastly useful.
| 
| newsrequeue is supposed to be able to do something like this in a much
| cleaner fashion, but looking at the code, it looks rather... incomplete.
| Hm.  Should go bang on that some when I have some free time, since an
| automated tool to do this would be kind of nice.

  I believe newsrequeue only requeues things for site to which you have
a current feed, and it beats hell out of the systems trying to decide
what to feed using normal feed rules. I most cases where I'm doing this
type of ad-hoc transmit, there may be no normal feed defined between the
machines. Catching up one reader server from another comes to mind, my
spiffy little tool starts with begin and end dates and just feeds
everything I have between those times. Crude, but *very* low impact.

| > Of course having the group name in the old format made it easy to
| > reoffer just one group, but I have tools for that now, as well.
| 
| Should be possible to do this quite nicely in INN 2.3, since more time
| information about the article will be in the overview file so you can just
| walk the overview entries for a group and build a batch file from that.

  Yes, I wrote getover to allow sucking an overview file from the
command line. Then I can either push the articles from one end or suck
them from the other, depending on the situation. Nice to have stuff on
overview, and with 2.3 overview is much faster.

  And the -i and -s options on grephistory are still highly useful, as
they make it trivial to do a backup feed as needed. If only the -l
option worked with -i ;-)

| > I would like any history form which eliminated rebuilding everything in
| > expire.
| 
| I'm not sure this is actually as big of an advantage as people seem to
| feel it is, but I haven't played around with it much either.  Never having
| to throttle sounds nice, but it actually makes life a lot easier for a lot
| of different things to be able to do a fresh rebuild of indexes.

  But there are lots of problems with it, not least of which is the
memory and storage it takes to do expire. More and more I would like to
run my news readers as a steady state process, and with CNFS
eliminating the need to do file deletes, history and overview become
the limits. When the bugs get out of the cyclic overview, hopefully that
problem will be addressed, leaving only history.

| 
| > However, I think a real database, allowing deletes, would be superior in
| > some ways,
| 
| Yes, but real databases that are capable of handling 500 queries per
| second on low-end hardware are a bit hard to come by, whereas dbz is doing
| that right now.  I'm not disagreeing, just saying that this is a hard
| problem.  I'm playing around with some ideas for solutions; going to a
| binary file format will help most of them.

  Other than making the history file smaller and postoning addressing of
the max file size issue, I wouldn't expect a huge gain. A hashed lookup
of a message-id isn't going to be significantly faster in binary. I
would like to see some solution which allowed history to be in multiple
files, bypassing issues of file size limits.

| I'm not clear at this point whether the history API work will be for 2.3
| or for 2.4; it depends on how long it takes me to get to it.  Right now,
| I'm still at the stage of throwing out ideas and getting a clear picture
| of the requirements.  I have several things in the hopper for 2.4 that are
| roughly at that stage, and some things that will probably make it into
| 2.3.  Right now, the actual work I'm doing is mostly aimed at cleaning up
| the build system.

  I would hope that any change in history file format would go in 2.4,
since 2.3 has many useful features and is quite stable at the moment
(modulo any given day). The new API is a good long term solution, but
it does push production use of 2.x out by the time to regen whatever
tools are critical at a given site. Given the time it took to steal
minutes to rewrite tools to live with storageapi and CNFS, I have to
think it might be measured in weeks if not months. Admin time is in
shorter supply than other resources.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: NoCeM & INN2.3
#41271
Author: Joe Greco
Date: Wed, 03 Nov 1999 00:00
34 lines
2210 bytes
In news.software.nntp article <7vq0aa$93v$1@newssvr02.news.prodigy.com>, davidsen@tmr.com (bill davidsen) wrote:
:In article <7vpog2$2qm$1@nnrp1.deja.com>,  <bostic@bostic.com> wrote:
:
:| And yes, Berkeley DB can do better than 500 queries a second on
:| commodity hardware. :-)  I regularly see multiple thousands of
:| queries a second on fairly low-end x86 hardware.
:
:On what size database, with what keys? If you were using the actual
:message-id rather than a hash, and if you were looking at a typical
:history database with perhaps 8-10 million entries, then I'm impressed
:as all get out, and I have to look at bdb again.

(well, yes, I'm stepping into an INN discussion, and I know it, and I know
that my systems are Diablo based.  That said, I see some similar scaling
issues so I think it is fair...)

8-10 million?

Hell, I need something that'll go up to 100 million, today, and my spool
isn't even full.

Ideally, it'd allow realtime addition and removal of about a million
records per day, without dump/reload style maintenance, and query rates
measured in thousands per second, with multiple processes doing both
queries and additions.

If it can't do that, then I'm not sure if there's an advantage.

And you can tell me I'm smokin' something when I expect this from a DB,
but hey, that's what it takes to do the job.

... JG

Re: NoCeM & INN2.3
#41274
Author: bostic
Date: Thu, 04 Nov 1999 00:00
93 lines
5103 bytes
In article <slrn821emt.edk.andrew+news@uk21.supernews.com>,
  andrew@supernews.com wrote:
>> In article <7vpog2$2qm$1@nnrp1.deja.com>, bostic@bostic.com wrote:
>>
>>If you look underneath Berkeley DB, there's a lot of work
>>invested in doing locking mutexes that don't require system
>>calls.  It's a portability nightmare, of course, but if you're
>>going to run any significant numbers of threads or processes
>>in an application, you have to do it.
>
> BerkeleyDB's mutexes _suck_ if you put more than a minimal amount
> of load on them, due to the fact that they use time-delayed retry
> rather than any mechanism of signalling the waiting process when
> a lock becomes free. This is even documented in mutex/README.

That's not completely correct -- BerkeleyDB has two styles of
mutexes.  Where the system supports blocking mutexes, DB uses
them.

That point nit-picked, I don't disagree with your statement.
In the Berkeley DB 2.7.X release, blocking mutexes were only
supported on a few platforms, and, in high-contention
environments the timer back-off code can't carry the weight.

If I'm permitted a paragraph to talk about vaporware, though,
the upcoming 3.X Berkeley DB release (coming this month to a
web site near you), greatly expands the blocking mutex support.
Among others, it supports POSIX pthread mutexes, UI thread
mutexes and Solaris LWP thread mutexes.

> If it weren't for the fact that they use the same locking primitives
> for mutexes and for long-term waits (by having a thread block on one
of
> its own locks and have that lock freed by another thread), I'd have
> tried rewriting the db locks to use pthread calls instead.

Actually, since I was the one that did that work, I can tell
you that you made a wise decision.  It was an unbelievable pain.
Pthreads portable?  Hah!  Do the mutexes actually work?  Hah!
But I digress...  :-)

> The basic problem is: new articles arrive at the rate of 10 or so per
> second, and in the transit environment you have a number (tens or
> hundreds) of incoming feeds all offering you articles at about this
rate
> which you may or may not already have. In consequence you have a _lot_
> of lookups happening for entries that don't exist, and the database as
> a whole is large enough that you won't want to have it all incore.
>
> Now if I understand the way that BerkeleyDB's hash method works, then
> the lookups for nonexistent entries will overwhelm the cache, as pages
> get read in to locate the data that isn't there.

This is correct.  Depending on the randomness of the queries
you may very possibly flush the cache by asking for lots of
nonexistent records.  (This is a good example of what I was
saying in another post -- if you know a lot about your data
access pattern, you can win in the specialized case.)

That said, I'm surprised that you use hashing.  Why not B+trees?
I would expect there to be a fair amount of locality in message
IDs, particularly when you're talking to some set of sites.
Don't the same sites feed you articles from the same backing
sites?  If you're seeing locality of reference in those requests,
you should be able to determine that the requested item doesn't
exist with minimal effort in a B+tree.

>>And yes, Berkeley DB can do better than 500 queries a second on
>>commodity hardware. :-)  I regularly see multiple thousands of
>>queries a second on fairly low-end x86 hardware.
>
> On databases of 10, 20 or 100 million records, which are being
> simultaneously added to at the rate of 10 or so records per second?

Sure.

The issue isn't the size of the database, or how fast you're
adding to it.  The issue is how hot you can keep your cache,
which is a function of your data and your access pattern.

Regards,
--keith

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Keith Bostic                    bostic@bostic.com
394 E. Riding Dr.               +1-978-287-4781
Carlisle, MA 01741              http://www.bostic.com


Sent via Deja.com http://www.deja.com/
Before you buy.

Re: INN history API (was: NoCeM & INN2.3)
#41276
Author: Richard Michael Todd
Date: Thu, 04 Nov 1999 00:00
18 lines
1681 bytes
Russ Allbery <rra@stanford.edu> writes:

> bill davidsen <davidsen@tmr.com> writes:
> 
> > But there are lots of problems with it, not least of which is the memory
> > and storage it takes to do expire.
> 
> I'm not sure this is really an issue on modern systems; INN and expire
> should be able to share the same memory region given that they're mmaping
> the same file, yes?  It's an issue if you don't have mmap, but if you
> don't have mmap you lose in general.

No. :-) They're not mmaping the same file.  Innd is mmapping the *current*
dbz file, and expire is mmaping the *new* dbz file it's generating.  Only when
expire is done does innd switch to mmaping the new dbz file.  


Re: NoCeM & INN2.3
#41278
Author: Andrew
Date: Thu, 04 Nov 1999 00:00
34 lines
2452 bytes
In article <7vs3rh$oca$1@nnrp1.deja.com>, bostic@bostic.com wrote:
>How big is the message ID?

Very variable - not often less than 20 characters or more than 100, but
the theoretical upper limit is 504 characters. 38 characters is currently
the most common length (thanks to the recent release of Agent 1.6).

>It would be worthwhile considering that you might not need the
>cache in front of the database, if the database works well.

Unlikely. The thing is that the history cache can be used as part of the
precommit mechanism, which is essential anyway.

>> If you want to take the cache part as well, then the mix is different;
>> basically, I get the same message IDs offered to me from about 20 to
>30
>> peers within five to ten seconds of each other.
>
>But this is right for a Btree -- the first connection will fault
>in the pages if they're not already resident, and the rest of the
>connections will find them already in memory.  That's exactly what
>you want, and offers you almost perfect locality.

Actually it should work just as well with a hash - remember that it's
_exactly the same_ ID which is being looked up. Btrees are nice if a
lookup on one item is likely to result in the lookup of _different_
but nearby values; this isn't going to happen with message-ids except
by chance.

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: NoCeM & INN2.3
#41279
Author: bostic
Date: Thu, 04 Nov 1999 00:00
41 lines
2276 bytes
In article <3820b2ce$0$97653@news.execpc.com>,
  jgreco@ns.sol.net (Joe Greco) wrote:
> In news.software.nntp article
<7vq0aa$93v$1@newssvr02.news.prodigy.com>, david
sen@tmr.com (bill davidsen) wrote:
> :In article <7vpog2$2qm$1@nnrp1.deja.com>,  <bostic@bostic.com> wrote:
> :
> 8-10 million?
>
> Hell, I need something that'll go up to 100 million, today, and my
spool
> isn't even full.

Well, you *did* ask, so I don't think I'm completely out of line.

<insert advertisement>

I've got TB Berkeley DB databases in the field, and I've got databases
with 1000+ concurrent threads.  One site I'm pretty familiar with is
uploading about 300MB of new data into their databases a day -- there
are others that I believe are doing more, but I don't know their rates
for a fact.

> Ideally, it'd allow realtime addition and removal of about a million
> records per day, without dump/reload style maintenance, and query
rates
> measured in thousands per second, with multiple processes doing both
> queries and additions.

A million updates a day is only 11 updates a second.  (I'm obviously
missing something, that's too simple a requirement.)  Query rates in
the thousands per second, sure -- fully threaded, supporting both
threads and multiple processes, sure, Berkeley DB can do that.

--keith


Sent via Deja.com http://www.deja.com/
Before you buy.

Re: NoCeM & INN2.3
#41280
Author: Andrew
Date: Thu, 04 Nov 1999 00:00
26 lines
2195 bytes
In article <382183ca$0$97644@news.execpc.com>, Joe Greco wrote:
>In news.software.nntp , andrew@supernews.com wrote:
>:We actually looked hard at the Diablo history, since we had originally
>:planned to do something similar; but I decided that the idea of using
>:chained entries to handle collisions sucks, because you have no locality
>:of reference and so the second read is likely to require another I/O
>:(unless you have enough RAM to keep the entire history incore, which
>:seems improbable). You're also much more likely to have to do I/O to
>:find that an entry _doesn't_ exist.
>
>Increasing the table size does wonders to fix that, and the hash function
>is pretty good, at least good enough that the 18.2 million Message-ID's I
>generated for Matt a few years ago resulted in zero collisions.

If I used the same amount of memory for a Diablo-style history table that
I'm using for dbat hastables, then about 15% of the entries would be on
chains of length >1, and about one-third of all lookups of nonexistent
entries would require at least one read call. Whereas with dbat, I
essentially never need to do a read call for a failed lookup, or more
than one read call for a successful one.

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: NoCeM & INN2.3
#41281
Author: bostic
Date: Thu, 04 Nov 1999 00:00
46 lines
2526 bytes
In article <yld7tq6hvh.fsf@windlord.stanford.edu>,
  Russ Allbery <rra@stanford.edu> wrote:
>
> Currently, the hash keys are the first six bytes of an MD5 hash of the
> message ID, so for different articles the result is pretty much evenly
> distributed.

Of course, that destroys the locality of reference that you
would normally see from the key.

> Of course, one could take a step back and use a different
> hash, but the hash probably has to be cryptographically strong unless
we
> store the entire message ID.

How big is the message ID?

> As previously mentioned, INN
> already puts its own cache in front of the underlying database; if db
sits
> in that space, what it'll see is roughly 40% or so of the queries are
for
> articles not in the history file at all, and the remaining 60% won't
have
> much locality at all.

It would be worthwhile considering that you might not need the
cache in front of the database, if the database works well.

> If you want to take the cache part as well, then the mix is different;
> basically, I get the same message IDs offered to me from about 20 to
30
> peers within five to ten seconds of each other.

But this is right for a Btree -- the first connection will fault
in the pages if they're not already resident, and the rest of the
connections will find them already in memory.  That's exactly what
you want, and offers you almost perfect locality.

--keith


Sent via Deja.com http://www.deja.com/
Before you buy.

Re: NoCeM & INN2.3
#41282
Author: bostic
Date: Thu, 04 Nov 1999 00:00
22 lines
1552 bytes
In article <yln1sv8a4c.fsf@windlord.stanford.edu>,
  Russ Allbery <rra@stanford.edu> wrote:

> If Berkeley db can do this, I'll be extremely impressed.

Fair enough -- I'll build a simple simulation, and see what
numbers I get.  I won't get a chance to do it this week, but
I'll get back to you regardless.

Regards,
--keith

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Keith Bostic                    bostic@bostic.com
394 E. Riding Dr.               +1-978-287-4781
Carlisle, MA 01741              http://www.bostic.com


Sent via Deja.com http://www.deja.com/
Before you buy.

Re: NoCeM & INN2.3
#41283
Author: mooring
Date: Thu, 04 Nov 1999 00:00
20 lines
1703 bytes
In article <ylg0yomrmj.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
>dbz is impressively simple and fast for what it does.  It's basically
>living at one end of the memory vs. performance curve; I'm really not sure
>how you could get it much faster than it is already (well, apart from
>improving the hash algorithm, which I'm going to look at -- MD5 is
>dog-slow and there are better algorithms out there).

I don't think MD5 is slow enough to be a bottleneck.  I just wrote and
ran a little test program that calls HashMessageID() on each line from
stdin. It does a little over 19,000 hashes a second on a Sparc 5 when
I feed it the first 100K or so message-id's from my history file.

Seems like there might be better things to worry about than ~50us
per article.
-- 
Regards,
Ed Mooring (mooring@tymnet.com 408-533-7504)

Re: NoCeM & INN2.3
#41288
Author: Andrew
Date: Thu, 04 Nov 1999 00:00
26 lines
1925 bytes
In article <3820b2ce$0$97653@news.execpc.com>, Joe Greco wrote:
>(well, yes, I'm stepping into an INN discussion, and I know it, and I know
>that my systems are Diablo based.  That said, I see some similar scaling
>issues so I think it is fair...)

We actually looked hard at the Diablo history, since we had originally
planned to do something similar; but I decided that the idea of using
chained entries to handle collisions sucks, because you have no locality
of reference and so the second read is likely to require another I/O
(unless you have enough RAM to keep the entire history incore, which
seems improbable). You're also much more likely to have to do I/O to
find that an entry _doesn't_ exist.

>8-10 million?
>
>Hell, I need something that'll go up to 100 million, today, and my spool
>isn't even full.

The theoretical limit of my code is about 1 billion ids, though there's
a simple method of expanding it beyond that if need be.

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: INN history API (was: NoCeM & INN2.3)
#41290
Author: Richard Michael Todd
Date: Thu, 04 Nov 1999 00:00
11 lines
1479 bytes
Russ Allbery <rra@stanford.edu> writes:

> Well, yes, but why should expire do that given that it's paused the server
> anyway, hm?  There isn't any reason why it *needs* to use a different
> file, after all....  :)

Expire only pauses the server when it's done with the new history file and
is ready to switch the new history file and dbz files in.  Most of the time
that expire is running, innd is not paused. 

Re: NoCeM & INN2.3
#41293
Author: bostic
Date: Thu, 04 Nov 1999 00:00
16 lines
1377 bytes
In article <ylg0ym6i22.fsf@windlord.stanford.edu>,
  Russ Allbery <rra@stanford.edu> wrote:
>
> I assume the Berkeley db license will still be
free-software-friendly?  :)
> (It's an issue for INN, although I'm curious regardless.)

Yes, Berkeley DB will always be Open Source(tm).

--keith


Sent via Deja.com http://www.deja.com/
Before you buy.

Re: NoCeM & INN2.3
#41295
Author: Andrew
Date: Thu, 04 Nov 1999 00:00
36 lines
2803 bytes
In article <7vqtad$u3u$1@nnrp1.deja.com>, bostic@bostic.com wrote:
>> Now if I understand the way that BerkeleyDB's hash method works, then
>> the lookups for nonexistent entries will overwhelm the cache, as pages
>> get read in to locate the data that isn't there.
>
>This is correct.  Depending on the randomness of the queries
>you may very possibly flush the cache by asking for lots of
>nonexistent records.  (This is a good example of what I was
>saying in another post -- if you know a lot about your data
>access pattern, you can win in the specialized case.)

Both dbz and my variant (dbat) keep a hashtable separate from the data,
and generally (at least with dbat or the current dbz) aim to handle the
case of a failed lookup without having to read the actual data files
(which are much larger). The hash tables are small enough to keep incore
all the time, and the data file is in time-order, which helps a bit in
terms of locality of reference.

>That said, I'm surprised that you use hashing.  Why not B+trees?
>I would expect there to be a fair amount of locality in message
>IDs, particularly when you're talking to some set of sites.
>Don't the same sites feed you articles from the same backing
>sites?  If you're seeing locality of reference in those requests,
>you should be able to determine that the requested item doesn't
>exist with minimal effort in a B+tree.

I don't think there's anything to be gained here, because message-ids
are intended to be unpredictable, and what patterns there are probably
aren't useful. In any case, it's dangerous to make assumptions about
them, because the situation can change almost overnight.

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: NoCeM & INN2.3
#41297
Author: Andrew
Date: Thu, 04 Nov 1999 00:00
22 lines
1691 bytes
In article <7vt2nm$dkv$1@newssvr02.news.prodigy.com>, bill davidsen wrote:
>In article <slrn821emt.edk.andrew+news@uk21.supernews.com>,
>Andrew <andrew@supernews.com> wrote:
>
>| The main problem with fcntl and threads is that fcntl locks don't
>| work between threads in the same process; any lock acquired via
>| fcntl belongs to the whole process, not to the calling thread.
>
>I assume you mean user level threads (MIT style) rather than kernel
>thread (Linux style).

No, I mean threads as defined by the relevent standards.

If Linux has things called "threads" that don't share resources like file
descriptors, file locks, working directory etc., then they are nonstandard
and irrelevent to me.

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: NoCeM & INN2.3
#41299
Author: Joe Greco
Date: Thu, 04 Nov 1999 00:00
32 lines
2256 bytes
In news.software.nntp article <slrn822cos.edk.andrew+news@uk21.supernews.com>, andrew@supernews.com wrote:
:In article <3820b2ce$0$97653@news.execpc.com>, Joe Greco wrote:
:>(well, yes, I'm stepping into an INN discussion, and I know it, and I know
:>that my systems are Diablo based.  That said, I see some similar scaling
:>issues so I think it is fair...)
:
:We actually looked hard at the Diablo history, since we had originally
:planned to do something similar; but I decided that the idea of using
:chained entries to handle collisions sucks, because you have no locality
:of reference and so the second read is likely to require another I/O
:(unless you have enough RAM to keep the entire history incore, which
:seems improbable). You're also much more likely to have to do I/O to
:find that an entry _doesn't_ exist.

Increasing the table size does wonders to fix that, and the hash function
is pretty good, at least good enough that the 18.2 million Message-ID's I
generated for Matt a few years ago resulted in zero collisions.

:>8-10 million?
:>
:>Hell, I need something that'll go up to 100 million, today, and my spool
:>isn't even full.
:
:The theoretical limit of my code is about 1 billion ids, though there's
:a simple method of expanding it beyond that if need be.

Well, then, I'm glad that I'm not the only one who is sneering at 8-10
million :-) :-)

... JG

Re: INN history API (was: NoCeM & INN2.3)
#41301
Author: bill davidsen
Date: Thu, 04 Nov 1999 00:00
31 lines
2227 bytes
In article <ylso2m514t.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
| bill davidsen <davidsen@tmr.com> writes:
| > Russ Allbery  <rra@stanford.edu> wrote:

| > But there are lots of problems with it, not least of which is the memory
| > and storage it takes to do expire.
| 
| I'm not sure this is really an issue on modern systems; INN and expire
| should be able to share the same memory region given that they're mmaping
| the same file, yes?  It's an issue if you don't have mmap, but if you
| don't have mmap you lose in general.

Maybe you have a machine large enough so that you can fit two copies of
the history file (call that 3GB) in physical memory while accepting
articles and serving readers, and avoid paging the sox off the machine,
but I certainly can't! Expire makes a total copy of the history file,
less articles it doesn't keep, and there's just no reason for all that
i/o and CPU to be done at one time. I'd rather spread it over a full
day, or better yet not do it at all.

There's no algorithm to do anything which is as fast as finding a way
not to do it at all.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: NoCeM & INN2.3
#41306
Author: bill davidsen
Date: Thu, 04 Nov 1999 00:00
34 lines
2421 bytes
In article <slrn821emt.edk.andrew+news@uk21.supernews.com>,
Andrew <andrew@supernews.com> wrote:

| The main problem with fcntl and threads is that fcntl locks don't
| work between threads in the same process; any lock acquired via
| fcntl belongs to the whole process, not to the calling thread.

I assume you mean user level threads (MIT style) rather than kernel
thread (Linux style). But the problem is there for sure.

| I've used SysV semaphores for some fairly demanding applications (in
| a former life, doing non-Usenet stuff). The system call overhead was
| not a major issue in those cases; in fact, the ability to recover
| from a process failure without deadlocks was well worth the cost in
| that particular application. (Which, incidentally, was a record
| locking and transaction management system built on top of an existing
| ISAM-style database, so I do have some experience in this field.)

Running ctxbench (a context switching benchmark) I see 15k+
switches/sec on an old Pentium 90 using semiphores, that number being
switch to other process and back to the counting process, so it's
arguably off by two. In any case probably a hint that it would be fast
enough for news at the moment. Obviously the numbers are higher on real
computers.

I think this is a good (read as fast and portable) IPC to consider.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: NoCeM & INN2.3
#41308
Author: bill davidsen
Date: Thu, 04 Nov 1999 00:00
48 lines
3005 bytes
In article <slrn8244io.42i.andrew+news@uk21.supernews.com>,
Andrew <andrew@supernews.com> wrote:
| In article <7vt2nm$dkv$1@newssvr02.news.prodigy.com>, bill davidsen wrote:
| >In article <slrn821emt.edk.andrew+news@uk21.supernews.com>,
| >Andrew <andrew@supernews.com> wrote:
| >
| >| The main problem with fcntl and threads is that fcntl locks don't
| >| work between threads in the same process; any lock acquired via
| >| fcntl belongs to the whole process, not to the calling thread.
| >
| >I assume you mean user level threads (MIT style) rather than kernel
| >thread (Linux style).
| 
| No, I mean threads as defined by the relevent standards.

  I missed the part in the POSIX description which indicated that
threads must be (or can't be) user level.

| If Linux has things called "threads" that don't share resources like file
| descriptors, file locks, working directory etc., then they are nonstandard
| and irrelevent to me.

  The issue is that MIT style threads can have up to a max of one
processor mini-scheduled between all threads, while kernel threads may
have all CPUs in the system running various threads. The issue isn't
resource sharing per se.

  User level threads hide bad programming because only one can really
run at a time, and they are not preempted. If a thread forgets to lock
something it will run until it gives up the processor.

  Kernel level threads hide bad programming, at least with SMP, because
many deadlocks don't show up if another thread can run on another
processor, or id the current blocked thread is preempted and the
blocking thread runs to an unlock point.

  I don't trust my thread code until I link with a user level library,
kernel level library uniprocessor, and kernel level with SMP. I rarely
find a bug which stops the program, but I do sometimes find unobvious
performance issues. Quality of implementation issues.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: NoCeM & INN2.3
#41311
Author: Andrew
Date: Thu, 04 Nov 1999 00:00
16 lines
1518 bytes
In article <yln1sv8a4c.fsf@windlord.stanford.edu>, Russ Allbery wrote:
>Key is a six-byte hash of the message ID,

not in my case; six bytes is nowhere near enough for me. (In fact,
20 million entries is more or less dead on the point where you'll have
an even chance of collision with that size of hash.)

We debated whether 8 bytes would be ok, but (for reasons which should be
obvious) we regard the ability to support infinite retention as desirable,
so we decided to use 16 bytes.

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: NoCeM & INN2.3
#41315
Author: bostic
Date: Thu, 04 Nov 1999 00:00
24 lines
1662 bytes
In article <yln1sv8a4c.fsf@windlord.stanford.edu>,
  Russ Allbery <rra@stanford.edu> wrote:

I also need an access pattern -- I could write something that
shows N writes and M reads per second, but the real performance
may differ dramatically depending on the locality of reference
for the keys.  Is there any kind of simulation definition that
you could whip up that would give me some real-world access
pattern?

Regards,
--keith

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Keith Bostic                    bostic@bostic.com
394 E. Riding Dr.               +1-978-287-4781
Carlisle, MA 01741              http://www.bostic.com



Sent via Deja.com http://www.deja.com/
Before you buy.

Re: NoCeM & INN2.3
#41316
Author: Andrew Gierth
Date: Thu, 04 Nov 1999 00:00
13 lines
1239 bytes
>>>>> "mooring" == mooring  <mooring@tymnet.com> writes:

 Path: ...!headwall.stanford.edu!newsbudd!not-for-mail

Never heard of FQDNs?

Is INN defaulting to unqualified hostnames in the path these days?
I thought only the bCandid people were that stupid.

-- 
Andrew.

Re: NoCeM & INN2.3
#41317
Author: bostic
Date: Thu, 04 Nov 1999 00:00
42 lines
2599 bytes
In article <ylpuxr8ak8.fsf@windlord.stanford.edu>,
  Russ Allbery <rra@stanford.edu> wrote:
> bostic <bostic@bostic.com> writes:
>> And yes, Berkeley DB can do better than 500 queries a second on
>> commodity hardware. :-) I regularly see multiple thousands of queries
a
>> second on fairly low-end x86 hardware.
>
> Queries to a database whose total size is around 1.5GB?  That's what
kills
> most database solutions.  They can handle large quantities of data,
and
> they can handle lots of queries, but they can't handle both at once
(at
> least on low-end hardware).  Keep in mind that the database is also
doing
> around 10 writes per second.

Well, 1.5GB isn't all that large, but I agree with your basic point.

To state the relatively obvious, if you miss your cache when you do a
query/update, you've lost the war.  Everybody's game plan is to pack
the data pages as tightly as possible and keep your cache as hot as
possible.

And that may be the reason that NNTP has its own special purpose
solution that no general-purpose database can touch -- it knows so
much about what the data looks like that it can design data structures
that maintain a hotter cache than any general purpose database could.

That said, how much do you care about concurrency and recoverability?
They're hard programming problems to solve, and when you design your
own data structures instead of using a general model, then you have
to write your own threading and recovery code, and that stuff's hard.

--keith


Sent via Deja.com http://www.deja.com/
Before you buy.

Re: NoCeM & INN2.3
#41323
Author: Andrew
Date: Fri, 05 Nov 1999 00:00
28 lines
1995 bytes
In article <7vt6ij$h65$1@newssvr02.news.prodigy.com>, bill davidsen wrote:
>  I missed the part in the POSIX description which indicated that
>threads must be (or can't be) user level.

All threads in a process share those resources that belong to the process
as a whole, such as fds, file locks, current directory, etc., regardless
of whether they are "user level" or not.

>| If Linux has things called "threads" that don't share resources like file
>| descriptors, file locks, working directory etc., then they are nonstandard
>| and irrelevent to me.
>
>  The issue is that MIT style threads can have up to a max of one
>processor mini-scheduled between all threads, while kernel threads may
>have all CPUs in the system running various threads. The issue isn't
>resource sharing per se.

And this is relevent how?

I'm aware that Linux has some thread model that isn't standards-conforming,
but this doesn't mean that you can't have kernel-level threads that _do_
conform. 

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: NoCeM & INN2.3
#41325
Author: Andrew
Date: Fri, 05 Nov 1999 00:00
15 lines
1411 bytes
In article <7vva61$5rb$1@newssvr02.news.prodigy.com>, bill davidsen wrote:
>In article <slrn8247qu.42i.andrew+news@uk21.supernews.com>,
>| And this is relevent how?
>
>  See the two paragraphs you snipped which followed.

Those paragraphs were discussing user threads vs. kernel threads, an issue
which is completely orthogonal to the issue of why fcntl locks don't work
between threads of the same process.

-- 
Andrew, Supernews
http://www.supernews.com - UK and US individual and corporate NNTP services

Re: NoCeM & INN2.3
#41328
Author: Ed Mooring
Date: Fri, 05 Nov 1999 00:00
18 lines
1374 bytes
In article <8766zjyp0b.fsf@erlenstar.demon.co.uk>,
Andrew Gierth  <andrew@erlenstar.demon.co.uk> wrote:
>>>>>> "mooring" == mooring  <mooring@tymnet.com> writes:
>
> Path: ...!headwall.stanford.edu!newsbudd!not-for-mail
>
>Never heard of FQDNs?
>
>Is INN defaulting to unqualified hostnames in the path these days?
>I thought only the bCandid people were that stupid.

Nope. News administrator brain fault. INN did exactly what I told it to.
Only I didn't think I had told it to do that.
-- 
Regards,
Ed Mooring (mooring@tymnet.com 408-533-7504)

Re: INN history API (was: NoCeM & INN2.3)
#41330
Author: bill davidsen
Date: Fri, 05 Nov 1999 00:00
22 lines
1847 bytes
In article <ylu2n11w1m.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:

| I really wish I had more experience with concurrent programming.  I think
| I'm about to acquire a whole bunch.  :)  (I'm going to need to find a
| little toy threaded project to work on and compile on a few different
| platforms and thread libraries to get used to how this all works.  Think I
| have a few ideas that may be suitable for that.)

  Hopefully my other post on which errors may be hidden by which thread
models will be a starting point. I'm not sure I would trust the sanity
of writes in mmap() files all that much, which might be a portability
issue. The use of other IPC may or may not be required for safe
operation in a portable way.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: NoCeM & INN2.3
#41338
Author: bill davidsen
Date: Fri, 05 Nov 1999 00:00
21 lines
1639 bytes
In article <slrn8247qu.42i.andrew+news@uk21.supernews.com>,
Andrew <andrew@supernews.com> wrote:
| In article <7vt6ij$h65$1@newssvr02.news.prodigy.com>, bill davidsen wrote:

| >  The issue is that MIT style threads can have up to a max of one
| >processor mini-scheduled between all threads, while kernel threads may
| >have all CPUs in the system running various threads. The issue isn't
| >resource sharing per se.
| 
| And this is relevent how?

  See the two paragraphs you snipped which followed.
 	[ duplicate Linux-bashing snipped ]

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: NoCeM & INN2.3
#41348
Author: Kjetil Torgrim Homme
Date: Fri, 05 Nov 1999 00:00
13 lines
1193 bytes
[Mike Horwath]

>   Store each hour of IDs in file '0-24' within directory '0-a'
>   counting backwards based on directory '0' being today.
>   
>   When you need to expire, rm -fr.

I have articles several years old in my spool.


Kjetil T.

Re: NoCeM & INN2.3
#41344
Author: Alternative Fluffy
Date: Sat, 06 Nov 1999 00:00
23 lines
2244 bytes
> Russ Allbery <rra@stanford.edu> wrote:

>> Take a look at the binary search trees that innd builds.  I think I need
>> to continue supporting that in any rewrite, although I don't see any real
>> reason to use a tree; a binary search on an array should work just as
>> well.

Duh.  I see what you were talking about now, stuffing the header
buffer in the first place rather than searches on a built buffer.
That's why I didn't understand why you though it important.

I am using a binary search for that, with a lookup table to avoid the
expense of calculating the hops (is division still an expensive op on
modern hardware?  I haven't looked into that in the longest time).  I
extended that part over to the lookup function last night, with an eye
toward making named headers fast and simple to obtain in case someone
actually decides to implement the C filters discussed here recently.

Now I've just got to work out a couple of container structs so these
pointers sliced so many different ways don't make peoples' heads
explode.

Re: NoCeM & INN2.3
#41355
Author: Brian Edmonds
Date: Sun, 07 Nov 1999 00:00
26 lines
2923 bytes
Russ Allbery <rra@stanford.edu> writes:
> History cache:
> Reason                                                         Count     %Count
> Positive hits                                                5588236      60.0%
> Cache misses                                                 1416199      15.2%
> Negative hits                                                1376844      14.8%
> Do not exist                                                  938070      10.1%

Interesting.  I'm getting the following with a 4MB cache.  You might
want to try upping your cache size to see if it's really a difference in 
what we carry, or if your cache is a shade small (256kB you said).

History cache:
Reason                                                         Count     %Count
Positive hits                                                4514976      70.5%
Negative hits                                                1300716      20.3%
Do not exist                                                  491060       7.7%
Cache misses                                                   98675       1.5%

-- 
 o         Brian Edmonds <bedmonds@cs.ubc.ca>, Team Jubal Mech Labs
 \\_/\_,   Moderator: rec.arts.anime.creative, rec.music.info/reviews
(*)   (*)  Are you tired of spam?  Visit http://www.spam.abuse.net/spam/


Re: NoCeM & INN2.3
#41361
Author: bill davidsen
Date: Mon, 08 Nov 1999 00:00
28 lines
2071 bytes
In article <37puxmw69r.fsf@ryoko.cs.ubc.ca>,
Brian Edmonds  <bedmonds@cs.ubc.ca> wrote:

| Interesting.  I'm getting the following with a 4MB cache.  You might
| want to try upping your cache size to see if it's really a difference in 
| what we carry, or if your cache is a shade small (256kB you said).

  My impression is that the history lookup is fast enough that large
cache using the somewhat less efficient lookup would drop the misses but
not the lookup CPU time after the cache got larger than some value,
which the man page suggests to be order of 256k.

  I had a transit server which was spending a lot of time in history
lookup, and I upped the cache from 256k to 800k without visibly reducing
the average time per lookup. I did drop the percent of missed a bit, but
that's not a help if the lookup time doesn't get better.

  Do you have any numbers to show what your tradeoffs were in this area?
I presume you worked up to 4MB, and that you would go larger if it were
really a big win.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: NoCeM & INN2.3
#41370
Author: bill davidsen
Date: Mon, 08 Nov 1999 00:00
25 lines
1981 bytes
In article <slrn826g18.ln8.andrew+news@uk21.supernews.com>,
Andrew <andrew@supernews.com> wrote:
| In article <7vva61$5rb$1@newssvr02.news.prodigy.com>, bill davidsen wrote:
| >In article <slrn8247qu.42i.andrew+news@uk21.supernews.com>,
| >| And this is relevent how?
| >
| >  See the two paragraphs you snipped which followed.
| 
| Those paragraphs were discussing user threads vs. kernel threads, an issue
| which is completely orthogonal to the issue of why fcntl locks don't work
| between threads of the same process.

  I missed that there was an an issue, fcntl locks don't work, and I was
providing information I think is germane to deciding what to use instead
of fcntl. I assumed you were discussing solutions rather than just
lamenting the fact that fcntl isn't going to work, at least in any
portable way, and was trying to provide some useful background
information.
-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: NoCeM & INN2.3
#41371
Author: bill davidsen
Date: Mon, 08 Nov 1999 00:00
33 lines
2407 bytes
In article <yliu3gxvme.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:

| This works great for entries whose expiration you can predict in advance;
| the problem in supporting this scheme with INN is that INN historically
| has supported the very nice feature of being able to change your mind
| about your expiration times down the road.  You can tweak /remember/ or
| newsgroup expire times and have it retroactively affect all existing
| records.  It would be nice to preserve that.

  I looked at doing this and concluded that the solution was to build
files, like cycbuffs, with expiration times defined at article arrival
time. Then, if space gets tight, you can early expire articles, and have
a policy on that to preferentially that which you find least useful.

  In the case where you change your policy, and that can't easily be
done with CNFS anyway, you need to process each cycbuff before releasing
it, and copy articles which you want to save. That's the easy one. If
you want to expire faster you have to scan the cycbuffs and copy the
articles you want to save.

  This all sounds really bad, but when you consider how infrequently
most people change policy, and how fast you can scan a cycbuff when all
you parse is the newsgroup, it probably is more ugly than actually
expensive.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Page 1 of 2 • 56 total messages
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