1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

URGENT Help Required: Site closed by Web host due to a SQL query

Discussion in 'General Troubleshooting' started by nothingman, Oct 29, 2013.

  1. nothingman

    nothingman Active Member

    My site was closed down today by my Web host as there's a query that is causing an overhead on the database. The following is the said query and the message sent by my Web host. Could someone please help? :(

     
  2. valMETNG

    valMETNG Moderator Staff Member

    374,132 comments? Sounds like you have some interactive users :)

    From my search through the code, it appears that statement is likely coming from /plugins/comments/comment_manager_settings.php, potentially lines 227, 235, 243, or 272. Although there is a LIMIT to the rows returned (19680), you're effectively looking at each row. Alan would probably know better if caching would help but your success might be a message to take your website to the next level (i.e., out of shared hosting and into your own server). Regardless, perhaps you should be patting yourself on the back; after all, it's a good problem to have when you've outgrown shared hosting :)
     
    nothingman likes this.
  3. nothingman

    nothingman Active Member

    Thanks for replying valMETNG. Do you mean /content/plugins/comment_manager/comment_manager_settings.php instead as I don't see any comment_manager_settings.php file in the comments plugin folder. Also could there be a quick fix for this? E.g Disable the comment manager via the database? :confused:

    I wish I could afford moving to a dedicated host but then this site is a hobby and not something with which I earn a living - I simply cannot afford a dedicated host. :)
     
  4. valMETNG

    valMETNG Moderator Staff Member

    Apologies. You are correct - the file is in content/plugins/comment_manager. Yes, you could certainly uninstall the comments manager plugin, assuming you don't use it for anything (e.g., approving or deleting comments). If you needed to manually approve or delete comments, you could probably do that right in the database (i.e., the comment_status column in the comments table). Although, even manually doing things in the database requires SQL queries be run, which is all the comment manager is doing.

    Having said that, and with all due respect to financial concerns, I wouldn't think finding a shared hosting provider who will allow a query like that to be too hard to find. You might want to reach out to someone like Hostmonster (and, full disclosure: clicking on this link gives me credit if you sign up). As far as I know, they don't have any limits on queries and their pricing is, IMO, very affordable ($3.95/month, which includes the domain name). I've been with many different hosting providers and I find their support the best in the business. I think I've been with them almost a decade.
     
  5. nothingman

    nothingman Active Member

    Thanks for replying again, valMETNG.

    Yeah, I figured it out with the line numbers you mentioned. Would it be OK to just comment out the lines for now - I don't have access to the database for now and I've sent a reply to my Web host and let's see what their reply is.

    Really appreciate your suggestion. The host I am with is Godaddy and well it has been a good ride till date (5 years to be precise). Some things that has made me stick with Godaddy - I know they don't get much love in 'webmaster' forums - are their prompt service (well, they have set up a help center in India) and the freedom of them letting me use Net banking (that's what we call it here - direct bank transfer) instead of CCs.

    Nonetheless, thanks a ton for your answers!
     
  6. valMETNG

    valMETNG Moderator Staff Member

    Indeed, you'll get no love from me for GoDaddy. I think they're beyond awful (not to mention morally challenged).

    As far as commenting out the lines, I doubt that would work if the plugin is installed. The rest of the plugin will be looking for the results of that query, so you'd likely generate PHP errors. I would guess you'd have to customize the code (and potentially other, ancillary plugins) to prevent the errors.

    Also pretty crazy you don't have access to the database (even through something like phpMyAdmin). I don't see why you wouldn't be able to use something like SQLyog to access the database directly. I would think GoDaddy has the ability to remote into the database, and SQLyog is a free client-side tool that allows you to do that.
     
  7. nothingman

    nothingman Active Member

    I was able to access my hosting account and the databases of sites on my subdomain. However, what really ticked me off was them turning off the database without warning me at first. Anyway, I had to promise them that I would disable the comment manager plugin and they have restored the database and my site is UP now.

    Thanks much for helping out :)
     
  8. shibuya246

    shibuya246 Hotaru Developer Staff Member Admin

    I will look at this plugin and see what can be changed to avoid the problem. It seems the problem is one of pagination collecting all the records before it needs them. Since pagination is used in other places it may not be easy to change it just for this one plugin.

    The solution of turning this plugin off for the moment is a good one and the reason why Hotaru CMS is built on many plugins rather than having everything hard coded in the core

    Thanks to everyone for advice on this and other issues
     
    nothingman likes this.

Share This Page