Article View: news.software.nntp
Article #38273Re: News server architecture (was: Submitting to Freenix)
From: Russ Allbery
Date: Sat, 26 Jun 1999 00:00
Date: Sat, 26 Jun 1999 00:00
211 lines
11401 bytes
11401 bytes
Changing the subject to something more appropriate.... Joe Greco <jgreco@ns.sol.net> writes: > In my experience, that's not true... and I ran things like MD5-based > article storage and CNFS before most of the rest of the world had even > heard of them. This is, of course, not with current revisions, but my > experiences did do a great job of pointing out architectural flaws (and > innd-timer was part of all that). Speaking of which, the timer is one of the main things that I'm worried about losing in a threaded design, just because it's so *incredibly* useful. It'll need a redesign to cope with threads, though, and I'm not sure of the best architecture for it.... But thank you for that. It's one of the single best features of INN, and routinely makes people working on other (non-Usenet) pieces of large server software extremely envious. My colleagues who are working on LDAP servers would *love* to have something similar. > First off, I will (of course) immediately concede that a good design > with real threads would beat either Diablo or INN quite easily. *nod* I think that's pretty obvious to everyone at this point, for transit. I think it's a lot less obvious for readers; I still am of the opinion that a forking nnrpd is going to be comparable in speed to a threaded nnrpd for most purposes. (And yes, this is a partial reversal of my previous attitude towards threads. Working with them and thinking through threaded designs some more has taught me the error of my previous ways.) > I still feel that a model like INN's, for incoming news, is inadequate > particularly for large-scale applications. It is simply unable to take > advantage of multiple CPU's, and unable to provide for things such as > disk I/O concurrency - instead replacing that with _blocking_ (even if > just for a few hundredths of a second) while writing an article. Yeah, this is true. Multiple CPUs aren't particularly interesting to me personally (I'm just not likely to be able to scrouge multi-CPU boxes for news, plus news really isn't CPU-bound), but not being able to take advantage of disk I/O concurrency is a catastrophy in some configurations. headwall.stanford.edu, for example, is connected to an array of 30 2GB disk drives and is theoretically capable of writing to some large number (possibly all; I haven't checked out the specs on an SSA recently) of those disks simultaneously. INN definitely isn't taking advantage of this. (On the other hand, article write is definitely *not* the bottleneck for that server; the Perl filter is the major one, because it's only a SPARC 20, and most of the rest of the time is spent in writing to the history file.) > This probably isn't interesting for your average site with three or four > feeds, but in my experience is a bad thing when you've got two hundred > inbound connections active to fifty peers. Granted. Writeback cache for your disks can help there, though. > Let's see. I'm handling an average of ten articles per second. The > machine in question can do ten thousand cxw per second. I would tend to > think that the disk write (at a few milliseconds) would kill you worse > than a cxw that takes well under a millisecond. Let's talk about how to > eliminate/optimize that disk write instead. ;-) Oh, yes, granted, the real gain comes from avoiding the disk write. I have no disagreement with that. My argument is that when comparing INN with Diablo, both of which do the disk write, the context switches are more of a factor. But I also admit that I'm looking at things from an INN perspective, and Diablo has made a lot of other good decisions that give it more ability to take advantage of hardware concurrency than INN. > Irrelevant. The "disk effects" are causing the whole thing to suck... > remember, the OS has a limited amount of TCP buffer, so every time it > fills while INN is off doing something else (serving another stream, > writing to disk, etc) that feed stalls until the select loop hits that > thread and reads that data. Except that if you have to do the disk write, you have to do the disk write, and if the disk write is dominating your performance, it's going to be doing so whether you're running in multiple processes or just in one. You can't keep accepting articles you can't write out to disk, so you have to slow down the whole system to the speed of the disk writes. The advantage you get from multiple processes doing the writes is that if your I/O system can handle concurrency, the disk writes go faster. And I'll grant that. > In _my_ experience, I've rarely seen an innd with 40% idle. Again, that > is with inn1.4* and things like CNFS or MD5. I'm pleased to hear it if > things are better today, It's not entirely clear how much better they are, since I don't have a lot of experience outside of my own to draw on and I give my news servers the kind of hardware that they need. :) (Which isn't the same as just dumping lots of money into them; I tend to be able to do quite well on cast-off hardware these days since everyone's doing to 9GB disk drives and news servers, particularly for transit, *really* like *lots* of 2GB disks.) I also don't store or propagate a full binary feed. Never have, never will. It's a waste of resources. So that alters the picture a great deal, I do understand, as lots of large binaries are a very different load pattern from lots of small articles. And ISPs don't have the luxury I have to put their feet down and say no. > but regardless, you can still max out a current INN by either flooding > it with connections or putting a real slow (i.e. substantially less than > what you need) disk subsystem on it. A Diablo under the same load > should fare much better. Disk subsystem, I'll grant. I've heard tales of Diablo forking itself to death with a large number of incoming connections, which certainly isn't going to happen to INN (sans readers). > You are welcome to discuss how the whole car sucks. I guess I don't > care. I'm pleased that the engine works well even if the rest of the > car does not work well. I like rebuilding cars and the engine is > important to me. With a good engine, I have a shot at building a car > you approve of. Oh, yeah, I grant that. It's really hard to compare servers on individual points when the easy performance numbers to get are for the whole thing and each server takes radically different approaches with veyr different tradeoffs. >> For a really fast transit server, you want innfeed running as a thread >> inside innd, which then just hands it a buffer that it blats out to all >> your peers at the same time that another thread is writing it out to >> disk. > Yup. We are in violent agreement here. But then you have Cyclone, not > INN. Well, yes and no. You can still do UUCP, you can still do regular news batches, you still have an embedded Perl filter, it's still free software.... :) I'll take your word for it, having never run Cyclone. I don't have any idea what its internal structure is like, apart from the fact that it obviously uses threads. But I'd say it's immediately obvious to anyone who's ever worked on news software that as soon as you have threads, you stop doing a write between taking an article in and sending it out. > Again, I agree. However, I feel that Diablo _today_ provides a better > inbound news handling capability than INN _today_ does - and this is > simply an architectural matter, because Diablo today is closer to that > threaded model we'd both like to see. It has multiple processes that > handle peers and write data, all independently, and therefore makes good > use of an SMP system in the same manner as a threaded news system. Okay, I'll grant that. I suppose to some degree that argues that I should go spend my time working on Diablo because it's already closer to the architecture that I think we're going to end up with. I guess I just have a soft spot in my heart for INN; I've run it for years and years, I understand it, I know how it's laid out, and I like how parts of it work. > This is a bit of an apples/oranges comparison. You shouldn't really use > IPC to move entire articles around... we've all seen that this sucks > from the nice filter API provided by Cyclone (which I coded into > Diablo). Heh. :) I remember when people were trying to tell me that IPC was just fine for spam filters and that INN wasn't getting any real advantages from having the filter embedded. > I don't think IPC is too bad if you're planning on using it to provide > minimal amounts of information, and it is a very well-tested and very > portable technology - unlike threads and to a lesser extent shared > memory. This is certainly true. I'm thinking more and more about the argument that any redesign of INN's architecture should abstract out those communication pieces so that one can plug in threading, shared memory, UDP sockets with multiple processes, or whatever else you want. I don't know how hard that would be to do, but it does sound very nice. > Now, would I pay to see it all replaced with a threaded solution? Of > course I would. But it'd have to be real (kernel) threads, not some > userland thread library that simply wraps all calls to be non-blocking > I/O but is still in reality just a single single-threaded process Well, sure. > The INN you are describing, a few years down the road, does sound very > appealing, and very much like the Cyclone of today. If and when it > happens, I'll certainly be among the first to consider switching back > and dumping development time into INN again. Until that is imminent, > though, I've just got too little faith in the architecture of INN, and > would rather use an architecture that can scale better even if it is > only half as efficient as a threaded model could be. Fair enough. :) > You don't know how many times I've thought about going off in a corner > and writing my own news transit engine... I guess that's what I'm talking about doing, just starting with INN. But like I said, this is something I plan on working on over the next few years; there are other things that need to happen to INN first. The source base has accumulated years worth of dirt here and there and needs a good cleaning, the conversion to autoconf needs to be finished, and the documentation could stand some major improvements. -- Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
Technical Details
Message-ID:
<yl3dzfto2l.fsf_-_@windlord.stanford.edu>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:
<7g24e7$ckh$1@info.cs.uofs.edu> <yl3dzg28yw.fsf@windlord.stanford.edu> <37731731$0$374@news.execpc.com> <ylg13gyawh.fsf@windlord.stanford.edu> <3773780d$0$374@news.execpc.com>Show Full Headers
Complete Article Headers
Message-ID: <yl3dzfto2l.fsf_-_@windlord.stanford.edu> Subject: Re: News server architecture (was: Submitting to Freenix) Date: Sat, 26 Jun 1999 00:00:00 +0000 From: Russ Allbery <rra@stanford.edu> References: <7g24e7$ckh$1@info.cs.uofs.edu> <yl3dzg28yw.fsf@windlord.stanford.edu> <37731731$0$374@news.execpc.com> <ylg13gyawh.fsf@windlord.stanford.edu> <3773780d$0$374@news.execpc.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: 494065205 Organization: The Eyrie Newsgroups: news.software.nntp