From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> |
Cc: | frank picabia <fpicabia(at)gmail(dot)com>, pgsql-admin(at)postgresql(dot)org |
Subject: | Re: Error: "could not fork new process for connection: Cannot allocate memory" |
Date: | 2020-12-21 15:27:18 |
Message-ID: | 492638.1608564438@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at> writes:
> On Mon, 2020-12-21 at 09:17 -0400, frank picabia wrote:
>> First of all, we did not run out of memory within the OS. This system is monitored by cacti and
>> Real Used memory never exceeded 30 GB on a server having 64 GB ram plus some swap.
> You probably have to increase the operating system limit for open files
> for the "postgres" user (ulimit -n).
Isn't ulimit -n a per-process, not per-user, limit? Perhaps ulimit -u
(max user processes) would be worth checking, though.
However, I don't think I believe the assertion that the system wasn't
under overall memory pressure. What we see in the quoted log fragment
is two separate postmaster fork-failure reports interspersed with a
memory context map, which has to have been coming out of some other
process because postmaster.c does not dump its contexts when reporting
a fork failure. But there's no reason for a PG process to dump a
context map unless it suffered an ENOMEM allocation failure.
(It'd be interesting to look for the "out of memory" error that presumably
follows the context map, to see if it offers any more info.)
So what we have is fork() being unhappy concurrently with ENOMEM
problems in at least one other process. That smells like overall
memory pressure to me, cacti or no cacti.
If you've got cgroups enabled, or if the whole thing is running
inside a VM, there might be kernel-enforced memory limits somewhere.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Fernando Hevia | 2020-12-21 19:35:31 | Re: Error: "could not fork new process for connection: Cannot allocate memory" |
Previous Message | frank picabia | 2020-12-21 14:09:20 | Re: Error: "could not fork new process for connection: Cannot allocate memory" |