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

XXX feat(controller): permit setting GUNICORN_WORKERS #75

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions charts/controller/templates/controller-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ spec:
value: "{{ .Values.global.registry_location }}"
- name: "DEIS_REGISTRY_SECRET_PREFIX"
value: "{{ .Values.global.secret_prefix }}"
- name: "GUNICORN_WORKERS"
value: "{{ .Values.global.gunicorn_workers }}"
- name: "CONN_MAX_AGE"
value: "{{ .Values.global.conn_max_age }}"
- name: "SLUGRUNNER_IMAGE_NAME"
valueFrom:
configMapKeyRef:
Expand Down
15 changes: 15 additions & 0 deletions charts/controller/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,21 @@ global:
host_port: 5555
# Prefix for the imagepull secret created when using private registry
secret_prefix: "private-registry"
# Clusters with large nodes (24 CPU+) may need to lower or tune the number of GUNICORN_WORKERS.
#
# Default value is based on your number of CPUs:
# - (os.cpu_count() or 4) * 4 + 1
# This setting probably should not be higher than max_connections which defaults to 100
# gunicorn_workers: 13
# If there are enough gunicorn workers to use up max_connections, you may also want to reduce CONN_MAX_AGE
# so health checks time out their connection faster and don't use all available connections
#
# Valid values are a number of seconds, or 0 to disable persistent connections.
# Setting the value to "None" will ensure that connections are never timed out.
# - 0
# - 600
# - "None"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the default value of conn_max_age when no value is set in the chart? Sounds like it will be "None" by default... Is that the correct behaviour we want?

# conn_max_age: 600
# Experimental feature to toggle using kubernetes ingress instead of the Deis router.
#
# Valid values are:
Expand Down
4 changes: 1 addition & 3 deletions rootfs/api/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@
'security.W008'
]

CONN_MAX_AGE = 60 * 3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be added back. I think this is a different CONN_MAX_AGE env variable?


# SECURITY: change this to allowed fqdn's to prevent host poisioning attacks
# https://docs.djangoproject.com/en/1.11/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['*']
Expand Down Expand Up @@ -368,7 +366,7 @@
'HOST': os.environ.get('DEIS_DATABASE_SERVICE_HOST', ''),
'PORT': os.environ.get('DEIS_DATABASE_SERVICE_PORT', 5432),
# https://docs.djangoproject.com/en/1.11/ref/databases/#persistent-connections
'CONN_MAX_AGE': 600,
'CONN_MAX_AGE': os.environ.get('CONN_MAX_AGE', 600),
}
}

Expand Down