Fix alpha and beta running OOM when starting the gunicorn workers #258
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.
Problem
Currently we start 6 gunicorn instances à 6 workers, which results in alpha and beta to be OOM when trying to boot up the workers, and the gunicorn processes get OOM-killed.
Since production is on a beefier machine/container, it works fine there.
Solution
This PR makes the worker count per instance configurable by reading a new property
worker-count
fromconfig.ini
inspacedock-prepare.sh
(executed byspacedock-prepare.service
, writing it in a new file which is then sourced asEnvironmentFile
in the[email protected]
.The services use it as value to the
--workers
parameter.Open for improvement suggestions.
I also removed the systemd-related remainings of SpaceDock-Notify, which is no longer needed since #246.