Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qyVDp-008q2i-5g for pgsql-general@arkaria.postgresql.org; Thu, 02 Nov 2023 10:46:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qyVDn-00CrLD-TA for pgsql-general@arkaria.postgresql.org; Thu, 02 Nov 2023 10:46:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qyVDn-00CrL5-IY for pgsql-general@lists.postgresql.org; Thu, 02 Nov 2023 10:46:43 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qyVDl-004JSb-1B for pgsql-general@lists.postgresql.org; Thu, 02 Nov 2023 10:46:42 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-9c603e2354fso157944666b.1 for ; Thu, 02 Nov 2023 03:46:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20230601.gappssmtp.com; s=20230601; t=1698922000; x=1699526800; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=OelqCuXhuwLkUmbAQHRGgLlGYh0fZbK39IcsLO+Ab2k=; b=yAvEFMjYmUMAFDCMMwnZ6FpnpGkeUBJE1iIu1nv+Iefn15dZi0J0xRAzpt2VoJHQeB KSbERndQEESNFIlq/RQV5MKDVeJNwRL2wcf6ZKdtFkUHlvnmEkOMBnYyoBJf8QkyBYuP HXSrul0QGr1cQrWoc4oOG7Zr2Km2zNYFomZYAaQ432TpIKW47FlhxMuao12IEZdXkqbF ZzI0rxcZ9DixiSLsqPIeQWwMUUP5rxpyT4oc0gSKp2dMHrIHL0y/7glzfwqMBQKdZuom 2ICpzHstHW7elxHXc4O069jXW1J3/IwfAe/mPlXv+I8yQzvyHLbfAvyyWp1bwMAKpOyI pH7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698922000; x=1699526800; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=OelqCuXhuwLkUmbAQHRGgLlGYh0fZbK39IcsLO+Ab2k=; b=NtPav0CIaTz3LJI0waDnqrpkMRrb5+wJHj+xmxjGslO3leA+IeHRIMnIvI8u87e12J /r4Ksk1dEP8jyLPl775R9Xxz612xAYtra9D6RZULHO1IdgAND3PjyokePmb9wdqQYdmd J/9ieTrjnP0YH5gpM6uG1K8ob9L1JCjGYixoXUVzTl0v3y9BuT4/HyXu8IgiTAbOWGvs kNvi5Hs+IRzXYM0OhRjlnt4LXWK5ajKYZop/cVE8Wz9r6MOyUr8MhRBAmbX/EYrZ4Hsr 3Tu6LMuEpxFT2i8Er6xPetbkO4+dHfJCqYytIsF8ddooBo/JrA6DN3UcqQeDpWE9b/ls Sj/A== X-Gm-Message-State: AOJu0YyZ1rCy5aicvWri5fXlaYzETfZfP+g7oLgIEhHymKXZOvgfOg8s HZlPlnYfZeS0ZetpL+6YdkA34e3JxT9RsNCKWwI= X-Google-Smtp-Source: AGHT+IEPoKZuag8FwwexuAkTPr4N30iP7QzykahkZDt8/Y4d+E9YPNZnTWR3FJCbSEzBBgMsp7vgeg== X-Received: by 2002:a17:907:20c1:b0:9ad:cbc0:9f47 with SMTP id qq1-20020a17090720c100b009adcbc09f47mr4510360ejb.12.1698921999964; Thu, 02 Nov 2023 03:46:39 -0700 (PDT) Received: from localhost.localdomain ([2001:871:5e:671d:efcb:786d:3c60:89d1]) by smtp.gmail.com with ESMTPSA id dv8-20020a170906b80800b009b285351817sm970104ejb.116.2023.11.02.03.46.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Nov 2023 03:46:39 -0700 (PDT) Message-ID: Subject: Re: Postgres Out Of Memory Crash From: Laurenz Albe To: Avi Weinberg , "pgsql-general@lists.postgresql.org" Date: Thu, 02 Nov 2023 11:46:39 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2023-11-02 at 09:12 +0000, Avi Weinberg wrote: > I'm using Patroni Postgres installation and noticed that twice already po= stgres > crashed due to out of memory.=C2=A0 I'm using logical replication with ar= ound 30-40 > active subscribers on this machine.=C2=A0 The machine has 128GB but only = 32GB is allocated > to Postgres.=C2=A0 How can I know what is actually causing the out of mem= ory 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