Drop Menu Website Template
Image
image
image


Hello There, Guest! Register

Post Reply 
slow online cattery ?
07-15-2013, 07:40 AM
Post: #18
RE: slow online cattery ?
Off the top of my head, I'd suggest it's likely that timing is everything. Not just yours, but KC's, as well.

As a systems analyst I immediately think of two ways to implement a time-based function on my web site.

The simplest, and what is most likely the go-to method for most programmers, is to use what we call "a cron job". That is, we schedule something to run, in the background, on a regular basis. Say I want to implement the "Love clock". I decide that once-an-hour is good enough. I write a program to "tick" the "clock" for every cat in the Cattery. Then I tell "cron" to run that program once an hour. (Oh, where did that come from? Cron is a time-based job scheduler in Unix-like computer operating systems. The name cron comes from the Greek word for time: "chronos".)

Now, that program can't really update everything at once. Instead, it updates each cat, in turn. Say your first cat comes early in the list. And, your other cat comes quite a bit later. And, say, it takes 5 minutes to get from one to the other. In a simple implementation, I'd "tick" the first cat and record when that tick occurred. Then, 5 minutes later, I'd tick the second. See the problem? YOU may have birthed them just a second or two apart. But my cron-based program moved them 5 minutes apart. That's this hour. Next hour system load is a bit lower (nobody's hitting the web site!) and it only takes me 4 minutes to get to the second cat. But, my ticker looks and says, "Nope, not been an hour, yet (it's only been 59 minutes) .. you gots to wait." Oh oh! The first cat just ticked; but the second won't get the matching tick for ANOTHER HOUR! It's late at night, and loads will stay low for a long time, so the cats will be 1-tick apart. Now, if I'm smart, and if loads go up and it takes 6 minutes, that second cat will finally get two ticks at once; when it looks like 121 minutes of ticks needed, instead of only 119. But, then, that might never happen because some more cats could come along and the distance between your two cats gets longer and I'll NEVER see that I missed a tick and double-tick. Of course, if I don't check, I'll never see I missed a tick. And it's SO easy to just write a "If it's been a hour or more since the last tick, tick ONCE."

Do I have to do it that way? No. But it's easy.

If I'm willing to record a bunch of extra data with each cat, I could eliminate the need for the cron-based operation altogether. Let's face it, if you never look at the cat, you don't really CARE. So what if it "should" have produced a box last week? You never looked at the cats, or the boxes, so you don't KNOW. But you're pretty sure it "should" have happened. How do you know? You hit the web site. Well, I can do all the ticking and tocking and box production, the moment you actually look! (Hey .. yep .. it's Schrödinger's cat!)

That's a LOT of work for the programmer. But it's a net win for the server since it never does any work if you never look! And, done properly, it's always dead-accurate.

So, sure, it's entirely likely that, no matter the intention, if a cron-like process is behind it, there's probably some drifting going on, at least temporarily.
Visit this user's website Find all posts by this user
Quote this message in a reply
 Thanks given by: Devilness Chant
Post Reply 


Messages In This Thread
slow online cattery ? - ruby Tierbal - 07-08-2013, 01:44 PM
RE: slow online cattery ? - Cutie Rau - 07-08-2013, 09:19 PM
RE: slow online cattery ? - ruby Tierbal - 07-09-2013, 12:50 AM
RE: slow online cattery ? - Uzion Shim - 07-09-2013, 01:18 AM
RE: slow online cattery ? - Uzion Shim - 07-09-2013, 01:18 AM
RE: slow online cattery ? - Tad Carlucci - 07-09-2013, 04:42 AM
RE: slow online cattery ? - ruby Tierbal - 07-09-2013, 07:17 AM
RE: slow online cattery ? - Tad Carlucci - 07-09-2013, 07:37 AM
RE: slow online cattery ? - ruby Tierbal - 07-09-2013, 01:50 PM
RE: slow online cattery ? - ruby Tierbal - 07-13-2013, 12:39 AM
RE: slow online cattery ? - Tad Carlucci - 07-15-2013 07:40 AM
RE: slow online cattery ? - Tatiana Cheng - 07-15-2013, 07:44 AM
RE: slow online cattery ? - Tad Carlucci - 07-15-2013, 08:00 AM



User(s) browsing this thread: 1 Guest(s)