Whenever we upload & publish news, the server load will spike. and When 2 or 3 of them upload news at the same time, the server will hang for a few minutes (Internal Server Error) and then back to normal again.
Every time I publish or update a post in Wordpress there is a huge CPU spike due to MYSQL
I have deactivated plugins and themes, and the problem persists.
Every thing else on the site is very fast when there is high traffic. We tried increasing the server no luck.
Any help would be greatly appreciated!
Droplet Info: Ubuntu 16.04.1 x64 Size: 6 vCPUs 16GB / 160GB Disk MYSQL
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Thanks Kalin for the reply.
Will implement the above MySQL Optimizations for wordpress ! Will revert back with the update!
Any other articles or methods can you suggest for optimizing MYSQL.
Regards Prashanth
Hi @jayaprash,
This seems to be a problem with the Database. Whenever you create/upload new posts/media your WordPress application creates queries to insert the data in the DB. Now, whether there are too many queries that are being executed or it’s just one query that takes a long time to do so, I’ll recommend contacting a Web Developer to optimize them.
Another thing you can do, is to try and optimize MySQL and turn on slow query log. That way, you should be able to see the exact query that’s taking so long to execute.
I have a couple of queries that have saved me in the past, maybe you can try them as well
These queries shouldn’t actually delete any data in use or create problems. Nevertheless, I’ll recommend backing up your DB before you execute them.
It’s not 100% guarantee they will do the trick but for sure they will remove redundant data.
Kind regards, Kalin