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

Roesmi
  • 466
  • 5
  • 15
  • "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'? – jjanes Oct 09 '22 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. – Laurenz Albe Oct 09 '22 at 21:31
  • same issue with me, I migrated from Heroku, it was super fast but Azure with high specs, it's extremely slow – Lutaaya Huzaifah Idris Dec 26 '22 at 23:16

1 Answers1

1

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

Oury-MSFT
  • 181
  • 3