Re: GUCifying MAX_WAL_SEND - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: GUCifying MAX_WAL_SEND
Date
Msg-id ZZ8gYTJekItZ2uJ2@paquier.xyz
Whole thread Raw
In response to GUCifying MAX_WAL_SEND  (Majid Garoosi <amoomajid99@gmail.com>)
List pgsql-hackers
On Thu, Jan 11, 2024 at 01:15:48AM +0330, Majid Garoosi wrote:
> Why do I think it can be beneficial to GUCify it?
> We use Postgres in K8s along with RBD disks. Today, I found out that
> because we use remote disks, it's better to read bigger chunks of data from
> the disk in one operation. In our setup (which I assume is not a silly
> setup), we had a query that took 4.5 seconds to execute on the primary
> server and ~21 seconds to send the WAL records to our synchronous standby
> server. After recompiling Postgres and setting MAX_WAL_SEND to 16MiB, that
> 21 seconds decreased to just 1.5 seconds, which is a 92.9% improvement.

I did not follow the older thread, but MAX_SEND_SIZE does not stress
me as a performance bottleneck in walsender.c when we use it for
calculations with the end LSN, so I can get behind the argument of
GUC-ifying it when reading WAL data in batches, even if it can be easy
to get it wrong.   The hardcoded value comes back to 40f908bdcdc7 back
in 2010, and hardware has evolved a lot since that point.

So I'd +1 your suggestion.  A RBD setup sounds exotic to me for a
database, though :)
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Jelte Fennema-Nio
Date:
Subject: Re: Add new protocol message to change GUCs for usage with future protocol-only GUCs
Next
From: "Daniel Verite"
Date:
Subject: Re: Built-in CTYPE provider