Question

Managed DB become very very slow

Posted March 9, 2020 6.9k views
DigitalOcean Managed MySQL Database

When I connect my Laravel Application using the localhost MySQL then it’s work very fast.
But when I do connect my Application to the Managed DB, it’s become 5 times slower.
I really wants to use the managed DB but not slower of course.

2 comments
  • Same issue here… it’s about 20 times less slower… it takes 75ms in average to fetch a single row by primary key from one table with 10 (small) columns.

    Locally it’s 4 milliseconds. I cannot believe there is SOOO much latency ?!

    Or is it the performance, settings tweaking not optimal on their side ?

    I will switch tomorrow for another provider, will do some tests to find which managed DB provider has the best performance.

  • This is terrible. I cannot believe that Digital Ocean still hasn’t responded with a solution. Surely everyone must be considering to nolonger use Managed DB when the latency is this poor!

    We have just experienced terrible latency on the Managed DB mysql setup.

    50second to 1.3min latency when we have a basic load. we never had this problem when running mysql on a droplet directly.

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.

×
Submit an Answer
5 answers

Hello @shahinKazi,

I liked your questions. There are so many people out there who has similar types of questions regarding database performance.

In your case I think it would be worth to look into improving latency of your database. There is no problem with Managed DB or un-managed DB. Only difference is in managed DB, engineers from DO will take care of your DB server. But it’s already optimized. Improving performance is stuff that you need to tweak by yourself.

But few things I need to mention here.

  • In localhost, there is near 0ms latency. That’s why it’s working well there I hope.
  • Try to launch your DB with high-availability settings (multi zone) or in the zone where your application is also hosted. It will improve much better.

Also I would like to request you to visit https://www.digitalocean.com/docs/databases/mysql/how-to/monitor-databases/ to understand performance metrics by DO for their managed DB.

Hope, it'ill help.

  • Thank you @ShahariaAzam

    Both DO Managed DB and My Droplet is in same zone.

    The Query is same.

    The issue is that,
    Once I do connect the self hosted / localhost MySQL then it’s performing very good and once Managed D it’s too poor.

    Question is, why Managed DB is performing poor performance and I’m considering here the latency of course.

    So How could I get the same performance as my localhost / self hosted Mysql do.

    • Ok. So are you sure that the query is making your app slow? if you are 100% sure then you can do -

      1. Match with your local machine capacity (memory, cpu, etc) with DO db.

      2. Turn on query logging in your app, then it will show you query by query time.

      3. Check your local mysql configuration with DO db configuration. There are lots of settings that also can affect. But a DB admin can change that as you think best.

      If still you can’t determine, I suggest you to consult with a db admin.

      • I think this is really a problem. When I was using my own managed database in k8s cluster in DO it was working fast but when I moved to MySQL 8 Managed DO it becomes 3 to 4 times slower. There is no good help even what is causing slowness.

        So I think DO team should do something on this otherwise more user will start to avoid DO managed database.

        • I have experienced the same issue, when using a database from within the droplet my database is actually pretty speedy, since I moved to managed, it is very slow.

          • Ditto here. We ran a few tests to move our production databases, and noticed the really awful speeds as well. We ended up deploying on regular droplets with mariadb and speeds are as expected. I still ran a few tests every other month to check if things changed, and eventually abandoned the idea. Reached this post on my every “other other other” month check. Budget and time is tight, I’m not even gonna spin up a managed to test~

  • Has anyone got any update on this or found a solution?? Has anyone tried using Scalegrid and compared it against DO’s managed DB?

I face exactly the same issue! This is a disaster…I only managed to find out it’s so much slower(100x slower) after migrated to the managed database. Initially, I thought it was the indexing that causes such issue. Export the database and import them to run on my local, it very quick! DO, this can’t be real. We have to solve this ASAP!

Sadly same issue here. We run high traffic news websites with 10’s of million pageviews a month and were facing issues with capacity. First we thought it were webservers but quickly figured out that mysql is not returning an answer in an acceptable time. Compared to a regular droplet running mysql we tested about 8x faster (with k6.io testing tool). Even te memory went from 80% to 10%.

I have to report similar issues. Had my react app running quite smoothly on a $5 droplet including the db. I am the only one who is actually accessing it so really low workload. Performance on my $5 droplet was about the same as on localhost.

React App built up in .5s with all data

Then I switched to a managed db inside the same Location and local network and everything changed. Now my load time is about 4-5s

Nothing else was changed. Localhost is still fast.

  • Same issue here. Did you find a solution for this in the meantime? Im considering moving to an another managed database service.

    Kind regards,
    Arjan

I moved to Digital Ocean from AWS RDS primarily because, unlike Linode and Vultr they boasted managed database solution.

However, I have found the same as all of you; the performance is quite terrible.

If you want a direct comparison you can visit the following:

Droplet
(8 GB RAM / 2 dedicated CPU / 25 GB Disk - MySQL version 8 - the same as managed)
https://do-test-db.car4play.com/forum/post/index.htm?f=2&t=17111
(1.5s)

Digital Ocean Managed Database:
(8 GB RAM / 2 dedicated CPU / 25 GB Disk)
https://do.car4play.com/forum/post/index.htm?f=2&t=17111
(27.9s)

Mariadb 15 on local machine
(4 GB Memory / 2 AMD vCPUs / 50 GB Disk)
https://www.car4play.com/forum/post/index.htm?f=2&t=17111
(0.744s)

As you can see (and test for yourself) the difference in performance is huge.
I uploaded a video showing the difference - DO support said they never got it.

I also gave them the two last sites - they couldn’t see any difference, but explained away any performance drop with considerations of latency etc. etc. etc.

If you go to the shorter threads then there is little difference, but the ones I have posted above are longer threads and so require more queries.

I gave them links to these and then they said it was down to a difference in database engines: Mariadb is quicker than Mysql 8 and suggested I test on a droplet running this.

Then they closed the support ticket as resolved! Clearly they don’t want to accept there is an issue even though it couldn’t be clearer to see.

Yes, after installing Mysql 8 on another droplet you can see it is quicker as they say, but by 0.7s vs 1.5s (mainly down to latency of local to separate droplet) and still nothing like the 28s for their managed service.

I feel that all I get from Digital Ocean is fobbed off with excuses for essentially a poor product.

Are they being deliberately disingenuous about the fact that there are some real performance issues going on here with their managed database service that effectively render it useless?