Report this

What is the reason for this report?

MySql is much slower on docker than setting it up on bare VPS

Posted on July 25, 2020

What could I do to solve this problem? My backend call to sql just to do a pagination of 1000 data delay up to 5.6 second. This is insane for production.



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.

Hi there @oudamsith,

I’ve seen similar problems in the past, one solution worked quite well for me as described here:

  • First disable writing barrier for the ext4 fs:
  1. sudo nano /etc/fstab
  • Your configuration would look see something like this:
UUID=b87de212-52ca-4600-9e30-6e80e24df1ed / ext4 errors=remount-ro 0 1
  • You need to add barrier=0:
UUID=b87de212-52ca-4600-9e30-6e80e24df1ed / ext4 errors=remount-ro,barrier=0 0 1
  • Finally you have to reboot your server.

Another thing that you could do is use the MySQLtunner script to test your SQL instance and adjust your settings:

https://www.digitalocean.com/community/questions/how-to-tweak-mysql-mariadb-configuration-for-increased-performance-and-stability

Regards, Bobby

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.