refactor(benchmark): replace whoami service with bench server

- Updated dev.compose.yml to define a new bench service that serves 4096 bytes of random data.
- Modified configurations for Traefik, Caddy, and Nginx to route traffic to the new bench service.
- Added Dockerfile and Go application for the bench server, including necessary Go modules.
- Updated benchmark script to target the new bench service endpoint.
This commit is contained in:
yusing
2026-01-03 12:40:10 +08:00
parent 5a2e327cce
commit 02d0a910f6
6 changed files with 80 additions and 23 deletions

View File

@@ -95,10 +95,12 @@ services:
labels:
proxy.#1.scheme: h2c
proxy.#1.port: 80
whoami:
bench: # returns 4096 bytes of random data
<<: *benchmark
image: traefik/whoami:latest
container_name: whoami
build:
context: cmd/bench_server
dockerfile: Dockerfile
container_name: bench
godoxy:
<<: *benchmark
build: .
@@ -156,22 +158,22 @@ configs:
- providers.yml
godoxy_provider:
content: |
whoami.domain.com:
host: whoami
bench.domain.com:
host: bench
traefik_config:
content: |
http:
routers:
whoami:
rule: "Host(`whoami.domain.com`)"
bench:
rule: "Host(`bench.domain.com`)"
entryPoints:
- web
service: whoami
service: bench
services:
whoami:
bench:
loadBalancer:
servers:
- url: "http://whoami:80"
- url: "http://bench:80"
caddy_config:
content: |
{
@@ -184,8 +186,8 @@ configs:
}
}
http://whoami.domain.com {
reverse_proxy whoami:80
http://bench.domain.com {
reverse_proxy bench:80
}
nginx_config:
content: |
@@ -213,7 +215,7 @@ configs:
keepalive_requests 10000;
upstream backend {
server whoami:80;
server bench:80;
keepalive 128;
}
@@ -227,7 +229,7 @@ configs:
server {
listen 80;
server_name whoami.domain.com;
server_name bench.domain.com;
http2 on;
location / {