Skip to content

Commit

Permalink
Add benchmark in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeASSIER committed Feb 7, 2024
1 parent f690090 commit c363db3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def run(url: str, bombardierduration: str):
logging.error(f"🚨 Command failed with return code {e.returncode}")

try:
with open('sozu.log', 'a') as file:
subprocess.run(["./bombardier", "-c", "400", "-p", "intro,result", "--http1", "-l", "-d", bombardierduration, url],stdout=file)
subprocess.run(["./bombardier", "-c", "400", "-p", "intro,result", "--fasthttp", "-l", "-t", "10s", "-d", bombardierduration, url])

except subprocess.CalledProcessError as e:
logging.error(f"🚨 Failed to run benchmark {e.returncode}")

Expand All @@ -37,6 +37,7 @@ def run(url: str, bombardierduration: str):
logging.basicConfig(encoding='utf-8', level=logging.INFO)
logging.info("💣 Launching benchmark")

run("https://rsa-2048.sozu.io:8443/api", "2m")
run("https://rsa-4096.sozu.io:8443/api", "2m")
run("https://edcsa.sozu.io:8443/api", "2m")
run("http://sozu.io:8080/api", "1m")
run("https://rsa-2048.sozu.io:8443/api", "1m")
run("https://rsa-4096.sozu.io:8443/api", "1m")
run("https://ecdsa.sozu.io:8443/api", "1m")
3 changes: 2 additions & 1 deletion .github/workflows/bench.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,12 @@ cipher_list = [
]

[clusters]
[clusters.TestCluster]
[clusters.BenchCluster]

protocol = "http"
load_balancing = "ROUND_ROBIN"
frontends = [
{ address = "0.0.0.0:8080", hostname = "sozu.io"},
{ address = "0.0.0.0:8443", hostname = "rsa-2048.sozu.io", certificate = "rsa-2048.pem", certificate_chain = "rsa-2048.pem", key = "rsa-2048.key"},
{ address = "0.0.0.0:8443", hostname = "rsa-4096.sozu.io", certificate = "rsa-4096.pem", certificate_chain = "rsa-4096.pem", key = "rsa-4096.key"},
{ address = "0.0.0.0:8443", hostname = "ecdsa.sozu.io", certificate = "ecdsa.pem", certificate_chain = "ecdsa.pem", key = "ecdsa.key"},
Expand Down
10 changes: 2 additions & 8 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,7 @@ jobs:
chmod +x lagging_server
chmod +x sozu
- name: Launch bench
- name: Launch bench
working-directory: .github/workflows
run:
python bench.py

- name: 📤 Upload sozu logs
uses: actions/upload-artifact@v4
with:
name: sozu_logs
path: .github/workflows/sozu.log
python bench.py

0 comments on commit c363db3

Please sign in to comment.