Replace pids_limit with memory limits #181
Open
+6
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Replace
pids_limitwithmem_limitfor postgres and mattermost services to prevent connection failures under normal load.Problem
A customer reported PostgreSQL connection failures caused by hitting the
pids_limit: 100constraint. PostgreSQL creates one process per database connection, meaning the database could only handle ~90-95 concurrent connections before exhausting the PID limit. This is too restrictive for production deployments with moderate traffic.Changes
pids_limit: 100, addedmem_limit: 16Gpids_limit: 200, addedmem_limit: 4GRationale
Memory limits provide better resource protection while allowing PostgreSQL to scale connections naturally based on actual load. The
pids_limitapproach was overly restrictive and caused operational issues in real-world scenarios.The default values chosen (16G/4G) are based on typical medium-sized deployment requirements and can be adjusted per the scaling documentation.
Documentation
Inline comments added referencing https://docs.mattermost.com/administration-guide/scale/scaling-for-enterprise.html