Re: Low performance between datacenters

From: Vitalii Tymchyshyn <vit(at)tym(dot)im>
To: Tamás PAPP <tomposmiko(at)gmail(dot)com>
Cc: pgsql-performance(at)lists(dot)postgresql(dot)org
Subject: Re: Low performance between datacenters
Date: 2024-07-08 00:42:27
Message-ID: CABWW-d1YWwEYniKnGcXJp84Qz3KkifHSJNscVxrRwZMCZjrqNA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Often it happens because of the low batch size for fetching data. This
makes client wait unnecessarily while reading rows. I am not sure which
client are you using, but in java this can be controlled on per-statement
level, see
https://jdbc.postgresql.org/documentation/query/

I believe there is also a connection parameter to set the default value,
but I don’t remember out of top of my head. You can definitely set it on
connection, see
https://jdbc.postgresql.org/documentation/publicapi/org/postgresql/jdbc/PgConnection.html#setDefaultFetchSize-int-

нд, 7 лип. 2024 р. о 10:17 Tamás PAPP <tomposmiko(at)gmail(dot)com> пише:

> 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.
>
>
> 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.
>
>
> Is this normal? Can I improve it somehow?
>
>
> Thank you,
>
>

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message James Pang 2024-07-08 02:21:58 Re: Hash Right join and seq scan
Previous Message Fernando Hevia 2024-07-07 20:23:41 Re: Low performance between datacenters