-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Hit by size limit of /dev/shm #416
Comments
According to @macdice the issue seems to be triggered by complex queries and an increased number of |
Indeed, the default in Docker for $ docker run -it --rm alpine:3.7 df -hT /dev/shm
Filesystem Type Size Used Available Use% Mounted on
shm tmpfs 64.0M 0 64.0M 0% /dev/shm There is also a $ docker run -it --rm --shm-size 128m alpine:3.7 df -hT /dev/shm
Filesystem Type Size Used Available Use% Mounted on
shm tmpfs 128.0M 0 128.0M 0% /dev/shm This is not something the image can set automatically, and as you alluded to, I think the "recommended value" is going to vary from deployment to deployment (based on both user requirements and supplied configuration). |
I think it would be a good idea to add it to the image documentation. The limited |
I think at least the information about changing the default SHM size should be added to the documentation (like a tip: "You may want to change the default shared memory by passing Related issue (change SHM size of a running container): docker/cli#1278 |
@turicas 😉
|
Add possibility to mount a tmpfs volume to /dev/shm to avoid issues like [this](docker-library/postgres#416). To achieve that two new options were introduced: * `enableShmVolume` to PostgreSQL manifest, to specify whether or not mount this volume per database cluster * `enable_shm_volume` to operator configuration, to specify whether or not mount per operator. The first one, `enableShmVolume` takes precedence to allow us to be more flexible.
* [stable/postgresql] Add dedicated tmpsfs for /dev/shm. Start a database pod without limitations on shm memory. By default docker limit to (see e.g. the [docker issue](docker-library/postgres#416), which could be not enough if PostgreSQL uses parallel workers heavily. If this option is present and value is , to the target database pod will be mounted a new tmpfs volume to remove this limitation. Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr> * [stable/postgresql] SHM: Second version after review + improvements. Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr>
* [stable/postgresql] Add dedicated tmpsfs for /dev/shm. Start a database pod without limitations on shm memory. By default docker limit to (see e.g. the [docker issue](docker-library/postgres#416), which could be not enough if PostgreSQL uses parallel workers heavily. If this option is present and value is , to the target database pod will be mounted a new tmpfs volume to remove this limitation. Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr> * [stable/postgresql] SHM: Second version after review + improvements. Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr>
* [stable/postgresql] Add dedicated tmpsfs for /dev/shm. Start a database pod without limitations on shm memory. By default docker limit to (see e.g. the [docker issue](docker-library/postgres#416), which could be not enough if PostgreSQL uses parallel workers heavily. If this option is present and value is , to the target database pod will be mounted a new tmpfs volume to remove this limitation. Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr> * [stable/postgresql] SHM: Second version after review + improvements. Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr> Signed-off-by: Carlos Roberto Marques Junior <carlos.marques@bndes.gov.br>
* [stable/postgresql] Add dedicated tmpsfs for /dev/shm. Start a database pod without limitations on shm memory. By default docker limit to (see e.g. the [docker issue](docker-library/postgres#416), which could be not enough if PostgreSQL uses parallel workers heavily. If this option is present and value is , to the target database pod will be mounted a new tmpfs volume to remove this limitation. Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr> * [stable/postgresql] SHM: Second version after review + improvements. Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr>
* [stable/postgresql] Add dedicated tmpsfs for /dev/shm. Start a database pod without limitations on shm memory. By default docker limit to (see e.g. the [docker issue](docker-library/postgres#416), which could be not enough if PostgreSQL uses parallel workers heavily. If this option is present and value is , to the target database pod will be mounted a new tmpfs volume to remove this limitation. Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr> * [stable/postgresql] SHM: Second version after review + improvements. Signed-off-by: Cédric de Saint Martin <cdesaintmartin@wiremind.fr>
Some systems have a very small /dev/shm, for example, see: docker-library/postgres#416 So we should just use the temporary directory on all operating systems. Also: * use TempDir to generate the temporary path * delete the code that we copied from sled * prefix the temporary path with the state version and network
Some systems have a very small /dev/shm, for example, see: docker-library/postgres#416 So we should just use the temporary directory on all operating systems. Also: * use TempDir to generate the temporary path * delete the code that we copied from sled * prefix the temporary path with the state version and network
Add possibility to mount a tmpfs volume to /dev/shm to avoid issues like [this](docker-library/postgres#416). To achieve that two new options were introduced: * `enableShmVolume` to PostgreSQL manifest, to specify whether or not mount this volume per database cluster * `enable_shm_volume` to operator configuration, to specify whether or not mount per operator. The first one, `enableShmVolume` takes precedence to allow us to be more flexible.
The default limit for Docker containers seems to be
64MB
I couldn't really find how to calculate the required size of
/dev/shm
looking at the documentation. Which Postgres configuration options affect the required size and would it be feasable to tuneshm_size
accordingly?Maybe it would be worth to extend the image documentation.
The text was updated successfully, but these errors were encountered: