My server has been dropping to it’s knees (with less than 50 concurrent users which should never happen) and as a result i’ve been doing a lot of troubleshooting and performance tuning. MySQL process starts to spike at 500%+ and then once loads get’s around 10 average it’s keeps going. Around 35 load average the server is frozen and i have to sent a request to softlayer to manually reboot into single user mode with ssh to slowing start up the services again.
I’ve discovered hundreds of long running my sql queries from 15-40 seconds long. The primary culprit is this one
mysql> SELECT wp_sfposts.post_id, post_content, DATE_SUB(post_date, INTERVAL 2 HOUR) as post_date, wp_sfposts.topic_id, wp_sfposts.forum_id, wp_sfposts.user_id, guest_name, post_status, post_index, forum_name, forum_slug, group_id, topic_name, topic_slug, wp_sftopics.post_count, display_name FROM wp_sfposts JOIN wp_sfforums ON wp_sfforums.forum_id = wp_sfposts.forum_id JOIN wp_sftopics ON wp_sftopics.topic_id = wp_sfposts.topic_id LEFT JOIN wp_sfmembers ON wp_sfmembers.user_id = wp_sfposts.user_id WHERE wp_sfforums.forum_rss_private = 0 AND wp_sfposts.forum_id IN (2,3,4,7,8,9,10,11,12) ORDER BY wp_sfposts.post_id DESC LIMIT 15;
What does this code do? Where is it called from? How can i fix this?
Web site: http://www.fantasyfootballxtreme.com/forums (rather large forum compared to many of your installs i believe)
Environement
———————–
| Simple:Press |
Version: 5.1.3 Build: 8972 Release: Release |
|
| WordPress |
Version: 3.4.1 Language: en-US Character Set: UTF-8 Theme: |
|
| PHP |
Version: 5.2.12 Memory: 128M Max Upload: 6M Timeout: |
|
| MySQL |
Version: 5.0.95 Prefix: wp_ |
|
| Server | Version: Apache/2.2.14 (Unix) mod_ssl/2.2.14 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 mod_perl/2.0.4 Perl/v5.8.8 | |
| WP Plugins |
Add Link to Facebook (1.163) Akismet (2.5.6) Gold Cart for WP e-Commerce (2.9.7) Google XML Sitemaps (3.2.8) Newsletters (3.9.1) Peter’s Login Redirect (2.5.3) runPHP (2.3.1) Simple:Press (5.1.3) SN FFX – Admin Panel (1.0.0) Sports Notion System (1.0.0) WP e-Commerce (3.8.8.3) WPSC Members Access (2.0) WP Super Cache (1.1) |
|
| SP Plugins |
Admin Bar (1.1.1) Editor QuickTags BBCode (1.1.1) Editor TinyMCE Rich Text (1.2) Post Ratings (1.1.3) Private Message System (1.2.1) Profanity Filter (1.1.1) Profile Display Control (1.0.2) Prune Database (1.0.2) Report Post (1.1.2) Subscriptions (1.1.3) Watches (1.1.3) Who’s Online (1.1.3) |