Thread View: news.software.nntp
11 messages
11 total messages
Started by bill davidsen
Thu, 08 Jul 1999 00:00
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: bill davidsen
Date: Thu, 08 Jul 1999 00:00
Date: Thu, 08 Jul 1999 00:00
26 lines
2034 bytes
2034 bytes
In article <19990708084149.553$A8_-_@newsreader.com>, Curt Welch <curt@kcwc.com> wrote: | The way I balanced the flow to the spools (in my own server) is to | calculate the current rate news is flowing into each spool and using that | along with the spool's size calculate the current expected retention time | of each spool. I then use that number to decide which spool to put each | new incomming article into (the one with the longest current retention). | That keeps things nincely balanced even if you have different size spools | with different configurations. That would be a nice feature for INN, although it would tend to beat hell out of a new cycbuff when added. Although that's what you want to some extent. AFAIK the INN stuff is round robin, although I haven't checked the code. Using age of oldest article as a weighting factor would probably produce some desirable results. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc The Internet is not the fountain of youth, but some days it feels like the fountain of immaturity.
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: Curt Welch
Date: Fri, 09 Jul 1999 00:00
Date: Fri, 09 Jul 1999 00:00
88 lines
5856 bytes
5856 bytes
davidsen@tmr.com (bill davidsen) wrote: > In article <19990708084149.553$A8_-_@newsreader.com>, > Curt Welch <curt@kcwc.com> wrote: > > | The way I balanced the flow to the spools (in my own server) is to > | calculate the current rate news is flowing into each spool and using > | that along with the spool's size calculate the current expected > | retention time of each spool. I then use that number to decide which > | spool to put each new incomming article into (the one with the longest > | current retention). That keeps things nincely balanced even if you have > | different size spools with different configurations. > > That would be a nice feature for INN, although it would tend to beat > hell out of a new cycbuff when added. Although that's what you want to > some extent. I use the configured "max" size for the calculations, not the actual size. So new bufs don't get treated special - they act as if they are full from the minute you turn them on. Plus, the algorithm is to always put the next article into the buffer with the longest current expiration. If you used the actual size of a new buffer then it would look like a very small buffer, and therfor have a very short retention time. And that would force all the traffic into the other buffers leaving the new buffer unused. So that clearly wouldn't work. > AFAIK the INN stuff is round robin, although I haven't checked the code. > Using age of oldest article as a weighting factor would probably produce > some desirable results. I thought about that as well but after some examination of the idea I realized it had some real problems. If you use the age of the oldest article in a buffer which is holding 30 days of news, then you are putting new news into the buffer based on news flows that happened 30 days ago. That means that if you change something (say either in your incoming news stream or in the config of your spools) it could take a full 30 days to cycle though the buffers for the first time - and may take many many full cycles before it stabilizes (i.e. months). And depending on the actual algorithm it could actually oscillate forever (I think). For example, you have three bufs the same size. You use two to hold binary posts and one for text. You have 10 days retention in the text group and 2 days retention in the binary bufs. You decide to change one of the binary buffers into a "text" buffer. But since the algorithm is put new articles into the buffer with the oldest article (i.e. always overrite the oldest news first), all new incomming text articles continue to go into the old text buf for about the next 8 days (because the articles in the "new" text buf are only 2 days old). At that point, articles start going into both buffers, but most go into the "new" buf - because it takes a lot of text articles to overwrite each old binary article. This lopsided flow continues for the next two days until all the old binary files are overwritten with new text files. Then it switches agin. You have buf A with 20 days of text files, and buf B full of text files from the past 2 days - so now most text news starts going into first buf again. And this flip-flop flow pattern continues for who nows how long before it stabilizes. So, using the date of the oldest article in the buf to decide which buf to write an article to works nicely in the fact that it's always overwriting the oldest news (which is what you want from a logical perspective), but it causes "shock" waves to travel though your spools for days or weeks after you make a change and durring that time you end up with a very unbalanced I/O patterns to your disks (like bufs that don't get any new articles for 8 days in the above example). So, I decided to just go with the idea of measuring the current flow of news _into_ the buffers and balancing based on that (not by equalizing the flow but by first normalizing the flow based on the size of each buf so buffers that are twice the size get twice the incomming flow). If you change your config or change the news feeds then the flow into the buffers changes immediately instead of having to wait for weeks or months for things to stabilize. This always keeps your disk I/O nicely balanced which is normally more important on a news server. And with this algorithm you don't need to figure out what's in your spool or what's being overwritten - you just need to know it's size and keep track of the avg every time you write to it. The actual definition of "current flow" which I use is really an exponentially decaying average of past flows which counts something like the past 5 minutes as 50% of the avg. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: bill davidsen
Date: Fri, 09 Jul 1999 00:00
Date: Fri, 09 Jul 1999 00:00
125 lines
7514 bytes
7514 bytes
In article <19990708205106.164$l5@newsreader.com>, Curt Welch <curt@kcwc.com> wrote: | davidsen@tmr.com (bill davidsen) wrote: | > In article <19990708084149.553$A8_-_@newsreader.com>, | > Curt Welch <curt@kcwc.com> wrote: | > That would be a nice feature for INN, although it would tend to beat | > hell out of a new cycbuff when added. Although that's what you want to | > some extent. | | I use the configured "max" size for the calculations, not the actual | size. So new bufs don't get treated special - they act as if they | are full from the minute you turn them on. I'm not sure what you mean by max size. If you use a partition the size doesn't change, and if you use a file, unless you have a magic filesystem you would always precreate a full size file to ensure it's contiguous. At least on my systems the max size and the actual size are one and the same number. | Plus, the algorithm is to always put the next article into the buffer with | the longest current expiration. If you used the actual size of | a new buffer then it would look like a very small buffer, and therfor | have a very short retention time. And that would force all the traffic | into the other buffers leaving the new buffer unused. So that clearly | wouldn't work. Obviously if there is no data in a cycbuff you treat it as infinitely old, that's an obvious boundary condition check. If your logic is checking dates and there are none, I can't imagine what other date you would use. | > AFAIK the INN stuff is round robin, although I haven't checked the code. | > Using age of oldest article as a weighting factor would probably produce | > some desirable results. | | I thought about that as well but after some examination of the idea | I realized it had some real problems. If you use the age of the oldest | article in a buffer which is holding 30 days of news, then you are putting | new news into the buffer based on news flows that happened 30 days ago. | That means that if you change something (say either in your incoming news | stream or in the config of your spools) it could take a full 30 days to | cycle though the buffers for the first time - and may take many many full | cycles before it stabilizes (i.e. months). And depending on the actual | algorithm it could actually oscillate forever (I think). You have to use a weighting to determine which cycbuff to use. One factor would be age of oldest article, the other would be percent full (assuming 100% after the first wrap). Preferentially using a new cycbuff both spreads the reader load quickly and speeds the extension of effective retention period. Making an effort to keep the oldest article in all cycbuffs the same age lengthens the retention also, since the retention is the age of the youngest of the oldest articles (the date before which all articles are not available). By weighting the preferences any oscilation is damped and the system tends to remain near optimal. Given that optimal changes with each new article I think you can waste a lot of time chasing the goal. I want the disk rates to be within 10-15% on cycbuffs, and oldest date within minutes rather than days, but perfection is not the goal. | | For example, you have three bufs the same size. You use two to hold binary | posts and one for text. You have 10 days retention in the text group and 2 | days retention in the binary bufs. You decide to change one of the binary | buffers into a "text" buffer. Honestly, I can't imagine doing that. Adding more storage is a regular problem, but changing an existing cycbuff seems like an infrequent operation. Now watch 20 admins post that they do it weekly:-( | So, using the date of the oldest article in the buf to decide which buf to | write an article to works nicely in the fact that it's always overwriting | the oldest news (which is what you want from a logical perspective), but it | causes "shock" waves to travel though your spools for days or weeks after | you make a change and durring that time you end up with a very unbalanced | I/O patterns to your disks (like bufs that don't get any new articles for 8 | days in the above example). Honestly I've never moved a cycbuff from one metacycbuff to another, and I wouldn't bet a penny that the old data would be valid until I reread the code. | | So, I decided to just go with the idea of measuring the current flow of | news _into_ the buffers and balancing based on that (not by equalizing the | flow but by first normalizing the flow based on the size of each buf so | buffers that are twice the size get twice the incomming flow). If you | change your config or change the news feeds then the flow into the buffers | changes immediately instead of having to wait for weeks or months for | things to stabilize. This always keeps your disk I/O nicely balanced which | is normally more important on a news server. The reader i/o so vastly overwhelms the incoming i/o on most of my machines that I am not worried about balancing incoming i/o. And on a transit machine I probably have all the posts in a single metacycbuff, and the change would be to add storage, in which case I would want to put more new articles in the new cycbuff (no, not all the new articles) to get it up to speed quickly. The reader i/o rate is related to both the actual bytes in a cycbuff and the number of articles. In either case I probably want to get the new cycbuff in use fairly quickly. | And with this algorithm you don't need to figure out what's in your spool | or what's being overwritten - you just need to know it's size and keep | track of the avg every time you write to it. | | The actual definition of "current flow" which I use is really an | exponentially decaying average of past flows which counts something like | the past 5 minutes as 50% of the avg. I think your method is a clever solution, but I don't believe it optimizes the same things I think are most important. That doesn't make either of us wrong, we have different goals, and at least you have taken the time to generate a solution. If I get the time to do either a simulation or an implementation I might just try to equalize the number of articles in a cycbuff, since that is probably a useful predictor for either feed or read use. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc The Internet is not the fountain of youth, but some days it feels like the fountain of immaturity.
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: Katsuhiro Kondou
Date: Fri, 09 Jul 1999 00:00
Date: Fri, 09 Jul 1999 00:00
14 lines
1703 bytes
1703 bytes
In article <7m2uii$1j78$1@newssvr03-int.news.prodigy.com>, davidsen@tmr.com (bill davidsen) wrote; } AFAIK the INN stuff is round robin, although I haven't checked the code. } Using age of oldest article as a weighting factor would probably produce } some desirable results. Correct, if you run 2.2. As for 2.3, innd spools sequentially into cycbuff, and switches to the next cycbuff among metacycbuff, if it reaches the end. See cycbuff.conf(5). -- Katsuhiro Kondou
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: Curt Welch
Date: Fri, 09 Jul 1999 00:00
Date: Fri, 09 Jul 1999 00:00
146 lines
8714 bytes
8714 bytes
davidsen@tmr.com (bill davidsen) wrote: > I'm not sure what you mean by max size. If you use a partition the size > doesn't change, and if you use a file, unless you have a magic > filesystem you would always precreate a full size file to ensure it's > contiguous. At least on my systems the max size and the actual size are > one and the same number. I was talking about "max" size because my system works a bit differently. My spool files grow by adding articles to the end of them. I create new files when they reach 2GB or 1/10 the "defined" size of the spool. When the spool fills up, I remove the oldest file. So articles expire in large chunks. I don't precreate the files (they aren't cycbufs) so they start empty and then grow to full size. That's why I was thinking that way. BTW, I haven't done any testing, but I doubt the contiguous issue is a valid concern. The Berkeley file system allocates blocks in a fashion to minimize those types of problems. And though you write the files sequentialy, you seldom read them that way - so I suspect the pre-alocating the files to try and get them more continguous does little good. Pre-alocationg might be a big win because it prevents having to do the fs alocation work as you write - but not because of the contigous issue. At least that is my guess. > | Plus, the algorithm is to always put the next article into the buffer > | with the longest current expiration. If you used the actual size of > | a new buffer then it would look like a very small buffer, and therfor > | have a very short retention time. And that would force all the traffic > | into the other buffers leaving the new buffer unused. So that clearly > | wouldn't work. > > Obviously if there is no data in a cycbuff you treat it as infinitely > old, that's an obvious boundary condition check. If your logic is > checking dates and there are none, I can't imagine what other date you > would use. No that's has nothing to do with what I was thinking of. I don't use the actual age of the articles in the buffer at all. I calculate the "expected" retention based on the current rate of flow of data into the buffer and it's size. I was just talking about the issues of using the "current" size of the buffer (in my system where bufs start small when new). > | > AFAIK the INN stuff is round robin, although I haven't checked the > | > code. Using age of oldest article as a weighting factor would > | > probably produce some desirable results. > | > | I thought about that as well but after some examination of the idea > | I realized it had some real problems. If you use the age of the oldest > | article in a buffer which is holding 30 days of news, then you are > | putting new news into the buffer based on news flows that happened 30 > | days ago. That means that if you change something (say either in your > | incoming news stream or in the config of your spools) it could take a > | full 30 days to cycle though the buffers for the first time - and may > | take many many full cycles before it stabilizes (i.e. months). And > | depending on the actual algorithm it could actually oscillate forever > | (I think). > > You have to use a weighting to determine which cycbuff to use. One > factor would be age of oldest article, the other would be percent full > (assuming 100% after the first wrap). Sure, if you are using the age of the oldest article in you algorithm, then the obvious thing to do for a partially full buffer is to extrapelate a number based on the the actually age of the oldest article and the % full number. > Preferentially using a new cycbuff > both spreads the reader load quickly and speeds the extension of > effective retention period. Making an effort to keep the oldest article > in all cycbuffs the same age lengthens the retention also, Yes, that makes some sense for cycbufs. But in my system where 1/10 of the entire spool will vanish in 3 seconds - the concept of keeping the articles the same age is mostly impossible. So that's why I didn't bother with trying to optimize for that when I selected my algorithm. > By weighting the preferences any oscilation is damped and the system > tends to remain near optimal. Given that optimal changes with each new > article I think you can waste a lot of time chasing the goal. I want the > disk rates to be within 10-15% on cycbuffs, and oldest date within > minutes rather than days, but perfection is not the goal. > | > | For example, you have three bufs the same size. You use two to hold > | binary posts and one for text. You have 10 days retention in the text > | group and 2 days retention in the binary bufs. You decide to change > | one of the binary buffers into a "text" buffer. > > Honestly, I can't imagine doing that. Adding more storage is a regular > problem, but changing an existing cycbuff seems like an infrequent > operation. Now watch 20 admins post that they do it weekly:-( Yeah that's true. I picked the exmaple only as a good worse case to try and illustrate my point about potential problems with these types of algorithms. > | So, using the date of the oldest article in the buf to decide which buf > | to write an article to works nicely in the fact that it's always > | overwriting the oldest news (which is what you want from a logical > | perspective), but it causes "shock" waves to travel though your spools > | for days or weeks after you make a change and durring that time you end > | up with a very unbalanced I/O patterns to your disks (like bufs that > | don't get any new articles for 8 days in the above example). > > Honestly I've never moved a cycbuff from one metacycbuff to another, and > I wouldn't bet a penny that the old data would be valid until I reread > the code. I don't have inn 2.x around here anymore and my memory about how all that is configured is a bit gone at this point - so I was really talking about my system and assuming it applied to others - like INN. It might not. In my system, you have multiple spools. Each spool is a single directory which you tell the server to store up to N MB of articles in. For each spool, you define which articles you want to go in to it using the same complex language you use when defining feeds to other servers. At any time, you can change those definitions about which articles are being stored in which spool, and it has no effect on the old articles already stored there (other than the fact that it changes how quickly those old articles are being overwritten), but it has a big effect on where new articles are stored. You can also change the size of these spools at any time with no problem as well. Since there's none of that pre-allocation stuff going on, there's nothing complex about telling the system to allow more articles to be stored before removing old ones or telling it to remove a bunch of old ones to get the size down to something smaller. (i.e. you don't have to write a lot of special case code to deal with a size change - it just works). > I think your method is a clever solution, but I don't believe it > optimizes the same things I think are most important. Yeah, there's both the issue of what we may "want" (while will always be different for any two people) and what we may "think" is the most important when it comes to performace. Most of my major design decisions are based on gut instinct and not on testing. Testing is always good -- just not as fun :). -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: bill davidsen
Date: Mon, 12 Jul 1999 00:00
Date: Mon, 12 Jul 1999 00:00
27 lines
2050 bytes
2050 bytes
In article <7m3h7n$2hd$1@inn.do.mms.mt.nec.co.jp>, Katsuhiro Kondou <kondou@uxd.fc.nec.co.jp> wrote: | In article <7m2uii$1j78$1@newssvr03-int.news.prodigy.com>, | davidsen@tmr.com (bill davidsen) wrote; | | } AFAIK the INN stuff is round robin, although I haven't checked the code. | } Using age of oldest article as a weighting factor would probably produce | } some desirable results. | | Correct, if you run 2.2. As for 2.3, innd spools sequentially | into cycbuff, and switches to the next cycbuff among metacycbuff, | if it reaches the end. See cycbuff.conf(5). I'm not sure what you're saying here, it sounds as if you think the first cycbuff is filled before using the next, and since they all have about equal disk activity and a "newest" time of a few seconds ago, I belive each cycbuff is still used in order. Running 2.3-1999006-15 on that machine, so it could well have changed. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc The Internet is not the fountain of youth, but some days it feels like the fountain of immaturity.
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: bill davidsen
Date: Mon, 12 Jul 1999 00:00
Date: Mon, 12 Jul 1999 00:00
58 lines
3849 bytes
3849 bytes
In article <19990709174730.429$lS@newsreader.com>, Curt Welch <curt@kcwc.com> wrote: | davidsen@tmr.com (bill davidsen) wrote: | I don't precreate the files (they aren't cycbufs) so they start empty and | then grow to full size. That's why I was thinking that way. | | BTW, I haven't done any testing, but I doubt the contiguous issue is a | valid concern. The Berkeley file system allocates blocks in a fashion to | minimize those types of problems. And though you write the files | sequentialy, you seldom read them that way - so I suspect the pre-alocating | the files to try and get them more continguous does little good. | Pre-alocationg might be a big win because it prevents having to do the fs | alocation work as you write - but not because of the contigous issue. At | least that is my guess. I don't have a BSD system handy, but unless you have each spool on a separate device or at least filesystem I would worry that various categories of spool would interleave and result in extra or longer seeks. | > Preferentially using a new cycbuff | > both spreads the reader load quickly and speeds the extension of | > effective retention period. Making an effort to keep the oldest article | > in all cycbuffs the same age lengthens the retention also, | | Yes, that makes some sense for cycbufs. But in my system where 1/10 of the | entire spool will vanish in 3 seconds - the concept of keeping the articles | the same age is mostly impossible. So that's why I didn't bother with | trying to optimize for that when I selected my algorithm. Okay, totally unrelated approach. Back in inn-1.5 days I played with creating files in directories based on the expected expiration date at the time the article arrived. Reduced expire to "rm -rf" complexity, applied to the oldest directory. | In my system, you have multiple spools. Each spool is a single directory | which you tell the server to store up to N MB of articles in. For each | spool, you define which articles you want to go in to it using the same | complex language you use when defining feeds to other servers. | | At any time, you can change those definitions about which articles are | being stored in which spool, and it has no effect on the old articles | already stored there (other than the fact that it changes how quickly those | old articles are being overwritten), but it has a big effect on where new | articles are stored. Not unlike the INN behavior which allows you to assign articles to a given class, which can change. But in general this isn't a change in the policy for a class, just in what determined a member. The value for "oversize" keeps changing, for instance. -- bill davidsen <davidsen@tmr.com> CTO, TMR Associates, Inc The Internet is not the fountain of youth, but some days it feels like the fountain of immaturity.
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: Richard Michael Todd
Date: Mon, 12 Jul 1999 00:00
Date: Mon, 12 Jul 1999 00:00
23 lines
2004 bytes
2004 bytes
davidsen@tmr.com (bill davidsen) writes: > In article <7m3h7n$2hd$1@inn.do.mms.mt.nec.co.jp>, > Katsuhiro Kondou <kondou@uxd.fc.nec.co.jp> wrote: > | Correct, if you run 2.2. As for 2.3, innd spools sequentially > | into cycbuff, and switches to the next cycbuff among metacycbuff, > | if it reaches the end. See cycbuff.conf(5). > > I'm not sure what you're saying here, it sounds as if you think the > first cycbuff is filled before using the next, and since they all have > about equal disk activity and a "newest" time of a few seconds ago, I > belive each cycbuff is still used in order. Katsuhiro Kondou's statement was somewhat unclear. innd *can* spool sequentially, switching to each cycbuff when the previous cycbuff is full. But it won't do so unless you say, e.g. metacycbuff:MONGO:E1,E2,E3,E4,E5,E6,E7,E8,E9,E10,E11,E12,E13,E14:SEQUENTIAL in cycbuff.conf (note the SEQUENTIAL at the end). Without "SEQUENTIAL", innd writes to each cycbuff round-robin, as you've seen.
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: Russ Allbery
Date: Mon, 12 Jul 1999 00:00
Date: Mon, 12 Jul 1999 00:00
13 lines
1157 bytes
1157 bytes
bill davidsen <davidsen@tmr.com> writes: > Okay, totally unrelated approach. Back in inn-1.5 days I played with > creating files in directories based on the expected expiration date at > the time the article arrived. Reduced expire to "rm -rf" complexity, > applied to the oldest directory. Sounds like timehash. -- Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: Kjetil Torgrim Homme
Date: Wed, 14 Jul 1999 00:00
Date: Wed, 14 Jul 1999 00:00
30 lines
2137 bytes
2137 bytes
[Curt Welch] > BTW, I haven't done any testing, but I doubt the contiguous issue is a > valid concern. The Berkeley file system allocates blocks in a fashion to > minimize those types of problems. And though you write the files > sequentialy, you seldom read them that way - so I suspect the pre-alocating > the files to try and get them more continguous does little good. > Pre-alocationg might be a big win because it prevents having to do the fs > alocation work as you write - but not because of the contigous issue. At > least that is my guess. [bill davidsen] > I don't have a BSD system handy, but unless you have each spool on > a separate device or at least filesystem I would worry that > various categories of spool would interleave and result in extra > or longer seeks. If your users read a several categories of groups, you may find that temporal locality[1] is more important. Of course, this will probably get out of sync pretty quickly when the buffers cycle, but on Curt Welch' system, it sounds like a good idea. It will probably improve both write and read performance. Kjetil T.
Re: Balancing flow to spools (was: Re: Broadband news sever comparison)
Author: Curt Welch
Date: Wed, 14 Jul 1999 00:00
Date: Wed, 14 Jul 1999 00:00
18 lines
1734 bytes
1734 bytes
davidsen@tmr.com (bill davidsen) wrote: > I don't have a BSD system handy, but unless you have each spool on a > separate device or at least filesystem I would worry that various > categories of spool would interleave and result in extra or longer seeks. Yeah, in my system the typical config is to fill up each filesystem/device with one spool. Actually, what I have running right now is sets of 4 9GB drives striped together and that space is filled up with one spool for each set of 4 drives. To reduce damage caused by a drive failure it would be resonable to make each drive hold one spool. -- Curt Welch http://CurtWelch.Com/ curt@kcwc.com Webmaster for http://NewsReader.Com/
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads