Article View: news.software.nntp
Article #65598Re: Which is faster: retrieve article by article number, or by Msg-ID?
From: tl
Date: Mon, 02 Jun 2003 21:19
Date: Mon, 02 Jun 2003 21:19
61 lines
4387 bytes
4387 bytes
DS <t.h.i.s.n.t.h.a.t@a.d.e.l.p.h.i.a..n.e.t> wrote: >archiver@i3w.com (Juergen Helbing) wrote in news:59408.u53201 >@archiver.winews.net: ><SNIP> >> >> Tip: Never use 'head' and 'body' commands. Just 'article'. > >Why is this so ? Is 'body' slower to respond than 'article'? If I'm >d/l'g a multi-part of 50 part's, wouldn't it be easier to just fetch >the bodies for decoding and re-assembly, for the client side anyway. >Is there undo strain on the server in this case ? It wasn't spelled out directly but it's an implication of one of the earlier "commandments" you removed, always validate that you are getting the right article. The body of the article doesn't contain the information needed to verify that got the right article (Message ID), so it has to use either article or both head AND body commands, and then how do you know that the head and body you get are from the same article! (Some of the mechanism that could lead to servers doing this could easily lead to this, so it's a valid concern). The article command sidesteps that issue and even with full NNTP command pipelining it's probably slightly faster using one command. Without pipelining using head/body adds at least one RTT (could be a lot more if nagle is enabled) which can be a significant time period. If I may add one "commandment" it would be to do proper NNTP command pipelining, it MIGHT be necessary to allow it to be turned on/off for individual news servers. I think it could be set to default on but it does call for some experimentation with more obscure servers first... With NNTP command pipelining I'm talking about sending new commands before receiving the result of the previous command, it complicates the client slightly but greatly improves the performance with large round-trip times! The reason for this is two-fold, it avoids downtime AND it also allows the TCP window to extend (since there aren't large pauses where the window is emptied)! This makes it much less necessary to use large number of connections, it's unlikely that many connections would be needed if the program does this! Unless there are per-stream bandwidth limitations it's likely that two would be plenty even at fairly high speeds (unless the server is dead slow, then they can blame themself when they get 10+ connections from each client :-). There ARE a few commands that can't be pipelined (implicit in the standard), and at least one that shouldn't be pipelined because INN is breaking the standard (mode reader discards text, it would be possible to fix but IIRC they've never bothered). IIRC it was the auth commands, perhaps post? and the traditional feed commands which couldn't be pipelined. Mostly those commands doesn't need to be pipelined anyway, so it's usually not a big problem in practice. Note that this feature makes it even more vital to verify that the server is sending back the right articles, but if one thinks a bit before actually starting to code it shouldn't be that hard to set up a good pipelining code which will also detect "broken" servers and fall back to fetching articles without pipelining!
Technical Details
Message-ID:
<HbPCa.1055024$YZ.166836@news.easynews.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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!peernews-us.colt.net!newsfeed.news2me.com!newsfeed2.easynews.com!easynews.com!easynews!easynews-local!news.easynews.com.POSTED!not-for-mailReferences:
<npf9dvsun1hdqbplg77evm6hsmd9nusdrf@4ax.com> <59408.u53201@archiver.winews.net> <Xns938E5EF3912B2idispcom@24.48.107.54>Show Full Headers
Complete Article Headers
Message-ID: <HbPCa.1055024$YZ.166836@news.easynews.com> Subject: Re: Which is faster: retrieve article by article number, or by Msg-ID? Date: Mon, 02 Jun 2003 21:19:35 GMT From: tl <tl-NOSPAM@nospam.cd.chalmers.se.invalid> References: <npf9dvsun1hdqbplg77evm6hsmd9nusdrf@4ax.com> <59408.u53201@archiver.winews.net> <Xns938E5EF3912B2idispcom@24.48.107.54> 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!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!peernews-us.colt.net!newsfeed.news2me.com!newsfeed2.easynews.com!easynews.com!easynews!easynews-local!news.easynews.com.POSTED!not-for-mail Newsgroups: news.software.nntp X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Lines: 60 X-Complaints-To: abuse@easynews.com Organization: EasyNews, UseNet made Easy! - Test our service with our FREE trial at https://www.easynews.com/trial/trial.phtml X-Complaints-Info: Please be sure to forward a copy of ALL headers otherwise we will be unable to process your complaint properly.