Re: Receive buffer size for the statistics socket

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Receive buffer size for the statistics socket
Date: 2017-05-15 23:57:21
Message-ID: 27403.1494892641@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I wrote:
> I propose that it'd be a good idea to try to set the stats socket's
> receive buffer size to be a minimum of, say, 100K on all platforms.
> Code for this would be analogous to what we already have in pqcomm.c
> (circa line 760) for forcing up the send buffer size, but SO_RCVBUF
> not SO_SNDBUF.

I experimented with the attached patch. Modern platforms such as
recent Linux and macOS seem to have default receive buffer sizes
in the 100K-200K range. The default is less in older systems, but
even my very oldest dinosaurs will let you set it to at least 256K.
(Don't have Windows to try, though.)

I propose committing this (less the debug logging part) to HEAD
once the beta is out, and then back-patching if it doesn't break
anything and seems to improve matters on frogmouth.

regards, tom lane

Attachment Content-Type Size
set-minimum-receive-bufsize-for-pgstat.patch text/x-diff 2.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2017-05-16 00:12:10 Relcache leak when row triggers on partitions are fired by COPY
Previous Message Thomas Munro 2017-05-15 22:40:00 COPY FROM STDIN behaviour on end-of-file