Article View: news.software.nntp
Article #38269Re: Submitting to Freenix
From: Joe Greco
Date: Fri, 25 Jun 1999 00:00
Date: Fri, 25 Jun 1999 00:00
156 lines
9187 bytes
9187 bytes
In news.software.nntp article <ylg13gyawh.fsf@windlord.stanford.edu>, Russ Allbery <rra@stanford.edu> wrote: :Joe Greco <jgreco@ns.sol.net> writes: :> I'm willing to bet otherwise, unless INN has suddenly become radically :> different than in the days of 1.4*. INN essentially causes I/O streams :> to sleep while it is busy doing other things (like serving other streams :> and waiting on disk I/O). This performs poorly on a single-CPU system, :> and sucks rocks on a SMP system where your other CPU could be doing :> something useful like accepting data, but isn't. : :Oh, you'll definitely get throughput improvements with multiple processes. :I just don't find that problem particularly interesting, since in my :experience INN without overview has more than enough throughput to spare, :and with overview writing overview becomes the overwhelming problem and :nothing else is worth optimizing. 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). First off, I will (of course) immediately concede that a good design with real threads would beat either Diablo or INN quite easily. 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. 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. :What multiple processes aren't going to help with is *latency*, except :possibly in the case of a large number of large articles (and splitting :your incoming feeds will fix that for small articles, although large :articles are still going to be slow). And doing those context switches is :going to hurt your latency for small articles fairly badly, I think. 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. ;-) :> INN really loses while trying to read a large binary article from a :> peer. You get this "Read TCP buffered data... do something else... :> read TCP buffered data... do something else" behaviour that might be OK :> if you have a lot of innd main loop idle time, but really stinks if you :> are only coming around the full set of select file descriptors every :> five or ten seconds. : :I've never seen innd without tons of main loop idle time. I don't think :I've seen it drop below 40% idle even when it's taking in 75 articles a :second. Maybe on traditional spool, but then your disk effects are :dominating, not your TCP reads. 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. 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, 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. :>> Diablo already does something like this; I believe Matt's said in the :>> past that he doesn't really care about getting the last bit of latency :>> and that his process model isn't really designed for it. : :> What "isn't designed for it" is the outbound feeding system in Diablo. :> The inbound is fantastic for handling incoming news... or, at least, I :> can't point out any inefficiencies. : :Well, yeah, but you need both. Latency is how fast you can turn articles :around. 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. :Both INN and Diablo suffer from the fact that they're doing IPC :and context switching to get an article out the door. INN is also writing :the article to disk and then reading it back in again, which really sucks. Diablo is too. I think we are in violent agreement here. ;-) :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. :> Realistically, though, the context switching isn't a problem. My two- :> CPU Diablo boxes do a thousand per second with enough spare CPU to run :> RC5 at 90% of one CPU. I get twice as many interrupts per second as I :> do cxw's. : :It's not just the context switches; it's sharing data. Threading innd by :itself is going to improve matters, but probably not drastically. :Threading innfeed, ditto. But once they're both threaded, there's no :reason not to just run them as the same process, and then transit becomes :*blazingly* fast. 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. The fact that it uses heavyweight processes to do this means that there is some waste, but given a really busy transit server with lots of connections, my money is on Diablo. For now. :I got a 17% improvement out of INN's Perl filters just by not doing a :needless copy of the article. Using IPC to talk to another daemon is :*two* needless copies, through kernel space no less. Now you can :duplicate the same effect in shared memory, but between shared memory and :threads I'd really rather write threads. 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). 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. 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 - which is unable to use SMP effectively. We are coming into an age where most UNIX variants either support this or will support it soon. 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. You don't know how many times I've thought about going off in a corner and writing my own news transit engine... ... JG
Technical Details
Message-ID:
<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-mailReferences:
<7g24e7$ckh$1@info.cs.uofs.edu> <yl3dzg28yw.fsf@windlord.stanford.edu> <37731731$0$374@news.execpc.com> <ylg13gyawh.fsf@windlord.stanford.edu>Show Full Headers
Complete Article Headers
Message-ID: <3773780d$0$374@news.execpc.com> Subject: Re: Submitting to Freenix Date: Fri, 25 Jun 1999 00:00:00 +0000 From: jgreco@ns.sol.net (Joe Greco) References: <7g24e7$ckh$1@info.cs.uofs.edu> <yl3dzg28yw.fsf@windlord.stanford.edu> <37731731$0$374@news.execpc.com> <ylg13gyawh.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-mail X-Deja-AN: 493751166 Sender: jgreco@earth.execpc.com X-Trace: nreader1.newsops.execpc.com 930314253 374 jgreco@169.207.16.1 Organization: sol.net Network Services - Milwaukee, WI Newsgroups: news.software.nntp X-Complaints-To: abuse@execpc.com