Ryan Explains Fix To HBO Slowness
Blogmeister Ryan:
(For the truly nerdy out there, what I found this morning was two
queries that
took 18 seconds each to execute - this function was being
triggered every 2 minutes to fill out the “recent comments” list in the
sidebar box and the “latest comments” thread. The new code collapses
that function into one 94ms query. Heh.) Once the change is in place, we’ll need to run a quick update script
to re-save all existing comments. While that’s running, you may notice
a few quirks in comment counts and the “recent comments” lists, but
then everything should be good to go.
Full post below
.
CindyH: I like it when Ryan talks nerdy :-)
OK, I believe we should have a fix. I’ll need to wait until morning to apply it, as it’s a nontrivial change to our code, and you don’t do that when the server admin is out of cell phone contact for the next 3 hours ;)
For now, I’ll leave the “Latest Comments” box in the sidebar disabled, as that should keep the regular blog and blogpost pages from triggering the problem. This wasn’t a traffic-related issue at all, it was an inefficient database query.
(For the truly nerdy out there, what I found this morning was two queries that took 18 seconds each to execute - this function was being triggered every 2 minutes to fill out the “recent comments” list in the sidebar box and the “latest comments” thread. The new code collapses that function into one 94ms query. Heh.)
Once the change is in place, we’ll need to run a quick update script to re-save all existing comments. While that’s running, you may notice a few quirks in comment counts and the “recent comments” lists, but then everything should be good to go.
* This story was originally published as a post from the blog "Huckleberries Online." Read all stories from this blog