Report this

What is the reason for this report?

WordPress going offline for some minutes in some database-intensive activities

Posted on October 22, 2018

Hi,

I am using a WordPress droplet for this website: Trovalost.it

but when I try to do some MySQL-intensive activities (i.e editing more than a post, or fixing links in web pages) sometimes MySQL goes offline. I looked in /var/log/mysql/error.log but it looks empty, so no idea about what problem I need to solve.

Looked inside /etc/mysql/mysql.conf.d/mysqld.cnf and it is ok for log ON.

/var/log/mysql/mysql-slow.log is empty too.

Any hint for this?



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

What do you mean by MySQL goes offline? What error do you get on the page? Is it a “freeze” of pages or an actual DB error connection?

If the DB is actually shutdown, you should be able to see a shutdown/startup in the error log. Otherwise I’d suspect your DB engine is MyISAM, which does table level locks (vs row-level locks) on the whole table and makes editing posts simultaneously not possible.

Run these commands to get a feel of things:

mysql -u root -e "show table status" unixy_whmcs1|grep -i myisam

If you get many MyISAM tables, it’s probably time to switch to InnoDB.

Cheers

Yes I’d definitely switch to InnoDB. This issue would go away. Here’s a quick one liner:

mysql -u root -e "show tables" <my_db> | while read tbl; do echo mysql -u root -e "alter table ${tbl} engine=InnoDB" <my_db>; done

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.