Re: Proposal: PqSendBuffer removal

From: Aleksei Ivanov <iv(dot)alekseii(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Proposal: PqSendBuffer removal
Date: 2020-03-05 21:23:21
Message-ID: CAN0E21Nt7SFqrbO55Jd_PGQ2AakQF_h8EbUmVP-5SfzrMrG9TA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thank you for your reply!

Yes, you are right there will be a separate call to send the data, but is
copying data each time more costly operation than just one syscall?

Besides, if we already have a ready message packet to be sent why should we
wait?

Waiting for your reply,
Best regards!

On Thu, Mar 5, 2020 at 13:10 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Aleksei Ivanov <iv(dot)alekseii(at)gmail(dot)com> writes:
> > I am really curious what was the original intention of using the
> > PqSendBuffer and is it possible to remove it now.
>
> > Currently all messages are copied from StringInfo to this buffer and
> sent,
> > which from my point of view is redundant operation.
>
> That would mean doing a separate send() kernel call for every few bytes,
> no? I think the point of that buffer is to be sure we accumulate a
> reasonable number of bytes to pass to the kernel for each send().
>
> regards, tom lane
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kartyshov Ivan 2020-03-05 21:24:01 Re: [HACKERS] make async slave to wait for lsn to be replayed
Previous Message Tomas Vondra 2020-03-05 21:17:03 Re: Allowing ALTER TYPE to change storage strategy