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

Fix alpha and beta running OOM when starting the gunicorn workers #258

Closed
wants to merge 2 commits into from

Conversation

DasSkelett
Copy link
Member

@DasSkelett DasSkelett commented May 13, 2020

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 from config.ini in spacedock-prepare.sh (executed by spacedock-prepare.service, writing it in a new file which is then sourced as EnvironmentFile 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.

Makes the gunicorn worker count configurable by parsing the config.ini in spacedock-prepare.service's prepare.sh,
and writing it into a systemd-readable environment file, which is the sourced in [email protected].
@DasSkelett
Copy link
Member Author

Has been solved by removing the symlink from /etc/systemd/systemd/spacedock.target to <repo>/systemd/spacedock.target, and removing all but one [email protected] dependencies.
I'll close this, and instead push some documentation mentioning this, maybe in the spacedock.target file.

@DasSkelett DasSkelett closed this May 14, 2020
DasSkelett added a commit to DasSkelett/SpaceDock that referenced this pull request May 14, 2020
`spacedock.target` is not directly used on our servers, instead an edited copy exists in `/etc/systemd/system/`.
  See KSP-SpaceDock#258 for more information.
The `README.md` has been updated to reflect newer versions of Python and other dependencies in use.
The `api.md` has also been extended a little.
@DasSkelett DasSkelett deleted the fix/worker-count branch May 26, 2020 10:48
HebaruSan pushed a commit that referenced this pull request Jun 3, 2020
`spacedock.target` is not directly used on our servers, instead an edited copy exists in `/etc/systemd/system/`.
  See #258 for more information.
The `README.md` has been updated to reflect newer versions of Python and other dependencies in use.
The `api.md` has also been extended a little.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant