hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Hosting Security and Technology : Wordpress SQL Query Crashes Server .. Logged everything!
Reply

Forum Jump

Wordpress SQL Query Crashes Server .. Logged everything!

Reply Post New Thread In Hosting Security and Technology Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 10-23-2010, 08:55 AM
sOliver sOliver is offline
Junior Guru Wannabe
 
Join Date: Jan 2008
Posts: 77

Wordpress SQL Query Crashes Server .. Logged everything!


Hi,I've got a problem and need some help. If you are familiar with administrating a server with wordpress+supercache you might know the problem.

Problem: Some SQL queries crash my server on specific times. Starting at 8AM and then couple of times during the day.

CENTOS 5.5 i686
WHM 11.26.20
Wordpress 3.01
Plugin: Wp-Supercache (Important)


Since this problem occurred I've been logging everything.

Time of occurrence: Starting at 8AM!!
During night no problems. Then at 8AM EST mysql.slow.log is starting to log slow queries. This happened on two days in a row now starting at 8:02.04 and 8:04:36.

SQL Queries
I find a lot of the long queries in my database: SELECT SELECT
Code:
SQL_CALC_FOUND_ROWS distinct wordpress_posts.* FROM wordpress_posts  LEFT JOIN wordpress_term_relationships ON (wordpress_posts.ID = wordpress_term_relationships.object_id)  LEFT JOIN wordpress_term_taxonomy ON wordpress_term_taxonomy.term_taxonomy_id = wordpress_term_relationships.term_taxonomy_id WHERE 1=1  AND wordpress_posts.post_type = 'post' AND (wordpress_posts.post_status = 'publish') AND NOT EXISTS (SELECT * FROM wordpress_term_relationships JOIN wordpress_term_taxonomy ON wordpress_term_taxonomy.term_taxonomy_id = wordpress_term_relationships.term_taxonomy_id WHERE wordpress_term_relationships.object_id = wordpress_posts.ID AND wordpress_term_taxonomy.term_id IN (8) ) AND TIMESTAMPDIFF(MINUTE, wordpress_posts.post_date_gmt, '2010-10-23 12:02:01') > 600   ORDER BY wordpress_posts.post_date DESC LIMIT 0, 10;

Is there a trigger for the problem?
Yes, I might be able to trigger it. This could be a coincidence, but a couple times now the SQL server crashed when I saved a Wordpress Draft.


Apache Error Log at same time: Keep in mind I did not request that graceful restart.

Code:
[Sat Oct 23 08:00:13 2010] [error] [client 112.206.31.187] (36)File name too long: access to /wp-includes/js/thickbox/thickboxion:"yes",encode:"yes".................

[Sat Oct 23 08:01:19 2010] [notice] Graceful restart requested, doing restart

[Sat Oct 23 08:01:26 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)

[Sat Oct 23 08:01:26 2010] [notice] Apache/2.2.16 (Unix) mod_ssl/2.2.16 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 PHP/5.2.9 configured -- resuming normal operations

[Sat Oct 23 08:01:38 2010] [error] [client 72.135.102.154] PHP Fatal error:  Call to a member function get() on a non-object in /public_html/wp-includes/cache.php on line 93

[Sat Oct 23 08:03:15 2010] [error] [client 188.214.4.38] PHP Fatal error:  Call to a member function get() on a non-object in /wp-includes/cache.php on line 93

[Sat Oct 23 08:08:07 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)

[Sat Oct 23 08:08:07 2010] [notice] suEXEC mechanism enabled (wrapper: /usr/local/apache/bin/suexec)

[Sat Oct 23 08:08:07 2010] [notice] ModSecurity for Apache/2.5.12 (http://www.modsecurity.org/) configured.

[Sat Oct 23 08:08:08 2010] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)

[Sat Oct 23 08:08:08 2010] [warn] pid file /usr/local/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?


I disabled a lot of plugins and cleaned the wordpress_options table. However, I did not update ANY plugins and this worked for months, so why should it start making problems now?

What troubles me is the fact that mysql.slow.log started to log slow queries over 1s at almost the same time for two days in a row? Coincidence? Someone exploiting a vulnerability?

I am very grateful for any help or ideas how to solve this.

__________________
RLTT.com is for SALE Realtime Technologies is the way to go !



Sponsored Links
  #2  
Old 10-23-2010, 09:22 AM
sOliver sOliver is offline
Junior Guru Wannabe
 
Join Date: Jan 2008
Posts: 77
I might have the solution, I am pretty sure. As discussed here the plugin Advanced Category Exclude is causing a lot of problems:
http://osdir.com/ml/wordpress-hacker.../msg00237.html

Although I haven't changed anything in months, I did post something and used the Advanced Category Excluder to exclude a post...

This plugin might be causing all the problems. Looks like plugins can really cause a lot of trouble. At least my site is now blazing fast again.

My tip: Clean out wordpress-options and disable ALL plugins that are not 100% required. Seriously, I will think twice about activating any plugin now.

__________________
RLTT.com is for SALE Realtime Technologies is the way to go !

  #3  
Old 10-23-2010, 05:02 PM
plumsauce plumsauce is offline
******* Unleaded
 
Join Date: Feb 2004
Posts: 3,825
The query itself is a monster. It *might* be accepted into production by a dba, but only under the most pressing circumstances and only after every avenue to avoid it had been exhausted.

The problem with wordpress plugins is that not all of them are well written. Some enthusiast throws something together to achieve a particular personal requirement, and then publishes it. Others come along and grab it without any thought as to whether it might be good code.

__________________
edgedirector.com
managed dns global failover and load balance (gslb)
exactstate.com
uptime report for webhostingtalk.com

Sponsored Links
Reply

Similar Threads
Thread Thread Starter Forum Replies Last Post
Best hosting option: requirements - asp.net, sql server, wordpress wandana Web Hosting 2 05-16-2008 02:13 PM
SQL query help? Amish_Geek Programming Discussion 10 06-28-2006 01:26 PM
Server eventually crashes when I'm performing lots of sql queries? crEA-tEch Programming Discussion 2 04-28-2004 05:30 PM
SQL query zoid Programming Discussion 2 09-20-2003 08:56 PM
What happens if your Server crashes, or HD Crashes, in ColoCation RunOfTheMill Web Hosting 7 08-06-2001 02:19 PM

Related posts from TheWhir.com
Title Type Date Posted
WPTouch WordPress Plugin Vulnerability Allows Non-Admins to Take Over Website Web Hosting News 2014-07-14 16:17:19
Media Temple, Pagely Introduce New Features to WordPress Hosting Plans Web Hosting News 2014-05-09 15:42:13
Media Temple Launches Premium WordPress Hosting for Designers, Web Developers Web Hosting News 2014-03-04 14:24:41
DreamHost Launches Managed WordPress Service DreamPress Web Hosting News 2013-06-04 11:44:33
The Host Group Launches Enhanced WordPress Hosting Plans Web Hosting News 2014-05-23 15:46:54


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
Postbit Selector

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?