Skip to content

Commit 34e8203

Browse files
authored
Improve HTTP server configuration (#1625)
1 parent ff69fdb commit 34e8203

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

charts/qiskit-serverless/charts/gateway/templates/deployment.yaml

+10-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,16 @@ spec:
6565
{{- toYaml .Values.securityContext | nindent 12 }}
6666
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
6767
imagePullPolicy: {{ .Values.image.pullPolicy }}
68-
args: [ "gunicorn", "main.wsgi:application", "--bind", "0.0.0.0:{{ .Values.service.port }}", "--workers=4" ]
68+
args: [
69+
"gunicorn",
70+
{{ .Values.application.httpServer.serverModel }},
71+
"--bind", "0.0.0.0:{{ .Values.service.port }}",
72+
"--workers={{ .Values.application.httpServer.workers }}",
73+
"--threads={{ .Values.application.httpServer.threads }}",
74+
"--max-requests={{ .Values.application.httpServer.threads }}",
75+
"--max-requests-jitter={{ .Values.application.httpServer.jitter }}",
76+
"--timeout={{ .Values.application.httpServer.timeout }}"
77+
]
6978
ports:
7079
- name: http
7180
containerPort: {{ .Values.service.port }}

charts/qiskit-serverless/charts/gateway/values.yaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ replicaCount: 1
66
useCertManager: false
77

88
application:
9-
# command: [ "gunicorn", "gateway.wsgi:application", "--bind", "0.0.0.0:8000", "--workers=3" ]
9+
# Gunicorn configuration
10+
httpServer:
11+
serverModel: "main.wsgi:application"
12+
workers: 1
13+
threads: 1
14+
maxRequests: 1200
15+
jitter: 50
16+
timeout: 25
1017
debug: 0
1118
siteHost: "http://127.0.0.1:8000"
1219
rayHost: "http://ray:8265/"

docker-compose-dev.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ services:
3333
build:
3434
context: ./
3535
dockerfile: gateway/Dockerfile
36-
command: gunicorn main.wsgi:application --bind 0.0.0.0:8000 --workers=4
36+
command: gunicorn main.wsgi:application --bind 0.0.0.0:8000 --workers=1 --threads=1 --max-requests=1200 --max-requests-jitter=50 --timeout=25
3737
ports:
3838
- 8000:8000
3939
user: "root" # we use the root user here so the docker-compose watch can sync files into the container

docker-compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ services:
2929
gateway:
3030
container_name: gateway
3131
image: icr.io/quantum-public/qiskit-serverless/gateway:${VERSION:-0.21.1}
32-
command: gunicorn main.wsgi:application --bind 0.0.0.0:8000 --workers=4
32+
command: gunicorn main.wsgi:application --bind 0.0.0.0:8000 --workers=1 --threads=1 --max-requests=1200 --max-requests-jitter=50 --timeout=25
3333
ports:
3434
- 8000:8000
3535
environment:

0 commit comments

Comments
 (0)