-
Notifications
You must be signed in to change notification settings - Fork 1
/
Justfile
40 lines (33 loc) · 1017 Bytes
/
Justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# just manual: https://github.com/casey/just
_default:
@just --list
# Run the fastapi server
python:
#!/usr/bin/env bash
set -euxo pipefail
cd {{justfile_directory()}}/python-fastapi
poetry run uvicorn app.main:app --log-level critical
# Run the fastapi (async) server
python-async:
#!/usr/bin/env bash
set -euxo pipefail
cd {{justfile_directory()}}/python-fastapi-async
poetry run uvicorn app.main:app --log-level critical
# Run the axum server
rust:
#!/usr/bin/env bash
set -euxo pipefail
cd {{justfile_directory()}}/rust-axum
DATABASE_URL=postgres://postgres:password@localhost:5432/benchmark cargo run --release
# Open psql for the database
psql:
PGPASSWORD=password psql -h localhost -p 5432 -U postgres benchmark
# run the stress test for N requests and C workers
oha N='50000' C='10':
oha -n {{N}} -c {{C}} --disable-keepalive http://localhost:8000/
# Initialize the postgres database
initdb:
#!/usr/bin/env bash
set -euxo pipefail
cd {{justfile_directory()}}/scripts
bash init_db.sh