Question

How to lower the latency of requests to the DB

We currently have 2 servers in the NYC3 region, the first is a web service (django) and the second a postgresql BD. It turns out that we are migrating the web service to kubernetes. We configure some clusters in the same region (NYC3) and we raise the web service, but the latency in the requests to the BD (External server but in the same region) is too high, which leads to very long pages loading times. What can I do, I don’t want to migrate the DB to a kubernetes. Can I improve latency in any way?


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.

Hi @felipegarridov

Since everything you mentioned is in the same region, NYC3, are you sure you are using the Private Network IPs to connect?

  1. Make sure you enable the private network on both servers, you can follow this guide
  2. Use the private IP instead of the public one to connect to your database from your web app

You should see a huge latency improvement.

Islam @ SimpleBackups