English flagItalian flagKorean flagChinese (Simplified) flagPortuguese flagGerman flagFrench flag
Spanish flagJapanese flagArabic flagRussian flagGreek flagDutch flagBulgarian flag
Czech flagCroat flagDanish flagFinnish flagHindi flagPolish flagRumanian flag
Swedish flagNorwegian flag     
By N2H
Welcome to Raph Koster's personal website: MMOs, gaming, writing, art, music, books.

The blog is back…

October 31st, 2008

Once again, excessive CPU on SQL queries. Read on for the pain…

So, first off, Bluehost did tick me off by simply shutting off my whole account. No warning. No FTP access. No cPanel. Nothing. So there was no way to even diagnose what had gone wrong, without calling them. So I call them, and get a recording saying “sorry, we’re closed for the holiday, until 2:30pm.” Closed for Halloween? During the middle of the day? Uh…

At 2:30pm mountain time, i called them, and got access to the logs, PHPMyAdmin, and cPanel. With that, i went to take a look at the logs. And what I saw was this query, over and over and over.

SELECT * , IF( DATE_ADD( link_updated, INTERVAL 120
MINUTE ) >= NOW( ) , 1, 0 ) AS recently_updated, UNIX_TIMESTAMP( link_updated ) AS link_updated_f
FROM wp_links
INNER JOIN wp_term_relationships AS tr ON ( wp_links.link_id = tr.object_id )
INNER JOIN wp_term_taxonomy AS tt ON tt.term_taxonomy_id = tr.term_taxonomy_id
WHERE 1 =1
AND link_visible = 'Y'
AND (
tt.term_id =17
)
AND taxonomy = 'link_category'
ORDER BY link_name ASC
LIMIT 0 , 30

This query — which is right there on the front page, I suspect — was taking 2 seconds. Putting that in PHPmyAdmin revealed that it pulls up some of the link list. A quick search of Wordpress.org revealed this link, which recommended indexing the table. I did so, and also optimized all the tables, and the query time fell to 2/100ths of a second. With that, BlueHost was willing to open up the site again. They also switched me over to FastCGI, so keep an eye out for any stuff that seems like it ought to work and doesn’t.

So we’re back. But this is getting old…

*

You can follow any responses to this entry through the RSS 2.0 feed. Responses are currently closed, but you can trackback from your own site.

10 Responses to “The blog is back…”

Jump to reader comments » | Leave a reply »

Trackbacks & Pingbacks
Reader Comments
  1. Morgan Ramsay said on

    I thought you were going to move your website over to the Metaplace servers? I don’t know why you continue to put up with BlueHost’s crap. Any hosted services provider worth their weight in gold wouldn’t have given you as much grief.

  2. Billy said on

    Since your blog is mostly text have you considered just hosting it wordpress.com and letting them deal with the hosting issues?
    Granted it wouldn’t “flow” with the rest of the site, but maybe you could just grab the rss feeds and display them.

  3. Arrakiv said on

    Hrm, one of the sites I’m running currently is using BlueHost. We’ve had some issues in the past too – but nothing as serious as what you’ve been going through (of course, we also don’t get the traffic you do either :-P ). This is probably good to know.

  4. Ryan said on

    Wow, guy, that is ridiculous. With so many great options available out there for reliable hosting, there is no way I would stay with a web host after more than one such incident, if even that. Taking a customer completely offline and leaving them that way, knowing that you will have no support staff available to clear the matter up, is unforgivable. With so many available options I think I’d start shopping around after they shut me down the first time. I’m sure you have your reasons for sticking with them, though.

    My $0.02

  5. Raph said on

    Inertia.

  6. Michael Chui said on

    Wordpress doesn’t automatically index the tables they use…? That’s… stupid. Or is this a plugin developer’s incompetence? It’s a blog. Everything should be indexed. :/

  7. Morgan Ramsay said on

    Michael Chui:

    Wordpress doesn’t automatically index the tables they use…? That’s… stupid.

    I don’t know whether that’s true, but there is a great cron plugin called WP-Crontrol. I combine that plugin with WordPress Database Backup, but I’m sure one can write a plugin to index and optimize the database on a regular basis.

  8. Eaglewing said on

    To celebrate that the blog is back, I’ve put all your posts from August till today into Wordle:

  9. Eaglewing said on

    Hmm.. it ate the link. Try again : http://www.wordle.net/gallery/wrdl/283795/Raph_Koster_Blog

  10. Michael Chui said on

    I like how “world”, “game”, and “people” are the same size. :P

Meta

Recent Comments

Categories

Tags

Recent Trackbacks

Archives



A Theory of Fun
for Game Design

Book cover for A Theory of Fun for Game Design, by Raph Koster

Press
Excerpts

Buy from Amazon

Twitter @raphkoster


The whole Web

Raph's Website

See popular posts »
About the blog »



After the Flood

After the Flood CD Cover

Available on CD
$14.99


More stuff to buy

Alligator and Penguin Mug

Alligator and Penguin
Large Mug

$13.99


Receive CafePress Updates!

LegendMUD

click here to visit the Legend website

"The world the way they thought it was..."


Get Firefox