Support » Fixing WordPress » DreamHost wants me to shut off a query

  • I don’t know why my blog always has these sorts of problems… I got the following message from DreamHost support:

    I’ve temporarily disabled your database because you are running a query that is hitting the database too hard.

    Please prevent the following query from running:

    SELECT alas_posts.*, MAX(comment_date) AS max_comment_date FROM
    alas_comments, alas_posts WHERE alas_posts.post_date <= ‘2005-07-19
    13:38:31′ AND ( alas_posts.post_status = ‘publish’ OR
    alas_posts.post_status = ‘sticky’ ) AND alas_posts.post_password = ” AND
    alas_posts.ID = alas_comments.comment_post_ID AND
    alas_comments.comment_approved = ‘1’ GROUP BY alas_posts.ID ORDER BY
    max_comment_date DESC LIMIT 0, 20;

    Once you have done that, please contact support, informing them that you have disabled that query, and they will reenable your database. Please refer them to this message.

    Here’s the problem: I haven’t the slightest clue what they’re talking about or how to shut a particular query off. If I’ve been runing that query, I haven’t been doing it on purpose.

    Clearly, Dreamhost doesn’t like something about my WordPress blog, but I don’t understand what to change, or even how I can change anything when they’ve shut off my access to WordPress completely.

    If anyone has encountered this problem before or has suggestions, or directions on how I can shut that query down, I’d really appreciate advice. Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • That looks like some sort of “latest comment” plugin.

    To shut off a particular query, find out the plugin that uses it, and disable it.

    I hear so many negative comments about “latest comment” in regard with its burdening the database server. Don’t you guys?

    Moderator James Huff


    Volunteer Moderator

    Yes, there is a particular “latest comment” plugin that is famous for taking down sites, there is also an archives-related plugin, but I’m not sure what its specific function was.

    albeit underoptimized, this is a simple query. if your host can’t handle it, change hosts.

    Hosts IS the problem.
    I am familiar with the ampersand install – I restored the database recently. That blog runs nothing known to be high on loads.

    Two days ago someone posted here that Bluehost had said the SQL backup was invalid, so she had no database to restore. Utter junk – it worked perfectly.

    This is not the first thread concerning Dreamhost.

    Powweb have also been the subject of emails to this forum.

    All 3 are on the Hosting page here.
    I would like to think that each host – because this will be a reciprocal deal somewhere – would give better information and at least notify Matt that there have been problems.

    I would not like to think that they see WP as a ‘cash cow’ and so can dump anyone that uses even the tiniest bit more resources than they have budgeted for on what could well be overcrowded servers.

    Thread Starter ampersand


    I’ve shut off the “recently commented posts” list (generated using the “customizable post listings” plugin) and gotten my account turned on again, for now. I’m planning to experiment with smaller lists (I was listing the 20 most recently commented posts), and a longer list on a separate page (so it isn’t loaded every time the blog is loaded), and see if that helps. If it does, I’ll post on this thread saying so, in case anyone runs into this problem again.

    I can’t do without the recently commented list, because my blog is very discussion-oriented – there are currently 37,628 reader comments in the database, many of them very long – and the recently commented list is what enables readers to keep up with active posts.

    I chose DH because they were on the “recommended hosts” WordPress page; I was hoping that a host with more WP experience would be more helpful and supportive when problems came up.

    Try this one, it has a buit-in cache:

    and you can easily get the recently comment posts by customizing one of the two xslt files (just remove the parts related to the comments).

    Moderator James Huff


    Volunteer Moderator

    The problem with the recent comment plugin in question is that it runs a datbase query to re-generate the list whenever it is viewed, this can be very taxing on a server. Denis’ plugin simply queries the database only once when a new comment is made, and stores the results in a cached file (at least, I think that’s how it works), so this is by far preferred and significantly less taxing on the server.

    Thread Starter ampersand


    Does anyone know for certain if Denis’ plugin queries the database every time a new comment is made (which would be ideal), or does it do so on a set time period (once every half-hour or fifteen minutes or something), which would be less ideal for my purposes? Different people have told me different things, and I’m not code-literate enough to look and figure it out myself.

    I think it’s a bit of both. It does something like this:

    When someone visits the page, the query is made and the results are cached. From then on, until the cache expires (after an hour by default) or is manually cleaned, the plugin output is served from the cache.

    Every time someone posts a comment, the cache is emptied, so the list will be regenerated on the next page load.

    If you only want the cache rebuilt when a comment is posted/edited/deleted (etc.), then set $sem_recent_comments_cache_timeout to something high (in seconds).

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘DreamHost wants me to shut off a query’ is closed to new replies.