Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have an Wordpress website with more than 219k of posts, and everytime when I publish something my CPU/MySQL usage go to 100%.

I really don't know why, because my entire website stay on 6% all day of usage and only spikes at a new post is published.

Yes, I use w3 super cache, but the problem is on the wp-admin itself! I've used the mysqltuner for optimizing the MySQL... But, like I already said, the problem only occurs when a new post is published.

I use two clouds on Amazon AWS for hosting the blog. The MySQL cloud is m1.medium and the Web Server is m1.xlarge.

Here is the graphics of my CPU's, as you can see, I have spikes at the same time on both clouds... These spikes occurs exactly on the time when I publish a new post. The green line is the MySQL and the blue line is the Web server.

Here you can see the graphic: http://i.stack.imgur.com/PReQP.png

If no one can help me with this situation, please, I want something to "inspectate" the code... The entire scruture of Wordpress is so ugly that I can't understand how new posts works. I want to debug the queries/functions or something like that.

Thanks!

share|improve this question

migrated from stackoverflow.com Aug 7 '12 at 7:54

This question came from our site for professional and enthusiast programmers.

    
"something" will never replace the human "someone" –  Dagon Jul 24 '12 at 19:49
    
MySQL has some logging abilities, don't know if you can access these? dev.mysql.com/doc/refman/5.1/en/slow-query-log.html Certainly will be easier to start looking at MySQL rather than WP. –  contrebis Jul 24 '12 at 20:45
    
@contrebis But on the slow queries only have "SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts WHERE 1=1 AND wp_posts..."! :-( –  Gabriel Lopes Jul 25 '12 at 4:00

1 Answer 1

Assuming you have used mysqltuner well, the problem may well lie in the data storage hardware.

Presumably your MySQL instance is saving data to on an EBS volume. There are at least two issues you're facing:

  • EBS is slow
  • Medium instances have relatively slow IO performance compared to large instances. EBS needs good IO performance.

Try measuring the file system performance of the EBS volume where your MySQL data is stored, using something like iozone. When I did that a few weeks back, the performance of an EBS volume mounted to a small instance was about half as good as a single hard drive on my laptop.

You can improve EBS performance by striping multiple EBS volumes into a software raid configuration

http://www.mysqlperformanceblog.com/2009/08/06/ec2ebs-single-and-raid-volumes-io-bencmark/

http://dodizzle.com/setting-up-software-raid-zero-over-8-volumes

Moving your MySQL instance to Large or better gives you much more memory as well as better IO performance. I would try creating a software RAID first, and then consider moving to a larger instance. Note that you actually may be able to step down Wordpress from an xlarge to a large instance if you tune the data layer well.

share|improve this answer
    
Hey Eric, thanks for commenting! So, you say the problem can be the EBS volumes, right? I will try to tune the volumes, but I think the problem is on the Wordpress! Because the website stay calm and fast everytime and the CPU usage only grow up when I publish/edit a post... What should I do? :-( –  Gabriel Lopes Jul 25 '12 at 17:12
    
I suspect the problem is with the EBS volumes based on the information you provided :-) When the website is calm, most of the data rows needed are probably in RAM (cache) of the MySQL instance or in the Wordpress cache. –  Eric J. Jul 25 '12 at 17:43
    
I found the problem! Was the plugin "Wordtwit PRO"! I will find what is the problem with the plugin and post here! Thank-you Eric! :-) –  Gabriel Lopes Jul 25 '12 at 19:52

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.