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.

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.

×
1 answer

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.

Submit an Answer