Why connecting to Managed MySQL DB from local is very slow?

I managed to connect my local WordPress multisite instance to the remote MySQL instance, but it takes literally minutes to load!

If I switch DBs I get the same speed I had in my local which was pretty fast, I’m now testing this before moving the production environment.

I have 1GB of internet, so my connection speed is quite good, and I’m not getting errors from my cluster but it is way too slow!!

I’m using the basic plan, is it that bad? The current server with the codebase and the DB is slow but it doesn’t take minutes to load.

I commented out the plugins to see if any were causing a problem, but nothing, the speed still pretty bad.

I presume moving the DB to its own server will improve even my local connection!

I don’t know what could be the issue as I don’t see any errors, nothing, just that it takes ages to load.

Thank you.

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

It’s because of network latency.

When you are in the same datacenter as the MySQL instance, the latency is below one milliseconds

Accessing a remote MySQL DB instance from home or your office, the latency is dozens or hundreds of milliseconds.

Everything will be dozens, or hundreds of times slower. It’s okay if you do a few transactions here and there, but WP does a whole lot of transactions for every page views.