-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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(helm): Added env variable SERVER_WORKER_AMOUNT #21236
Conversation
From my point of view I would also appreciate the consolidation of gunicorn related environment variables into a common prefix as some of them already start with However this is a more breaking change as a switch from |
|
||
# Increase the gunicorn worker amount, can improve performance drastically | ||
# See: https://docs.gunicorn.org/en/stable/design.html#:~:text=Gunicorn%20should%20only%20need%204,workers%20to%20start%20off%20with. | ||
# SERVER_WORKER_AMOUNT: 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be great if you could add the rest of the variables: SERVER_THREADS_AMOUNT
, GUNICORN_KEEPALIVE
, WORKER_MAX_REQUESTS
, WORKER_MAX_REQUESTS_JITTER
, SERVER_LIMIT_REQUEST_LINE
, SERVER_LIMIT_REQUEST_FIELD_SIZE
modify the link to just: https://docs.gunicorn.org/en/stable/design.html#how-many-workers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find SERVER_WORKER_AMOUNT
anywhere in the Gunicorn docs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@craig-rueda as you can see in run-server.sh the variable SERVER_WORKER_AMOUNT
is introduced by Superset und used to set the flag --workers
when starting gunicorn. It's not a gunicorn variable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dpgaspar I added the variables and a link to the general documentation where users can find the settings.
Totally agree, this can probably be done without breaking anything |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, would be great also if you could add a link to where these are used run-server.sh
since their names are a bit confusing (optional)
@dpgaspar what would be your idea for implementing this without breaking the existing configuration interface? A change of all variables to a common Offering backward compatibility for these options from my point of view would require a lot of logic checking for the different variants and defining a set of precedence rules for the different options. What was your idea? |
Could be DRYer but something similar to: if [[ -z "${SERVER_WORKER_AMOUNT}" ]]; then
GUNICORN_WORKERS=${GUNICORN_WORKERS:-1}
elif [[ -z "${GUNICORN_WORKERS}" ]]; then
GUNICORN_WORKERS=${SERVER_WORKER_AMOUNT}
fi
echo ${GUNICORN_WORKERS} ? |
SUMMARY
I added the environment variable SERVER_WORKER_AMOUNT to the helm values file. It is commented out so it won't affect any running instances. We had severe performance problems caused by superset workers timing out. This was solved and the general Superset performance was improved by increasing the Server Worker Amount. Although this variable can have a huge impact on performance it is never mentioned, neither in the docs nor in the helm chart.
The standard value of 1 is set in run-server.sh.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
TESTING INSTRUCTIONS
Change the variable, at the start of the containers you can see the workers starting up in the logs.
ADDITIONAL INFORMATION