Re: Low performance between datacenters

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





El dom, 7 jul 2024 a la(s) 3:17 p.m., Tamás PAPP (tomposmiko@xxxxxxxxx) escribió:
hi All,

I am new on the list.
I hope someone can give me an adequate answer or good advice about my problem.

I have a client (normally a web service, for testing the psql client) in GCP. There is a PSQL server in another DC. The ping response time is 20ms.
I measured the bandwidth via scp and it is more than 1Gb/s which is more than enough IMO.


Hi Tamás,

Bandwidth and Latency are two different concepts. Latency is the round-trip-time of a data-packet travelling over the network while bandwidth is the amount of data you can move concurrently. Latency will add up time over each conversation between the client and the server. For example, establishing a connection has a bit of back and forth dialogue going on. Each of these communications bits will be affected by latency as either client or server needs to wait for the other party to receive the message and then respond to it.
Latency will have an impact even when transmitting data like in a plain SELECT * FROM table. Bear in mind that psql uses TCP which sends an ACK packet at regular intervals to assert the integrity of the transmitted data.
 
The psql connection between the DCs for me was unexpectedly slow.
I would expect a bit slower query without data ('select now()') due to the increased latency and somewhat similar speed of data transfer.
What I see is that

select now() increased from 0.7ms to 20ms which is OK.
And 'select *' on a table with 3082 rows (so it's a small table) increased from 10ms to 800ms.

Since you aren't providing much evidence, I can speculate a lot might be going on to explain this kind of increase in the query delay: busy database, busy network, locks, latency, network unreliability, etc.
 
Is this normal? Can I improve it somehow?

Move your web service physically as close as possible to the database server.


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux