On Thu, 2023-11-02 at 09:12 +0000, Avi Weinberg wrote:
> I'm using Patroni Postgres installation and noticed that twice already postgres
> crashed due to out of memory. I'm using logical replication with around 30-40
> active subscribers on this machine. The machine has 128GB but only 32GB is allocated
> to Postgres. How can I know what is actually causing the out of memory issue?
> Is it caused by not optimal postgres configuration or something else?
You should look into the PostgreSQL log. That should show a message like
LOG: server process (PID 16024) was terminated by signal 9: Killed
DETAIL: Failed process was running: SELECT ...
It is not certain, but often that statement is the one that used up
all that memory. At least it is a starting point for your investigation.
Yours,
Laurenz Albe