1

I have a PostgreSQL database deployed on Azure using Azure Database for PostgreSQL flexible server.

I have the same database created locally and queries that takes 70ms locally, takes 800ms on the database deployed on Azure.

The latency happens if I query the database from my local machine or from an app deployed in Azure Service.

Any clue what may be the issue or how this can be improved?

The compute tier I am using in Azure is the following (I know it's the worst one but I still think it shouldn't take almost a second to query a table that has 50 records in it and two columns):

Burstable (1-2 vCores) - Best for workloads that don’t need the full CPU continuously

Standard_B1ms (1 vCore, 2 GiB memory, 640 max iops)

This is what Azure is showing me in the overview (so that's why I am guessing the problem should be network related and not CPU/memory related):

enter image description here

3
  • "The latency happens if I query the database from my local machine as from an app deployed in Azure Service." I don't understand this sentence. Is 'as' supposed to be 'or'? Commented Oct 9, 2022 at 20:41
  • It is quite normal for a database hosted somewhere else to cause high query latency. Reduce the number of queries as much as you can, and use pipelining wherever possible. Commented Oct 9, 2022 at 21:31
  • same issue with me, I migrated from Heroku, it was super fast but Azure with high specs, it's extremely slow Commented Dec 26, 2022 at 23:16

1 Answer 1

1

Burstable sku's are for testing and small workloads changing to General purpose will improve.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.