public inbox for [email protected]  
help / color / mirror / Atom feed
Tuning Linux for Postgresql - Database failed to start
5+ messages / 3 participants
[nested] [flat]

* Tuning Linux for Postgresql - Database failed to start
@ 2022-05-10 20:23 Albin Ary <[email protected]>
  2022-05-10 20:29 ` Re: Tuning Linux for Postgresql - Database failed to start Scott Ribe <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Albin Ary @ 2022-05-10 20:23 UTC (permalink / raw)
  To: [email protected]

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


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Tuning Linux for Postgresql - Database failed to start
  2022-05-10 20:23 Tuning Linux for Postgresql - Database failed to start Albin Ary <[email protected]>
@ 2022-05-10 20:29 ` Scott Ribe <[email protected]>
  2022-05-10 20:39   ` Re: Tuning Linux for Postgresql - Database failed to start Albin Ary <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Scott Ribe @ 2022-05-10 20:29 UTC (permalink / raw)
  To: Albin Ary <[email protected]>; +Cc: [email protected]

> On May 10, 2022, at 2:23 PM, Albin Ary <[email protected]> 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






^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Tuning Linux for Postgresql - Database failed to start
  2022-05-10 20:23 Tuning Linux for Postgresql - Database failed to start Albin Ary <[email protected]>
  2022-05-10 20:29 ` Re: Tuning Linux for Postgresql - Database failed to start Scott Ribe <[email protected]>
@ 2022-05-10 20:39   ` Albin Ary <[email protected]>
  2022-05-10 20:48     ` Re: Tuning Linux for Postgresql - Database failed to start Kenneth Marshall <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Albin Ary @ 2022-05-10 20:39 UTC (permalink / raw)
  To: ; +Cc: [email protected]

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 <[email protected]>
wrote:

> > On May 10, 2022, at 2:23 PM, Albin Ary <[email protected]> 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
>
>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Tuning Linux for Postgresql - Database failed to start
  2022-05-10 20:23 Tuning Linux for Postgresql - Database failed to start Albin Ary <[email protected]>
  2022-05-10 20:29 ` Re: Tuning Linux for Postgresql - Database failed to start Scott Ribe <[email protected]>
  2022-05-10 20:39   ` Re: Tuning Linux for Postgresql - Database failed to start Albin Ary <[email protected]>
@ 2022-05-10 20:48     ` Kenneth Marshall <[email protected]>
  2022-05-10 20:58       ` Re: Tuning Linux for Postgresql - Database failed to start Albin Ary <[email protected]>
  0 siblings, 1 reply; 5+ messages in thread

From: Kenneth Marshall @ 2022-05-10 20:48 UTC (permalink / raw)
  To: Albin Ary <[email protected]>; +Cc: [email protected]

On Tue, May 10, 2022 at 10:39:09PM +0200, Albin Ary wrote:
> 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:
> 
Hi Albin,

1GB shared_buffers + 1.3GB huge pages on a 4GB system = don't have
enough resources. Please remove the huge pages request or add additional
memory to your system.

Regards,
Ken





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Tuning Linux for Postgresql - Database failed to start
  2022-05-10 20:23 Tuning Linux for Postgresql - Database failed to start Albin Ary <[email protected]>
  2022-05-10 20:29 ` Re: Tuning Linux for Postgresql - Database failed to start Scott Ribe <[email protected]>
  2022-05-10 20:39   ` Re: Tuning Linux for Postgresql - Database failed to start Albin Ary <[email protected]>
  2022-05-10 20:48     ` Re: Tuning Linux for Postgresql - Database failed to start Kenneth Marshall <[email protected]>
@ 2022-05-10 20:58       ` Albin Ary <[email protected]>
  0 siblings, 0 replies; 5+ messages in thread

From: Albin Ary @ 2022-05-10 20:58 UTC (permalink / raw)
  To: Kenneth Marshall <[email protected]>; +Cc: [email protected]

Ok, will do that. Thanks a lot.

It is clear now why it fails to start.

Actually, the blog author mentions that setting it high might cause the
database failing to start, anyway a calculation is provided and I followed
that calculation.


The ideal number of huge pages is just a bit higher than this -- just a
> bit. If you increase this value too much, processes that need small pages
> that also need space in the OS will fail to start. This may even end up
> with the operating system failing to boot or other PostgreSQL instances on
> the same server failing to start.





On Tue, 10 May 2022 at 22:48, Kenneth Marshall <[email protected]> wrote:

> On Tue, May 10, 2022 at 10:39:09PM +0200, Albin Ary wrote:
> > 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:
> >
> Hi Albin,
>
> 1GB shared_buffers + 1.3GB huge pages on a 4GB system = don't have
> enough resources. Please remove the huge pages request or add additional
> memory to your system.
>
> Regards,
> Ken
>


^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2022-05-10 20:58 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2022-05-10 20:23 Tuning Linux for Postgresql - Database failed to start Albin Ary <[email protected]>
2022-05-10 20:29 ` Scott Ribe <[email protected]>
2022-05-10 20:39   ` Albin Ary <[email protected]>
2022-05-10 20:48     ` Kenneth Marshall <[email protected]>
2022-05-10 20:58       ` Albin Ary <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox