Skip to content

Commit 01751d2

Browse files
authored
python: add granian http server (the-benchmarker#7397)
1 parent 09dab0d commit 01751d2

File tree

6 files changed

+37
-4
lines changed

6 files changed

+37
-4
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,6 @@ obj
5151
/elixir/*/deps/
5252
/elixir/*/mix.lock
5353
erl_crash.dump
54+
55+
# python
56+
__pycache__/

python/config.yaml

+20-4
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ language:
2323
WORKER_CLASS: sync
2424
PYTHON_APP: server:app
2525
command: >
26-
gunicorn --log-level critical \
27-
--bind 0.0.0.0:3000 \
28-
--reuse-port \
26+
gunicorn \
27+
--log-level critical \
28+
--bind 0.0.0.0:3000 \
29+
--reuse-port \
2930
--workers $(nproc) \
3031
--worker-class ${WORKER_CLASS} \
3132
${PYTHON_APP}
@@ -56,7 +57,8 @@ language:
5657
bootstrap:
5758
- pip install uvicorn[standard]
5859
command: >
59-
uvicorn --log-level critical \
60+
uvicorn \
61+
--log-level critical \
6062
--host 0.0.0.0 \
6163
--port 3000 \
6264
--workers $(nproc) \
@@ -77,6 +79,20 @@ language:
7779
environment:
7880
PYTHON_APP: server:app
7981
command: daphne -b 0.0.0.0 -p 3000 ${PYTHON_APP}
82+
granian:
83+
bootstrap:
84+
- pip install granian
85+
environment:
86+
INTERFACE: asgi
87+
PYTHON_APP: server:app
88+
command: >
89+
granian \
90+
--log-level critical \
91+
--interface ${INTERFACE} \
92+
--host 0.0.0.0 \
93+
--port 3000 \
94+
--workers $(nproc) \
95+
${PYTHON_APP}
8096
8197
framework:
8298
engines:

python/django/config.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ framework:
55
engines:
66
- gunicorn
77
- uwsgi
8+
- granian
89
- uvicorn
910
- hypercorn
1011
- daphne
@@ -17,6 +18,10 @@ language:
1718
uwsgi:
1819
environment:
1920
PYTHON_APP: app.wsgi:application
21+
granian:
22+
environment:
23+
INTERFACE: wsgi
24+
PYTHON_APP: app.wsgi:application
2025
daphne:
2126
environment:
2227
PYTHON_APP: app.asgi:application

python/fastapi/config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ framework:
66
- uvicorn
77
- hypercorn
88
- daphne
9+
- granian

python/flask/config.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,10 @@ framework:
66
- gunicorn
77
- uwsgi
88
- waitress
9+
- granian
10+
11+
language:
12+
engines:
13+
granian:
14+
environment:
15+
INTERFACE: wsgi

python/litestar/config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ framework:
66
- uvicorn
77
- hypercorn
88
- daphne
9+
- granian

0 commit comments

Comments
 (0)