Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1noWek-00063L-3S for pgsql-admin@arkaria.postgresql.org; Tue, 10 May 2022 20:40:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1noWdk-0005V6-To for pgsql-admin@arkaria.postgresql.org; Tue, 10 May 2022 20:39:28 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1noWdk-0005UV-D6 for pgsql-admin@lists.postgresql.org; Tue, 10 May 2022 20:39:28 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1noWdh-0002iL-EM for pgsql-admin@lists.postgresql.org; Tue, 10 May 2022 20:39:27 +0000 Received: by mail-ej1-x635.google.com with SMTP id z2so186480ejj.3 for ; Tue, 10 May 2022 13:39:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:cc; bh=d6TER9OmwXsIgWOVuN8NyJG7wlkJtLIuV2CFfjNGV9s=; b=S/JPa5lyVqZbewHknjDkX/ZFkfwxTHzM/qv3UxCF4F6KXZ8hXSlh3GfVW1wQuJFvYX UuKDQLjlNyIo8DCNpMGCgkB0mK4OxOq0ecejZE/EWhgMav3ttlo3tWqk8/ZOHLmHotb0 gQNrzKU+mBkKwVAeVa/LPf1eqjLeA++zdk+axWlUsdojBOy/11ZooaMouNAPdlSRHvEK /fAQsh/P9oq0QDjwWUKYpWzwbf5UXgrWfatun/+qkUOlgUExvORVDuq6UTyRYMxoN5wA yjWCoQW7p/tRZM5uvHpOqfls2u/8W35UB01pSLxJ8CzzxLMoRiWPn3fzCq4/rNFSALeR Te9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:cc; bh=d6TER9OmwXsIgWOVuN8NyJG7wlkJtLIuV2CFfjNGV9s=; b=V2kq/oRdrg1NFkoTp0izOV3LAoWkh0FbFleSj/1KLhxJDWzUoS6yXFauXTKu/604UV kGGSn+iMyuiGE9xO2wtwcZMLS9jNCqmbQrobEpP2U92S2CMeWYS/27YXZHul+lSTtuZy foyE9z7kVbq90AErFZeSsWeiGP7PLIes+P021PCOA2c2OzL+SEB+UTlbWbvE56IMzRRY Shvf2LKyGIJhs4fZEIaUl2wwwhLUZpbDm9/40WLtZsOKX3FYqbeTmAlrEAaEBK11iSnn P2IiN3l4b86+WyfUAgqsqR2kCCezqtKaLAXjkYQ8h7oTwW7THsVvsNBRXq0ZMGa8GBwB ePeQ== X-Gm-Message-State: AOAM530Ad5DzwMg2qVPKxeA8N+gz1h3oPSSNjSk6eUZNzj6xRwNo7/OQ SVc2TXAgIJRNaMlDxpxb91zlrecDLGq5GB70tBGHetfZRhw= X-Google-Smtp-Source: ABdhPJyW0Xt4mCpHOuc76KrMa6Sld6lXjd4dPrRPFPZYtLuNJe2126a9m/hzXN5bV1eB/IIDpK1tQbPYukEOdOhcLp4= X-Received: by 2002:a17:906:9c43:b0:6f3:a8be:af46 with SMTP id fg3-20020a1709069c4300b006f3a8beaf46mr21032372ejc.271.1652215163706; Tue, 10 May 2022 13:39:23 -0700 (PDT) MIME-Version: 1.0 References: <3C248C6F-BB01-4E18-8427-EE46B9B48762@elevated-dev.com> In-Reply-To: <3C248C6F-BB01-4E18-8427-EE46B9B48762@elevated-dev.com> From: Albin Ary Date: Tue, 10 May 2022 22:39:09 +0200 Message-ID: Subject: Re: Tuning Linux for Postgresql - Database failed to start Cc: pgsql-admin@lists.postgresql.org Content-Type: multipart/alternative; boundary="000000000000ece24f05deae5169" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --000000000000ece24f05deae5169 Content-Type: text/plain; charset="UTF-8" Hello, Thanks a lot for your inputs. I only changed the section related to HugePages. This server has 4 GB RAM. shared_buffers = '1GB' vm.nr_hugepages=650 tuned profile: [main] summary=Tuned profile for EDB PostgreSQL Instances [bootloader] cmdline=transparent_hugepage=never [cpu] governor=performance energy_perf_bias=performance min_perf_pct=100 [sysctl] vm.swappiness = 10 vm.dirty_expire_centisecs = 500 vm.dirty_writeback_centisecs = 250 vm.dirty_ratio = 10 vm.dirty_background_ratio = 3 vm.overcommit_memory=0 net.ipv4.tcp_timestamps=0 [vm] transparent_hugepages=never vm.nr_hugepages=605 On Tue, 10 May 2022 at 22:29, Scott Ribe wrote: > > On May 10, 2022, at 2:23 PM, Albin Ary wrote: > > > > Hello, > > I have a Postgresql Database cluster. > > Version: 14.2 > > OS: Oracle Linux 8 > > > > I tried to follow the link to optimize the server. > > > https://www.enterprisedb.com/blog/tuning-red-hat-enterprise-linux-family-postgresql > > > > Unfortunately, after rebooting the database is not starting anymore. I > know the HINT is straightforward but I am not able to see what the reason > could be. > > > > Any advice would be appreciated. > > > > -- Unit postgresql-14.service has begun starting up. > > May 10 22:10:40 postgersdb.localdomain postmaster[1612]: 2022-05-10 > 22:10:40.047 CEST [1612] FATAL: could not map anonymous shared memory: > Cannot allocate memory > > May 10 22:10:40 postgersdb.localdomain postmaster[1612]: 2022-05-10 > 22:10:40.047 CEST [1612] HINT: This error usually means that PostgreSQL's > request for a shared memory segment exceeded available memory,> > > May 10 22:10:40 postgersdb.localdomain postmaster[1612]: 2022-05-10 > 22:10:40.048 CEST [1612] LOG: database system is shut down > > May 10 22:10:40 postgersdb.localdomain systemd[1]: > postgresql-14.service: Main process exited, code=exited, status=1/FAILURE > > May 10 22:10:40 postgersdb.localdomain systemd[1]: > postgresql-14.service: Failed with result 'exit-code'. > > -- Subject: Unit failed > > -- Defined-By: systemd > > -- Support: https://support.oracle.com > > This is a decent quick guide to the parameters affecting this: > > https://docs.oracle.com/cd/E19879-01/821-0182/fxxua/index.html > > And here is the explanation as to how they related to postgres: > > https://www.postgresql.org/docs/14/kernel-resources.html > > --000000000000ece24f05deae5169 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,=C2=A0

Thanks a lot for your inpu= ts.=C2=A0

I only changed the section related to Hu= gePages.=C2=A0

This server has 4 GB RAM.

shared_buffers =3D '1GB'=C2=A0
vm.nr_hugepages= =3D650

tuned profile:



[main]
summary=3DTuned profile for EDB PostgreSQL In= stances
[bootloader]
cmdline=3Dtransparent_hugepage=3Dnever
[cpu]<= br>governor=3Dperformance
energy_perf_bias=3Dperformance
min_perf_pct= =3D100
[sysctl]
vm.swappiness =3D 10
vm.dirty_expire_centisecs =3D= 500
vm.dirty_writeback_centisecs =3D 250
vm.dirty_ratio =3D 10
vm= .dirty_background_ratio =3D 3
vm.overcommit_memory=3D0
net.ipv4.tcp_t= imestamps=3D0

[vm]
transparent_hugepages=3Dnever
vm.nr_hugepag= es=3D605

On Tue, 10 May 2022 at 22:29, Scott Ribe <scott_ribe@elevated-dev.com> wrot= e:
> On May 1= 0, 2022, at 2:23 PM, Albin Ary <albinary10@gmail.com> wrote:
>
> Hello,
> I have a Postgresql Database cluster.
> Version: 14.2
> OS: Oracle Linux 8
>
> I tried to follow the link to optimize the server.
> https://www.= enterprisedb.com/blog/tuning-red-hat-enterprise-linux-family-postgresql=
>
> Unfortunately, after rebooting the database is not starting anymore. I= know the HINT is straightforward but I am not able to see what the reason = could be.
>
> Any advice would be appreciated.
>
> -- Unit postgresql-14.service has begun starting up.
> May 10 22:10:40 postgersdb.localdomain postmaster[1612]: 2022-05-10 22= :10:40.047 CEST [1612] FATAL:=C2=A0 could not map anonymous shared memory: = Cannot allocate memory
> May 10 22:10:40 postgersdb.localdomain postmaster[1612]: 2022-05-10 22= :10:40.047 CEST [1612] HINT:=C2=A0 This error usually means that PostgreSQL= 's request for a shared memory segment exceeded available memory,> > May 10 22:10:40 postgersdb.localdomain postmaster[1612]: 2022-05-10 22= :10:40.048 CEST [1612] LOG:=C2=A0 database system is shut down
> May 10 22:10:40 postgersdb.localdomain systemd[1]: postgresql-14.servi= ce: Main process exited, code=3Dexited, status=3D1/FAILURE
> May 10 22:10:40 postgersdb.localdomain systemd[1]: postgresql-14.servi= ce: Failed with result 'exit-code'.
> -- Subject: Unit failed
> -- Defined-By: systemd
> -- Support: https://support.oracle.com

This is a decent quick guide to the parameters affecting this:

https://docs.oracle.com/cd/E19879-01/8= 21-0182/fxxua/index.html

And here is the explanation as to how they related to postgres:

https://www.postgresql.org/docs/14/kernel-re= sources.html

--000000000000ece24f05deae5169--