Expected DB Latency

Category: azure database for postgresql


Josh Lehman on Sun, 08 Apr 2018 06:12:03


I am running a virtual machine and a PostgresDB instance in the same region and resource group. When I run a query from my app server to the database I am getting on average 3.5MS response time. When I run the same comparison tests in AWS I get approx 0.9MS - my app that I am testing is very sensitive to latency and this is causing a lot of issues having the higher latency.

I redeployed the virtual machine with accelerated networking and it made no difference at all to the latency. Can you confirm if the speed I am seeing is as expected or if there is actually some fault?

From what I can tell it seems like the database and server may not be in the same 'availability zone' (using AWS terminology here) even though they are in the same region. Is this a possible situation?




Mike Ubezzi (Azure) on Mon, 09 Apr 2018 22:13:07

Hi Josh,

Do you have any information about how your Azure PostgreSQL database has been deployed?

Azure Database for PostgreSQL pricing tiers

Pricing tier

Target workloads


Workloads that require light compute and I/O performance. Examples include servers used for development or testing or small-scale infrequently used applications.

General Purpose

Most business workloads that require balanced compute and memory with scalable I/O throughput. Examples include servers for hosting web and mobile apps and other enterprise applications.

Memory Optimized

High-performance database workloads that require in-memory performance for faster transaction processing and higher concurrency. Examples include servers for processing real-time data and high-performance transactional or analytical apps.

You might be running a 'Basic' tier for the database, and you could try the Memory Optimized option in your testing. I hope this helps.



Josh Lehman on Mon, 09 Apr 2018 23:59:10

Hi Mike,

I am using the General Purpose Tier. I will test out the Memory Optimized and report back. Would you expect that would change the latency between the server and the actual database though?



problim on Tue, 10 Apr 2018 15:23:06

Hi Josh,

Can you post how you make out with the Memory Optimized?  I am getting the same feeling, that Azure PostGreSQL is slower.  My client has been complaining about the performance in our web app. But our analytics is showing that memory and cpu is fine.

Mike Ubezzi (Azure) on Tue, 10 Apr 2018 15:58:59

Please use the PostgreSQL User Voice format to provide your results, as that is a more constructive means to communicate feedback to the product group. Thank you! Regards, Mike

Note: Do a search on 'Latency', as I think there is one feedback post already but it may not apply directly to your situation.

Josh Lehman on Wed, 11 Apr 2018 09:32:02

I plan to retest this weekend with the memory optimised and will report back. I have also logged a support ticket to see if there is any other feedback regarding the latency. I am getting the feeling that this latency is as expected but will advise if I hear otherwise. 

Mike Ubezzi (Azure) on Wed, 18 Apr 2018 22:57:53

Is there any feedback from Support?



Josh Lehman on Fri, 20 Apr 2018 04:10:40

Hi Mike,

Sorry for the delay. Support did send me a response:

"This server was in AustraliaEast. In AustraliaEast, we were using old hardware for Gateways in control ring (CR1). This may have impacted the latency that the customer is reporting. Since April 11, we started routing all connectivity traffic of new PostgreSQL and MySQL servers to go through Gateways in CR2, which has better hardware than the older CR1"

I still need to re-test, been a bit caught up.