Skip to content

Commit ed934fa

Browse files
authored
Merge pull request #535 from MDA2AV/gatewayz
add tests, gateway h3, production stack
2 parents e18aa6c + 5ba137e commit ed934fa

33 files changed

Lines changed: 989 additions & 119 deletions

scripts/benchmark.sh

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ run_one() {
205205
# best_rps starts at -1 so that the *first* measurement always wins,
206206
# even if its rps is 0 (ws-echo, zero-traffic regressions). Without this,
207207
# BEST_M would carry stale metrics from a previous profile.
208-
local best_rps=-1 best_output="" best_cpu="0%" best_mem="0MiB"
208+
local best_rps=-1 best_output="" best_cpu="0%" best_mem="0MiB" best_breakdown=""
209209
BEST_M=()
210210
local run
211211

@@ -241,6 +241,7 @@ run_one() {
241241
best_output="$output"
242242
best_cpu="$STATS_AVG_CPU"
243243
best_mem="$STATS_PEAK_MEM"
244+
best_breakdown="$STATS_BREAKDOWN"
244245
BEST_M=()
245246
for k in "${!m[@]}"; do BEST_M[$k]="${m[$k]}"; done
246247
fi
@@ -279,6 +280,12 @@ save_result() {
279280
local dir="$RESULTS_DIR/$profile/$CONNS"
280281
mkdir -p "$dir"
281282

283+
local cpu_extra=""
284+
if [ -n "$best_breakdown" ]; then
285+
cpu_extra=",
286+
\"cpu_breakdown\": \"$best_breakdown\""
287+
fi
288+
282289
local tpl_extra=""
283290
if [ "$profile" = "api-4" ] || [ "$profile" = "api-16" ]; then
284291
tpl_extra=",
@@ -299,6 +306,17 @@ save_result() {
299306
\"tpl_baseline\": $(( total * 4 / 20 )),
300307
\"tpl_json\": $(( total * 7 / 20 )),
301308
\"tpl_async_db\": $(( total * 3 / 20 ))"
309+
elif [ "$profile" = "production-stack" ] \
310+
&& [ "${BEST_M[status_2xx]:-0}" -gt 0 ] 2>/dev/null; then
311+
# Production-stack mix from reads file (20K URIs):
312+
# 6000 static (30%) / 2000 baseline (10%) / 10000 items (50%) / 2000 me (10%).
313+
# Writes (POST /api/items) add to items but are small (~5% of traffic).
314+
local total=${BEST_M[status_2xx]}
315+
tpl_extra=",
316+
\"tpl_static\": $(( total * 30 / 100 )),
317+
\"tpl_baseline\": $(( total * 10 / 100 )),
318+
\"tpl_items\": $(( total * 50 / 100 )),
319+
\"tpl_me\": $(( total * 10 / 100 ))"
302320
fi
303321

304322
cat > "$dir/${FRAMEWORK}.json" <<EOF
@@ -319,7 +337,7 @@ save_result() {
319337
"status_2xx": ${BEST_M[status_2xx]:-0},
320338
"status_3xx": ${BEST_M[status_3xx]:-0},
321339
"status_4xx": ${BEST_M[status_4xx]:-0},
322-
"status_5xx": ${BEST_M[status_5xx]:-0}${tpl_extra}
340+
"status_5xx": ${BEST_M[status_5xx]:-0}${tpl_extra}${cpu_extra}
323341
}
324342
EOF
325343
info "saved results/$profile/$CONNS/${FRAMEWORK}.json"

site/content/_index.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,13 +155,23 @@ html.dark .test-card-endpoint { color: #64748b; }
155155
</div>
156156

157157
<div class="tests-proto">
158-
<span class="tests-proto-label tests-proto-h2">H/2 Gateway</span>
158+
<span class="tests-proto-label tests-proto-h2">Gateway</span>
159159
<div class="tests-grid">
160-
<a class="test-card" href="docs/test-profiles/h2-gateway/gateway-64">
161-
<div class="test-card-title">Gateway-64</div>
162-
<div class="test-card-desc">Reverse proxy + application server — mixed static, JSON, and async-db workload over HTTP/2 with TLS. 64 CPUs split between proxy and server.</div>
160+
<a class="test-card" href="docs/test-profiles/gateway/gateway-h2">
161+
<div class="test-card-title">Gateway H2</div>
162+
<div class="test-card-desc">Two-service proxy + server stack over HTTP/2 + TLS. Mixed workload: static, JSON, baseline, async-db.</div>
163163
<div class="test-card-endpoint">proxy:8443 → server (h2)</div>
164164
</a>
165+
<a class="test-card" href="docs/test-profiles/gateway/gateway-h3">
166+
<div class="test-card-title">Gateway H3</div>
167+
<div class="test-card-desc">Same two-service stack as Gateway H2 but with HTTP/3 + QUIC at the edge.</div>
168+
<div class="test-card-endpoint">proxy:8443 → server (h3/quic)</div>
169+
</a>
170+
<a class="test-card" href="docs/test-profiles/gateway/production-stack">
171+
<div class="test-card-title">Production Stack H2</div>
172+
<div class="test-card-desc">Four-service CRUD API: edge + Redis + JWT auth sidecar + server. 10K-item cache-aside, concurrent reads + writes.</div>
173+
<div class="test-card-endpoint">edge:8443 → authsvc → server → redis/postgres</div>
174+
</a>
165175
</div>
166176
</div>
167177

site/content/docs/add-framework/meta-json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,4 @@ The `gateway-64` profile tests your framework as part of a complete deployment s
8888
- The proxy, caching layer, and internal protocol choices are all part of the benchmark
8989
- Static files can be served directly by the proxy (e.g., Nginx) instead of the application server
9090

91-
See the [Gateway-64 implementation guide](/docs/test-profiles/h2-gateway/gateway-64/implementation) for detailed documentation, three complete compose examples (two-tier, three-tier, and single-tier), CPU topology rules, and proxy configuration options.
91+
See the [Gateway-64 implementation guide](/docs/test-profiles/gateway/gateway-h2/implementation) for detailed documentation, three complete compose examples (two-tier, three-tier, and single-tier), CPU topology rules, and proxy configuration options.

site/content/docs/scoring/composite-score.md

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,23 +72,13 @@ Not all profiles count toward the composite score. Profiles marked as **scored**
7272
| Baseline | Yes | Query parsing over QUIC (UDP) with TLS 1.3 |
7373
| Static | Yes | 20 static files served over QUIC (UDP) with TLS 1.3 |
7474

75-
### H/2 Gateway
75+
### Gateway
7676

7777
| Profile | Scored | Workload |
7878
|---|---|---|
79-
| Gateway-64 | Yes | Two-service proxy + server stack (static / JSON / async-db / baseline mix) over HTTP/2 + TLS, 64-CPU budget split freely between proxy and server |
80-
81-
### H/3 Gateway
82-
83-
| Profile | Scored | Workload |
84-
|---|---|---|
85-
| Gateway-H3 | Yes | Same two-service stack as Gateway-64 but with HTTP/3 + QUIC at the edge, measuring h3 proxy termination efficiency at realistic connection counts |
86-
87-
### Production Stack
88-
89-
| Profile | Scored | Workload |
90-
|---|---|---|
91-
| Production Stack | Yes | Four-service CRUD API deployment (edge + Redis cache + JWT auth sidecar + framework server) with 10K-item working set. JWT HMAC-SHA256 verified on every `/api/*` request (no caching). Framework implements cache-aside with ≤1s TTL (cache strategy is the framework's choice). Concurrent reads + writes via split h2load. |
79+
| Gateway H2 | Yes | Two-service proxy + server stack over HTTP/2 + TLS, mixed workload (static 30%, JSON 35%, baseline 20%, async-db 15%), 64-CPU budget |
80+
| Gateway H3 | Yes | Same two-service stack over HTTP/3 + QUIC at the edge |
81+
| Production Stack H2 | Yes | Four-service CRUD API (edge + Redis + JWT auth + server) with 10K-item cache-aside, JWT verified every request, concurrent reads + writes |
9282

9383
### gRPC
9484

site/content/docs/test-profiles/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Data files are **mounted automatically** by the benchmark runner — your Docker
3333
{{< cards >}}
3434
{{< card link="h1" title="H/1.1" subtitle="Isolated single-endpoint benchmarks and multi-endpoint workload mixes over plain TCP." icon="lightning-bolt" >}}
3535
{{< card link="h2" title="H/2" subtitle="Baseline and static file benchmarks over encrypted TLS connections with stream multiplexing." icon="globe-alt" >}}
36-
{{< card link="h2-gateway" title="H/2 Gateway" subtitle="Reverse proxy + application server benchmarks over HTTP/2 with TLS. Tests full-stack deployment performance." icon="server" >}}
36+
{{< card link="gateway" title="Gateway" subtitle="Multi-service deployments: proxy + server (H2/H3) and full CRUD production stack with JWT auth + cache-aside." icon="server" >}}
3737
{{< card link="h3" title="H/3" subtitle="Baseline and static file benchmarks over QUIC for frameworks with native H/3 support." icon="globe-alt" >}}
3838
{{< card link="grpc" title="gRPC" subtitle="Unary RPC throughput over cleartext HTTP/2 using Protocol Buffers serialization." icon="globe-alt" >}}
3939
{{< card link="ws" title="WebSocket" subtitle="WebSocket echo throughput measuring frame processing performance." icon="globe-alt" >}}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
weight: 3
3+
title: Gateway
4+
---
5+
6+
Gateway test profiles benchmark multi-service deployments — proxy + server, with optional auth sidecars, caches, and databases. Unlike isolated tests that measure a single framework container, gateway tests measure the **end-to-end throughput of the entire stack** as a unit.
7+
8+
All gateway tests use Docker Compose for orchestration, pin services to specific CPU cores via `cpuset`, and give entries full control over their architecture within a fixed 64-CPU budget.
9+
10+
{{< cards >}}
11+
{{< card link="gateway-h2" title="Gateway H2" subtitle="Two-service proxy + server stack over HTTP/2 + TLS. Mixed workload: static 30%, JSON 35%, baseline 20%, async-db 15%." icon="server" >}}
12+
{{< card link="gateway-h3" title="Gateway H3" subtitle="Same two-service stack as Gateway H2 but with HTTP/3 + QUIC at the edge." icon="lightning-bolt" >}}
13+
{{< card link="production-stack" title="Production Stack H2" subtitle="Four-service CRUD API: edge + Redis + JWT auth sidecar + server. 10K-item cache-aside, JWT verified every request, concurrent reads + writes." icon="shield-check" >}}
14+
{{< /cards >}}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
title: Gateway H2
3+
---
4+
5+
Two-service proxy + server stack over HTTP/2 + TLS. Proxy serves static files directly from disk, forwards dynamic endpoints (baseline, JSON, async-db) to the application server. 64 CPUs split freely between the two services.
6+
7+
{{< cards >}}
8+
{{< card link="implementation" title="Implementation Guidelines" subtitle="Compose file layout, endpoint responsibilities, proxy-to-server protocol, CPU allocation." icon="code" >}}
9+
{{< card link="validation" title="Validation" subtitle="Checks executed by validate.sh against the running compose stack." icon="check-circle" >}}
10+
{{< /cards >}}

site/content/docs/test-profiles/h2-gateway/gateway-64/implementation.md renamed to site/content/docs/test-profiles/gateway/gateway-h2/implementation.md

File renamed without changes.

site/content/docs/test-profiles/h2-gateway/gateway-64/validation.md renamed to site/content/docs/test-profiles/gateway/gateway-h2/validation.md

File renamed without changes.

site/content/docs/test-profiles/h3-gateway/gateway-h3/_index.md renamed to site/content/docs/test-profiles/gateway/gateway-h3/_index.md

File renamed without changes.

0 commit comments

Comments
 (0)