Article View: news.software.nntp
Article #41274Re: NoCeM & INN2.3
From: bostic
Date: Thu, 04 Nov 1999 00:00
Date: Thu, 04 Nov 1999 00:00
93 lines
5103 bytes
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.
Technical Details
Message-ID:
<7vqtad$u3u$1@nnrp1.deja.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailReferences:
<3819A774.9C57FDCA@boerde.de> <ylyachnwki.fsf@windlord.stanford.edu> <87u2n5wa1n.fsf@slip-32-100-243-27.ma.us.prserv.net> <yl66zlnugn.fsf@windlord.stanford.edu> <7vnkfo$cpt@bigred.inka.de> <ylg0yomrmj.fsf@windlord.stanford.edu> <7vpog2$2qm$1@nnrp1.deja.com> <slrn821emt.edk.andrew+news@uk21.supernews.com>Show Full Headers
Complete Article Headers
Message-ID: <7vqtad$u3u$1@nnrp1.deja.com> Subject: Re: NoCeM & INN2.3 Date: Thu, 04 Nov 1999 00:00:00 +0000 From: bostic@bostic.com References: <3819A774.9C57FDCA@boerde.de> <ylyachnwki.fsf@windlord.stanford.edu> <87u2n5wa1n.fsf@slip-32-100-243-27.ma.us.prserv.net> <yl66zlnugn.fsf@windlord.stanford.edu> <7vnkfo$cpt@bigred.inka.de> <ylg0yomrmj.fsf@windlord.stanford.edu> <7vpog2$2qm$1@nnrp1.deja.com> <slrn821emt.edk.andrew+news@uk21.supernews.com> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 544167593 X-Http-Proxy: 1.0 x40.deja.com:80 (Squid/1.1.22) for client 199.103.241.218 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Thu Nov 04 03:07:58 1999 GMT X-MyDeja-Info: XMYDJUIDbostic Newsgroups: news.software.nntp X-Http-User-Agent: Mozilla/4.04 [en] (X11; I; BSD/OS 4.0 i386)