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

Actually set MEMORY_LIMIT_IN_BYTES based on cgroups limits #427

Closed
wants to merge 1 commit into from

Conversation

jpopelka
Copy link
Contributor

@jpopelka jpopelka commented Nov 24, 2021

Hi,

in common.sh POSTGRESQL_SHARED_BUFFERS and POSTGRESQL_EFFECTIVE_CACHE_SIZE are calculated based on MEMORY_LIMIT_IN_BYTES (if set).
But I don't see MEMORY_LIMIT_IN_BYTES set anywhere and it doesn't seem to be set automatically in a container with memory limits specified (for example in Openshift/k8s or when you run a container via podman/docker and specify --memory).

FYI: I'm experimenting with memory-related settings because I'm seeing #396 (postgresql-12-centos7) and have no idea what else to try.

@pkubatrh
Copy link
Member

pkubatrh commented Nov 26, 2021

Hi thanks for the PR.

We are actually using the cgroups limits, but it might not be immediately obvious. The environment variables are set here: https://github.com/sclorg/postgresql-container/blob/master/src/root/usr/bin/run-postgresql#L6
And the cgroups-limits script is available here: https://github.com/sclorg/s2i-base-container/blob/master/core/root/usr/bin/cgroup-limits

@pkubatrh
Copy link
Member

Also @phracek might be able to help with the debugging from the container image/Openshift side, @fila43 from the postgresql side

@jpopelka
Copy link
Contributor Author

Ok, that's why I haven't found it, thanks. Closing then.

@jpopelka jpopelka closed this Nov 26, 2021
@jpopelka jpopelka deleted the MEMORY_LIMIT_IN_BYTES branch November 26, 2021 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants