Friday, September 05, 2008

That was Fast, Part Duo

Now that the message boards are running so incredibly fast, I've started taking a look at some other regularly recorded slow queries and putting some effort into fixing those up. The speed improvements can be just as dramatic, but you won't notice them nearly as much since they tend to be on rarely visited pages or when you run a rarely used command. (Relatively speaking, of course.)

Out of curiosity, I pulled up the stats from last month. In August, the message.html page (used to read or scan multiple messages at a time) was hit 379,824 times while the message.html page (used to read messages one at a time) registered one at a time got 282,833 hits for a total of 662,657 hits.

Almost every one of these page hits would have required at least 1,000 milliseconds to run at any given time, sometimes considerably longer during heavy loads, but lets assume 1,000 milliseconds is a good average. That's one full second.

Which means for the database to generate 662,657 message board pages, it would have required 662,657 seconds to do so. Seeing as there are 60 seconds in a minute, that's equivalent to 11044 minutes. And since there are 60 minutes in an hour, that would be equivalent to 184 hours. And since everyone knows there are 24 hours in a day, that amounts to 7.7 days.

So last month, if the sever on Atlas Quest did nothing but generate those 662,657 pages one at a time, non-stop, it would have taken 7.7 days. There were only 31 days last month. That's a heck of a lot of server time going to the message boards when you consider AQ also needed to serve up clues, profiles, AQ mail, yadda, yadda, yadda. Not surprising really that things were starting to come to a boiling point.

Now the message board pages are disgustingly fast. They seem to be averaging about 10 milliseconds per page, or about 1/100th of a second. So to process 662,657 message board pages would now require about 1.8 hours of processing time.

From 7.7 days to 1.8 hours. Yeah, I'd say that's an improvement. =)

And I should apologize.... That stolen one or two seconds every time you tried to load a new message board page added up to a wasted 7.7 days for you guys. Sitting there waiting for the database to do its thing and figure out which message you were trying to view. So collectively, you all now have an extra 7.6 or so days to FIND MORE LETTERBOXES this month! =) And every month from here on out. You're welcome. ;o)


Anonymous said...

Yea!!!!! Good work, Ryan, And it really is fast, zippy in fact! Wow, congratulations, guy! Wasted days and wasted nights....da da da. Freddy Fender.

Not any more!! Well, maybe, but not from sitting here waiting on a page to upload, anyway.
You go, guy!!

Anonymous said...

I sure wish I could get our family email server admins to take some lessons from you! You rock!

Anonymous said...

You're awesome Ryan!!

♥ Lady Lilac