-
Notifications
You must be signed in to change notification settings - Fork 637
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
add uwsgi config as configmap with vars #1487
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
3129dd8
to
35ea059
Compare
Ok, I've tested this now, both with default values and with custom values.
See https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/#setting-sysctls-for-a-pod How I tested:
Visited in web browser and it was live
Final commentsSo the way we have it, either:
There is a 3rd scenario which is, you are running a kernel with a higher default or have manually changed somaxconn on node level to higher value and DON'T want to allow the sysctls setting on pod level. In this case, it would be conceivable that you don't need to set the somaxconn on the pod level. If we want to cater to this scenario we maybe need another variable "set_pod_somaxconn" with default to true and allow people to disable. But this is getting really nitpicky and I think its better we wait until someone actually asks. |
pushed another commit to also up the values in the nginx config if the uwsgi settings are set to higher values than the ngninx defaults Confirmed this rendered correctly:
Then I ran some tests using this web load frame work k6 that essentially loops hitting api/v2/me with the admin users with a ramping # of concurrent clients. With default config, see variety of errors such as: With this config and CR such as:
able to handle constant load of 1000 users hammering /api/v2/me without errors (single web pod) |
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.
looks good
@kdelee Do you mind adding an entry in the README.md for this with an example? |
Before this, uwsgi config was written into the container at build time and there was no way to customize config at deployment time. We have been experimenting with good results customizations to the uwsgi config in other deployments, particularly around the listen queue which allows uwsgi to build up a backlog of unhandled requests. This allows us to deal with bursts of requests better without dropping everything that exceeds the uwsgi listen queue length. securityContext for sysctl on pod spec this applies on whole pod level, not just container To set these sysctls, they have to be allowed on the kubelet level. If they are not, users get a quite clear message that the pods cannot be created with the sysctl securityContext without net.core.somaxconn being added to an allowlist. See https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster/#enabling-unsafe-sysctls
To fully take advantage of larger uwsgi listen queue, we need to additionally increase nginx workers and queue.
Allow setting nginx vars seperately if desired. Add documentation to README
48c2698
to
fb985d9
Compare
@rooftopcellist added some information in the README @Zokormazo I've tested the following three configurations:
|
Wonderful, thank you @kdelee for all of the hard work here! And thank you for all of the details you have included on this PR, that helps greatly, not only for review, but also for users and future contributors. |
@@ -1090,6 +1090,26 @@ Example spec file for volumes and volume mounts | |||
|
|||
> :warning: **Volume and VolumeMount names cannot contain underscores(_)** | |||
|
|||
##### Custom UWSGI Configuration |
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.
😍
Before this, uwsgi config was written into the container at build time and there was no way to customize config at deployment time. (see https://github.com/ansible/awx/blob/8cfb704f86af3f95fcd3926ffe1729cf51aef4b8/tools/ansible/roles/dockerfile/templates/Dockerfile.j2#L207 )
We have been experimenting with good results customizations to the uwsgi config in other deployments, particularly around the listen queue which allows uwsgi to build up a backlog of unhandled requests. This allows us to deal with bursts of requests better without dropping everything that exceeds the uwsgi listen queue length.
SUMMARY
Make uwsgi config mounted at deploy time so we can edit some values w/o building new image
ISSUE TYPE
ADDITIONAL INFORMATION
Doesn't break anything or really introduce anything "new", just surfaces config in a way that it is now editable at deploytime -- whereas previously you would need to build a new AWX container image to get uwsgi config updates