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

feat: dynamically set shm #135

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

feat: dynamically set shm #135

wants to merge 1 commit into from

Conversation

fryorcraken
Copy link
Contributor

Set a higher SHM if there's 4GB+ of RAM on the host.

Attempting to fix DRIVER_ERROR encountered in the wild.

Set a higher SHM if there's 4GB+ of RAM on the host.

Attempting to fix DRIVER_ERROR encountered in the wild.
Copy link
Contributor

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for it!
I just added a minor suggestion :)

Comment on lines +59 to +70
# Set PostgreSQL container Shared Memory value
if [ -z "${POSTGRES_SHM}" ]; then
TOTAL_MEM_MB=$(free -m|grep Mem| awk '{ print $2 }')
if [ "${TOTAL_MEM_MB}" -ge 4096 ]; then
# Allocate 2GB of Shared Memory for Postgres if machine has more than 4GB RAM
POSTGRES_SHM='2g'
echo "Setting PostgreSQL container SHM to ${POSTGRES_SHM}"
echo "POSTGRES_SHM=${POSTGRES_SHM}" >> .env
fi
else
>&2 echo "POSTGRES_SHM is already specified in .env file"
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

This snippet seems not to be related to storage retention so I'd suggest moving it to a separate script

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