diff --git a/docker/entrypoint-uwsgi.sh b/docker/entrypoint-uwsgi.sh index 3604ceb4c33..333fe9c4f68 100755 --- a/docker/entrypoint-uwsgi.sh +++ b/docker/entrypoint-uwsgi.sh @@ -22,6 +22,11 @@ python3 manage.py check DD_UWSGI_LOGFORMAT_DEFAULT='[pid: %(pid)|app: -|req: -/-] %(addr) (%(dd_user)) {%(vars) vars in %(pktsize) bytes} [%(ctime)] %(method) %(uri) => generated %(rsize) bytes in %(msecs) msecs (%(proto) %(status)) %(headers) headers in %(hsize) bytes (%(switches) switches on core %(core))' +EXTRA_ARGS="" +if [ -n "${DD_UWSGI_MAX_FD}" ]; then + EXTRA_ARGS="${EXTRA_ARGS} --max-fd ${DD_UWSGI_MAX_FD}" +fi + exec uwsgi \ "--${DD_UWSGI_MODE}" "${DD_UWSGI_ENDPOINT}" \ --protocol uwsgi \ @@ -31,5 +36,6 @@ exec uwsgi \ --wsgi dojo.wsgi:application \ --buffer-size="${DD_UWSGI_BUFFER_SIZE:-8192}" \ --http 0.0.0.0:8081 --http-to "${DD_UWSGI_ENDPOINT}" \ - --logformat "${DD_UWSGI_LOGFORMAT:-$DD_UWSGI_LOGFORMAT_DEFAULT}" + --logformat "${DD_UWSGI_LOGFORMAT:-$DD_UWSGI_LOGFORMAT_DEFAULT}" \ + $EXTRA_ARGS # HTTP endpoint is enabled for Kubernetes liveness checks. It should not be exposed as a service. diff --git a/helm/defectdojo/templates/configmap.yaml b/helm/defectdojo/templates/configmap.yaml index 811a9891535..dd7a0eb11b8 100644 --- a/helm/defectdojo/templates/configmap.yaml +++ b/helm/defectdojo/templates/configmap.yaml @@ -38,6 +38,7 @@ data: DD_UWSGI_PASS: unix:///run/defectdojo/uwsgi.sock DD_UWSGI_NUM_OF_PROCESSES: '{{ .Values.django.uwsgi.app_settings.processes | default 2 }}' DD_UWSGI_NUM_OF_THREADS: '{{ .Values.django.uwsgi.app_settings.threads | default 2 }}' + DD_UWSGI_MAX_FD: '{{ .Values.django.uwsgi.app_settings.max_fd }}' DD_DJANGO_METRICS_ENABLED: '{{ .Values.monitoring.enabled }}' NGINX_METRICS_ENABLED: '{{ .Values.monitoring.enabled }}' METRICS_HTTP_AUTH_USER: {{ .Values.monitoring.user | default "monitoring" }} diff --git a/helm/defectdojo/values.yaml b/helm/defectdojo/values.yaml index 75f3d540012..c24cc592494 100644 --- a/helm/defectdojo/values.yaml +++ b/helm/defectdojo/values.yaml @@ -234,6 +234,7 @@ django: app_settings: processes: 2 threads: 2 + # max_fd: 102400 # Uncomment to set the maximum number of file descriptors. If not set will be detected by uwsgi enable_debug: false # this also requires DD_DEBUG to be set to True certificates: # includes additional CA certificate as volume, it refrences REQUESTS_CA_BUNDLE env varible