From: James Tomson <james@pushd.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Euler Taveira <euler@timbira.com.br>
Cc: pgsql-bugs@lists.postgresql.org, Eric Jensen <ej@pushd.com>
Subject: Re: invalid memory alloc request size from pg_stat_activity?
Date: Tue, 7 May 2019 12:22:39 -0400
Message-ID: <E1D013D1-ED51-4978-A5B0-586DF1A801A2@pushd.com> (raw)
In-Reply-To: <28926.1557242067@sss.pgh.pa.us>
References: <20190507145513.GA7111@alvherre.pgsql>
<28926.1557242067@sss.pgh.pa.us>
Thanks all - we did have our max_connections set very very high (100k) as we upgraded this db in a load test environment, and did not want to reboot the db after hitting the lower, saner, production limits during load testing.
I am surprised this allocation was taking place for unused connections - I’ve also verified that lowering max_connections to 10K on this instance fixed the issue for us. Much appreciated!
Best,
James
> On May 7, 2019, at 11:14 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Alvaro Herrera <alvherre@2ndquadrant.com> writes:
>> Hmm, but 102400 is only 100kB, nowhere near the 1GB-1 limit, so there's
>> something odd going on there.
>
> I can reproduce the described behavior by also setting max_connections
> to something around 16K.
>
> Now, it seems pretty silly to me to be burning in excess of 1GB of shmem
> just for the current-query strings, and then that much again in every
> backend that reads pg_stat_activity. But should we be telling people they
> can't do it? I'm working on a patch to use MemoryContextAllocHuge for
> the "localactivity" buffer in pgstat_read_current_status. It might seem
> dumb now, but perhaps in ten years it'll be common.
>
> regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: james@pushd.com, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, euler@timbira.com.br, ej@pushd.com
Subject: Re: invalid memory alloc request size from pg_stat_activity?
In-Reply-To: <E1D013D1-ED51-4978-A5B0-586DF1A801A2@pushd.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox