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

Auto-set shm size based on host available ram #342

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

nicolas-guerrier
Copy link
Contributor

Allow auto-setting the shm size of php container based on available ram host (1/4 here).

Also sets a default to 2GB

@nicolas-guerrier nicolas-guerrier linked an issue Mar 17, 2021 that may be closed by this pull request
@@ -21,6 +21,9 @@ LOCAL_GID := $(shell id -g)
CUID ?= $(LOCAL_UID)
CGID ?= $(LOCAL_GID)

# Define shm size based on total ram on host ([Total ram on host, in kilobytes] / 4)
SHM_SIZE = $(shell expr $(shell cat /proc/meminfo | head -1 | awk '{print $$2}') \* 256)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs testing on Macos

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davidferlay
Copy link
Contributor

davidferlay commented Mar 23, 2021

dferlay
David Ferlay @dferlay
skilld
6:45 PM
so we need to update required version

apostnikov
Andrey Postnikov @apostnikov
skilld
6:45 PM
But depends on version of docker and compose
I'm not sure it will work on MacOS cos it have no shm
Btw move to v3 will need more changes in yml

@andypost
Copy link
Contributor

Let's move to 3.8 annotation and bump requirements for docker and compose

https://docs.docker.com/compose/compose-file/compose-versioning/#version-38

@andypost
Copy link
Contributor

At least 3.5 and 3.6 allows to configure shm/tmpfs size

@andypost
Copy link
Contributor

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.

Auto-set shm size based on host available ram
3 participants