Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure overcommit_ratio on PostgreSQL servers #524

Open
RobHooper opened this issue Oct 1, 2024 · 1 comment
Open

Configure overcommit_ratio on PostgreSQL servers #524

RobHooper opened this issue Oct 1, 2024 · 1 comment
Assignees
Labels
postgresql Relating to PostgreSQL services
Milestone

Comments

@RobHooper
Copy link
Contributor

unattended-upgrades on ocp22 has been failing reporting it is unable to allocate enough memory.
We have temporarily set overcommit_memory = 0 (the default value) to mitigate this.

PostgreSQL recommends overcommit_memory = 2 to help protect the service from accidental termination when memory resources are exhausted, however, this setting limits memory for all process causing issues particularly on smaller servers.

To resolve this we should increase overcommit_ratio from 50% to 90% / 100% allowing user space to access all available memory.

Further reading:

@RobHooper RobHooper self-assigned this Oct 1, 2024
@RobHooper RobHooper added the postgresql Relating to PostgreSQL services label Oct 1, 2024
@jpmckinney jpmckinney added this to the Priority milestone Oct 1, 2024
@jpmckinney
Copy link
Member

Noting that Redis also warns:

WARNING Memory overcommit must be enabled! Without it, a background save or replication may fail under low memory condition. Being disabled, it can can also cause failures without low memory condition, see jemalloc/jemalloc#1328. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postgresql Relating to PostgreSQL services
Projects
None yet
Development

No branches or pull requests

2 participants