Re: PATCH: Batch/pipelining support for libpq

From: Andres Freund <andres(at)anarazel(dot)de>
To: Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: Daniel Verite <daniel(at)manitou-mail(dot)org>, Vaishnavi Prabakaran <vaishnaviprabakaran(at)gmail(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, David Steele <david(at)pgmasters(dot)net>, "Prabakaran, Vaishnavi" <VaishnaviP(at)fast(dot)au(dot)fujitsu(dot)com>, Haribabu Kommi <kommi(dot)haribabu(at)gmail(dot)com>, "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>, Dmitry Igrishin <dmitigr(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>, Manuel Kniep <m(dot)kniep(at)web(dot)de>, "fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp" <fujita(dot)etsuro(at)lab(dot)ntt(dot)co(dot)jp>, "Iwata, Aya" <iwata(dot)aya(at)jp(dot)fujitsu(dot)com>
Subject: Re: PATCH: Batch/pipelining support for libpq
Date: 2017-06-22 01:07:21
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 2017-06-22 09:03:05 +0800, Craig Ringer wrote:
> On 22 June 2017 at 08:29, Andres Freund <andres(at)anarazel(dot)de> wrote:
> > I.e. we're doing tiny write send() syscalls (they should be coalesced)
> That's likely worth doing, but can probably wait for a separate patch.

I don't think so, we should get this right, it could have API influence.

> The kernel will usually do some packet aggregation unless we use
> TCP_NODELAY (which we don't and shouldn't), and the syscall overhead
> is IMO not worth worrying about just yet.

* Select socket options: no delay of outgoing data for
* TCP sockets, nonblock mode, close-on-exec. Fail if any
* of this fails.
if (!IS_AF_UNIX(addr_cur->ai_family))
if (!connectNoDelay(conn))
pqDropConnection(conn, true);
conn->addr_cur = addr_cur->ai_next;

2) Even if nodelay weren't set, this can still lead to smaller packets
being sent, because you start sending normal sized tcp packets,
rather than jumbo ones, even if configured (pretty common these

3) Syscall overhead is actually quite significant.

- Andres

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2017-06-22 01:16:46 Re: An attempt to reduce WALWriteLock contention
Previous Message Craig Ringer 2017-06-22 01:03:05 Re: PATCH: Batch/pipelining support for libpq