Article View: news.software.nntp
Article #38575Re: Submitting to Freenix
From: Chris Sedore
Date: Sat, 10 Jul 1999 00:00
Date: Sat, 10 Jul 1999 00:00
111 lines
5857 bytes
5857 bytes
bill davidsen wrote in message <7lu3k8$2m0a$1@newssvr03-int.news.prodigy.com>... >In article <9303290311991906734-1@dp-news.maxwell.syr.edu>, >Chris Sedore <cmsedore@maxwell.syr.edu> wrote: > >| Threads are not the only possibility: async IO can provide an alternative >| design methodology. > >But it doesn't scale. I can add more processors a lot more easily than I >can make the current processor N times faster, and I get fewer context >switches because at least some of the time I don't have to preempt one >cpu from a task to do another. Well, that depends on a couple factors. At 2 processors, aio can function nicely by essentially putting the process on one and the kernel on the other--in my experience, the "kernel processor" will be the bottleneck here, so scalability gets questionable somewhere between 2 and 3 processors (assuming that your kernel can run on more than one processor--if it can't, you'll probably run out of capacity to run the kernel before running out of userland time in a single thread). With well written aio code and good kernel threads, you simply run a thread per processor to get around the scalability problem. Carefully designed aio code can be converted to multithreaded aio code without too much difficulty. That said, there still is a penalty to going threaded because you've got to mutex some things, so it isn't a complete win. >| I've seen peaks of 360 incoming articles/second, and it is just loafing at >| 50-70 articles per second.. This machine is a 512MB PII-400, so it isn't >| puny hardware. Just one disk (system and spool) and a single full-duplex >| 100Mbit link. > >I'm certainly interested, assuming that this process generates enough >tracks. one of the problems I face is that non-INN solutions don't >always leave a good audit trail. INN babbles enough to add measurable >overhead, but I can always tell if and when I got a message-id, if >someone else offered it to me later, and to which queues it was added. > >This saves more time placating management than debugging, but it's >useful for both. This isn't too difficult to address, though some of us would want it to be setable. I don't pay quite that level of attention to news flows, and would be happy not to pay the CPU and IO price for that level of detail. >| As Joe correclty pointed out (in a part trimmed), you have to be careful wrt >| threads packages. FreeBSD's threads are userland wrappers around select(), >| etc and they really won't do anything significant to improve the situation. >| I believe Linux is in this boat also. (Both offer kernel threads, but the >| implementations are a bit immature and suffer from other problems). > >You could probably find a user level threads for Linux, but it isn't in >any of the regular libraries which use the kernel threads. I don't know >about maturity, all the posix threads apps I have work as I got them. Well last I looked at Linux kernel threads (about 6-8 months ago), they were the ugly stepchildren. I (ahem) keep waiting for Unix to catch up with NT on this front. I know that FreeBSD (and think that Linux) threads are actually just processes that share vm and fds. This is somewhat less efficient that true threads. I'll have to look again at Linux. >| One other area worth noting is select(). Select becomes considerably less >| efficient as more connections are added to check. For the aio routines >| (which are not as efficient as I hope they will eventually be), there is a >| crossover at about 40 descriptors where it becomes faster to use aio >| routines over select. The crossover is FreeBSD specific, but I suspect it >| holds true for any OS that implements select() by running through the >| descriptor table and setting a flag for each. > >The whole select() thing is a can of worms, in many cases the call >returns multiple sockets ready and the application has to take steps to >do scheduling and avoid poor response to some sockets. Threads would >help this a good bit if properly done. I actually think that many of the >systems do kernel threads well, so this may be a non-issue. This is actually a good thing from an efficiency standpoint. Response/scheduling problems are probably more a result of blocking calls in the processing loop that happens after a socket has been flagged than because of select(). You have to have quite a number of descriptors to select() with a non-blocking loop before I would expect scheduling to be a major problem (like 300-400). >I played with splitting innd with fork() for certain operations, and the >overhead was well worth it using SMP. The reliability and portability >were what you expect in a proof of concept, but I did see enough to >suggest that gains can be made. I've thought about modifying innd so that just the article writes were done with aio. This might be doable and should resolve the scheduling problem, modulo this new overview scheme which would require a fair bit more work for the same result. -Chris
Technical Details
Message-ID:
<931605626-1026466000-1@dp-news.maxwell.syr.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> <ylg13gyawh.fsf@windlord.stanford.edu> <3773780d$0$374@news.execpc.com> <9303290311991906734-1@dp-news.maxwell.syr.edu> <7lu3k8$2m0a$1@newssvr03-int.news.prodigy.com>Show Full Headers
Complete Article Headers
Message-ID: <931605626-1026466000-1@dp-news.maxwell.syr.edu> Subject: Re: Submitting to Freenix Date: Sat, 10 Jul 1999 00:00:00 +0000 From: "Chris Sedore" <cmsedore@maxwell.syr.edu> References: <7g24e7$ckh$1@info.cs.uofs.edu> <ylg13gyawh.fsf@windlord.stanford.edu> <3773780d$0$374@news.execpc.com> <9303290311991906734-1@dp-news.maxwell.syr.edu> <7lu3k8$2m0a$1@newssvr03-int.news.prodigy.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: 499427882 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Newsgroups: news.software.nntp