MySQL is slower than it probably should be

September 26, 2019 443 views

We are planning to migrate our multi-website (one hosting, multiple websites) system from shared hosting to DO but got stuck at slow database speeds. Our current hosting DB selects 2000 rows from table in around 100ms while on DO it takes around 180ms (compared to 3ms on local nvme drive :O). Upgrading / switching to optimized droplets does not help at all. We tried to use MySQL 8, 5.7 and also MariaDB 10.1 with the same result.

This is causing the frontpage for our websites to be 40% slower than usual. Also AWS is running fast. Any ideas? We love DO that’s why we would like to use it.

1 Answer

Hi @lamka02sk,

Just upgrading your droplet might not help if you have set some limits to your configuration file. You might need to edit your my.cnf file so that everything suits your needs.

If you are wondering what values to use, there are some tools to help you out. One that I use is MySQLTunner

Additionally, I’ll suggest you to create a slow query log for your MySQL/MariaDB instance and see if there are any queries causing this slowness.

Kind regards,

Have another answer? Share your knowledge.

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