Skip to content

Commit 4633ded

Browse files
authored
Fix gunicorn config for free sku (#1551)
1 parent 0124725 commit 4633ded

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

app/backend/gunicorn.conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import multiprocessing
2+
import os
23

34
max_requests = 1000
45
max_requests_jitter = 50
@@ -9,5 +10,9 @@
910
# https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/web-apps-performance-faqs#why-does-my-request-time-out-after-230-seconds
1011

1112
num_cpus = multiprocessing.cpu_count()
12-
workers = (num_cpus * 2) + 1
13+
if os.getenv("WEBSITE_SKU") == "LinuxFree":
14+
# Free tier reports 2 CPUs but can't handle multiple workers
15+
workers = 1
16+
else:
17+
workers = (num_cpus * 2) + 1
1318
worker_class = "uvicorn.workers.UvicornWorker"

0 commit comments

Comments
 (0)