Re: invalid memory alloc request size from pg_stat_activity?

From: James Tomson <james(at)pushd(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Euler Taveira <euler(at)timbira(dot)com(dot)br>, pgsql-bugs(at)lists(dot)postgresql(dot)org, Eric Jensen <ej(at)pushd(dot)com>
Subject: Re: invalid memory alloc request size from pg_stat_activity?
Date: 2019-05-07 16:22:39
Message-ID: E1D013D1-ED51-4978-A5B0-586DF1A801A2@pushd.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Alvaro Herrera <alvherre(at)2ndquadrant(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2019-05-07 19:14:59 Re: BUG #15794: Defects regarding stored procedure parameters
Previous Message Nick Anderson 2019-05-07 15:26:41 RE: RE: Re: Re: BUG #15769: The database cluster intialisation failed.