Re: BUG #17005: Enhancement request: Improve walsender throughput by aggregating multiple messages in one send

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: rony(dot)kurniawan(at)oracle(dot)com, PostgreSQL mailing lists <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #17005: Enhancement request: Improve walsender throughput by aggregating multiple messages in one send
Date: 2021-05-22 05:39:46
Message-ID: CAA4eK1+rDAVZRzbendZPdFCAWfy9qvVousyyvyujTg9KeCyiog@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Mon, May 17, 2021 at 4:14 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
>
> Hi,
>
> On 2021-05-13 00:31:53 +0000, PG Bug reporting form wrote:
> > I measured the throughput of reading the logical replication slot and found
> > that in smaller row size (512 bytes) the throughput is 50% lower compared to
> > 1024 bytes.
>
> Huh, that is interesting.
>
>
> > tcpdump shows that ethernet packets sent by the replication server contain
> > only one message per packet (see tcpdump output below).
> > May be this is the intended design to achieve low latency but this is not
> > favorable in application that requires high throughput.
>
> What kind of network is this? I would have expected that if the network
> can't keep up the small sends would end up getting aggregated into
> larger packets anyway? Are you hitting a PPS limit due to the small
> packages, but not yet the throughput limit?
>
>
> > Is it possible for PostgreSQL to enable Nagle's algorithm on the streaming
> > socket for replication?
> > Or aggegate the messages manually before sending them in one send()?
>
> I think we can probably do better in cases a transaction is more than a
> single change - but I don't think either enabling nagle's or aggregation
> are really an option in case of single row transactions. The latency
> impact for some scenarios seems too high.
>

Can we think of combining Begin single_change Commit and send them as
one message for a single-row change xacts?

--
With Regards,
Amit Kapila.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2021-05-22 16:20:29 BUG #17030: ERROR: cannot decompile join alias var in plan tree introduced in pg14beta1
Previous Message David Rowley 2021-05-22 04:31:29 Re: ResultCache cache error: "cache entry already complete" in 14beta1