diff --git a/frameworks/varnish/Dockerfile b/frameworks/varnish/Dockerfile index 6a251e908..0564b646a 100644 --- a/frameworks/varnish/Dockerfile +++ b/frameworks/varnish/Dockerfile @@ -28,6 +28,6 @@ COPY default.vcl /etc/varnish/default.vcl COPY tls.conf /etc/varnish/tls.conf COPY --chmod=0755 entrypoint.sh /entrypoint.sh -EXPOSE 8080 8443 +EXPOSE 8080 8081 8082 8443 ENTRYPOINT ["/entrypoint.sh"] diff --git a/frameworks/varnish/README.md b/frameworks/varnish/README.md index 2d4daa213..6385fe2c8 100644 --- a/frameworks/varnish/README.md +++ b/frameworks/varnish/README.md @@ -30,7 +30,18 @@ backend process at all. | `/baseline11` | GET | Sums query parameter values, computed by `httparena.baseline_sum()` | | `/baseline11` | POST | Sums query parameters + request body | | `/baseline2` | GET | Same sum logic, over HTTP/2 + TLS (port 8443) | +| `/baseline2` (h2c) | GET | Same sum logic, over cleartext HTTP/2 prior-knowledge (port 8082) | | `/static/{filename}` | GET | Served by `vmod-fileserver` from `/data/static`, cached by Varnish | +| `/static/{filename}` (TLS) | GET | Same fileserver route, over HTTP/1.1 + TLS (port 8081) | + +## Listeners + +| Port | Protocol | Used by | +|------|----------|---------| +| 8080 | HTTP/1.1 (cleartext) | `baseline`, `pipelined`, `limited-conn`, `latency-10k` | +| 8081 | HTTP/1.1 + TLS | `static-tls` | +| 8082 | HTTP/2 (cleartext, prior-knowledge) | `baseline-h2c` | +| 8443 | HTTP/2 + TLS | `baseline-h2`, `static-h2` | ## Notes @@ -45,6 +56,9 @@ backend process at all. - POST bodies are read directly by the vmod via `Ctx::req_body` — no `std.cache_req_body()` needed, since nothing downstream (there's no real backend) needs to read the same body a second time. +- `latency-10k` drives the same `/baseline11` GET the `baseline` profile + already validates, just at a pinned 10K req/s instead of an open-loop + load — no extra code needed to subscribe. - The vmod is built from source in a throwaway Docker build stage (Rust toolchain + `varnish-dev` headers matching the base image's exact version); only the compiled `.so` (and `/etc/mime.types`) is copied into the final diff --git a/frameworks/varnish/default.vcl b/frameworks/varnish/default.vcl index 17a31aade..111b77799 100644 --- a/frameworks/varnish/default.vcl +++ b/frameworks/varnish/default.vcl @@ -17,6 +17,14 @@ sub vcl_recv { } } +sub vcl_backend_response { + if (bereq.url ~ "^/static/") { + # Real caching, just revalidated often enough to notice a file that + # changed on disk within the staleness probe's window. + set beresp.ttl = 5s; + } +} + sub vcl_synth { set resp.http.Content-Type = "text/plain"; diff --git a/frameworks/varnish/entrypoint.sh b/frameworks/varnish/entrypoint.sh index 8e672c6b7..f7f7fea69 100755 --- a/frameworks/varnish/entrypoint.sh +++ b/frameworks/varnish/entrypoint.sh @@ -3,6 +3,7 @@ set -e exec varnishd -F \ -a :8080 \ + -a :8082 \ -A /etc/varnish/tls.conf \ -f /etc/varnish/default.vcl \ -p feature=+http2 \ diff --git a/frameworks/varnish/meta.json b/frameworks/varnish/meta.json index 0738baf05..c276aec1d 100644 --- a/frameworks/varnish/meta.json +++ b/frameworks/varnish/meta.json @@ -10,8 +10,11 @@ "baseline", "pipelined", "limited-conn", + "static-tls", "baseline-h2", - "static-h2" + "static-h2", + "baseline-h2c", + "latency-10k" ], "maintainers": [ "guillaume.quintard@varnish-software.com" diff --git a/frameworks/varnish/tls.conf b/frameworks/varnish/tls.conf index 01d835507..f3f0e5ffb 100644 --- a/frameworks/varnish/tls.conf +++ b/frameworks/varnish/tls.conf @@ -6,3 +6,12 @@ frontend = { private-key = "/certs/server.key" } } + +frontend = { + host = "0.0.0.0" + port = "8081" + pem-file = { + cert = "/certs/server.crt" + private-key = "/certs/server.key" + } +} diff --git a/site/data/results/varnish.json b/site/data/results/varnish.json index c267258e4..03887ee6c 100644 --- a/site/data/results/varnish.json +++ b/site/data/results/varnish.json @@ -4,19 +4,19 @@ "baseline-4096": { "framework": "varnish", "language": "C", - "rps": 204732, - "avg_latency": "15.45ms", - "p99_latency": "71.40ms", - "cpu": "6403.0%", - "memory": "845MiB", + "rps": 199035, + "avg_latency": "17.27ms", + "p99_latency": "70.70ms", + "cpu": "6256.6%", + "memory": "920MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "32.17MB/s", - "input_bw": "15.82MB/s", + "bandwidth": "31.28MB/s", + "input_bw": "15.37MB/s", "reconnects": 3, - "status_2xx": 1023661, + "status_2xx": 995175, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 @@ -24,18 +24,18 @@ "baseline-h2-1024": { "framework": "varnish", "language": "C", - "rps": 206181, - "avg_latency": "85.58ms", - "p99_latency": "1.05s", - "cpu": "6470.8%", - "memory": "4.8GiB", + "rps": 202194, + "avg_latency": "93.26ms", + "p99_latency": "1.15s", + "cpu": "6508.8%", + "memory": "4.9GiB", "connections": 1024, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "19.86MB/s", + "bandwidth": "19.52MB/s", "reconnects": 0, - "status_2xx": 1043277, + "status_2xx": 1025127, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 @@ -43,38 +43,119 @@ "baseline-h2-256": { "framework": "varnish", "language": "C", - "rps": 213803, - "avg_latency": "85.82ms", - "p99_latency": "245.62ms", - "cpu": "6478.3%", + "rps": 217317, + "avg_latency": "86.67ms", + "p99_latency": "204.94ms", + "cpu": "6466.0%", "memory": "4.5GiB", "connections": 256, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "20.27MB/s", + "bandwidth": "20.61MB/s", "reconnects": 0, - "status_2xx": 1077568, + "status_2xx": 1090933, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 }, + "baseline-h2c-1024": { + "framework": "varnish", + "language": "C", + "rps": 213225, + "avg_latency": "87.39ms", + "p99_latency": "482.51ms", + "cpu": "6405.1%", + "memory": "4.9GiB", + "connections": 1024, + "threads": 64, + "duration": "5s", + "pipeline": 1, + "bandwidth": "20.63MB/s", + "reconnects": 0, + "status_2xx": 1081053, + "status_3xx": 0, + "status_4xx": 0, + "status_5xx": 0 + }, + "baseline-h2c-256": { + "framework": "varnish", + "language": "C", + "rps": 221962, + "avg_latency": "82.15ms", + "p99_latency": "202.27ms", + "cpu": "6405.4%", + "memory": "4.5GiB", + "connections": 256, + "threads": 64, + "duration": "5s", + "pipeline": 1, + "bandwidth": "21.14MB/s", + "reconnects": 0, + "status_2xx": 1118689, + "status_3xx": 0, + "status_4xx": 0, + "status_5xx": 0 + }, + "baseline-h2c-4096": { + "framework": "varnish", + "language": "C", + "rps": 169108, + "avg_latency": "103.48ms", + "p99_latency": "950.36ms", + "cpu": "6318.2%", + "memory": "5.2GiB", + "connections": 4096, + "threads": 64, + "duration": "5s", + "pipeline": 1, + "bandwidth": "17.29MB/s", + "reconnects": 0, + "status_2xx": 862453, + "status_3xx": 0, + "status_4xx": 0, + "status_5xx": 0 + }, + "latency-10k-1024": { + "framework": "varnish", + "language": "C", + "rps": 9983, + "avg_latency": "100.1us", + "p99_latency": "140.0us", + "cpu": "74.7%", + "memory": "656MiB", + "connections": 1024, + "threads": 64, + "duration": "20s", + "pipeline": 1, + "bandwidth": "1.63MB/s", + "reconnects": 0, + "status_2xx": 199682, + "status_3xx": 0, + "status_4xx": 0, + "status_5xx": 0, + "cpu_usec": 15480155, + "cpu_per_req_us": 77.524, + "target_rate": 10000, + "rate_ratio": 0.9983, + "p99_9_latency": "250.0us" + }, "limited-conn-4096": { "framework": "varnish", "language": "C", - "rps": 189574, - "avg_latency": "9.24ms", - "p99_latency": "57.80ms", - "cpu": "6523.0%", - "memory": "785MiB", + "rps": 183208, + "avg_latency": "9.82ms", + "p99_latency": "61.30ms", + "cpu": "6517.2%", + "memory": "798MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "29.78MB/s", - "input_bw": "14.64MB/s", - "reconnects": 94887, - "status_2xx": 947873, + "bandwidth": "28.79MB/s", + "input_bw": "14.15MB/s", + "reconnects": 91548, + "status_2xx": 916043, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 @@ -82,18 +163,18 @@ "pipelined-4096": { "framework": "varnish", "language": "C", - "rps": 283650, - "avg_latency": "194.87ms", - "p99_latency": "458.80ms", - "cpu": "6509.3%", - "memory": "1.3GiB", + "rps": 279036, + "avg_latency": "169.03ms", + "p99_latency": "704.30ms", + "cpu": "6411.5%", + "memory": "830MiB", "connections": 4096, "threads": 64, "duration": "5s", "pipeline": 16, - "bandwidth": "44.70MB/s", + "bandwidth": "43.85MB/s", "reconnects": 1, - "status_2xx": 1418251, + "status_2xx": 1395183, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 @@ -101,18 +182,18 @@ "static-h2-1024": { "framework": "varnish", "language": "C", - "rps": 140630, - "avg_latency": "126.80ms", - "p99_latency": "2.05s", - "cpu": "6525.2%", - "memory": "4.7GiB", + "rps": 139986, + "avg_latency": "126.50ms", + "p99_latency": "1.72s", + "cpu": "6596.1%", + "memory": "4.6GiB", "connections": 1024, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "8.28GB/s", + "bandwidth": "8.25GB/s", "reconnects": 0, - "status_2xx": 711588, + "status_2xx": 708333, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 @@ -120,18 +201,37 @@ "static-h2-256": { "framework": "varnish", "language": "C", - "rps": 151545, - "avg_latency": "53.37ms", - "p99_latency": "161.06ms", - "cpu": "6523.4%", - "memory": "2.2GiB", + "rps": 150998, + "avg_latency": "53.68ms", + "p99_latency": "558.74ms", + "cpu": "6566.5%", + "memory": "2.4GiB", "connections": 256, "threads": 64, "duration": "5s", "pipeline": 1, - "bandwidth": "9.02GB/s", + "bandwidth": "8.97GB/s", + "reconnects": 0, + "status_2xx": 758012, + "status_3xx": 0, + "status_4xx": 0, + "status_5xx": 0 + }, + "static-tls-1024": { + "framework": "varnish", + "language": "C", + "rps": 308685, + "avg_latency": "3.64ms", + "p99_latency": "307.30ms", + "cpu": "6291.3%", + "memory": "709MiB", + "connections": 1024, + "threads": 64, + "duration": "5s", + "pipeline": 1, + "bandwidth": "18.36GB", "reconnects": 0, - "status_2xx": 762276, + "status_2xx": 1574220, "status_3xx": 0, "status_4xx": 0, "status_5xx": 0 diff --git a/site/static/logs/baseline-h2c/1024/varnish.log b/site/static/logs/baseline-h2c/1024/varnish.log new file mode 100644 index 000000000..1914a9f67 --- /dev/null +++ b/site/static/logs/baseline-h2c/1024/varnish.log @@ -0,0 +1,5 @@ +Debug: Version: varnish-9.0.3 revision 0a625649cd40af4b6c10be5e58a2e89a5e275baa +Debug: Platform: Linux,6.17.0-22-generic,x86_64,-jnone,-sdefault,-sdefault,-hcritbit +Debug: Child (20) Started +Child launched OK +Info: Child (20) said Child starts diff --git a/site/static/logs/baseline-h2c/256/varnish.log b/site/static/logs/baseline-h2c/256/varnish.log new file mode 100644 index 000000000..1914a9f67 --- /dev/null +++ b/site/static/logs/baseline-h2c/256/varnish.log @@ -0,0 +1,5 @@ +Debug: Version: varnish-9.0.3 revision 0a625649cd40af4b6c10be5e58a2e89a5e275baa +Debug: Platform: Linux,6.17.0-22-generic,x86_64,-jnone,-sdefault,-sdefault,-hcritbit +Debug: Child (20) Started +Child launched OK +Info: Child (20) said Child starts diff --git a/site/static/logs/baseline-h2c/4096/varnish.log b/site/static/logs/baseline-h2c/4096/varnish.log new file mode 100644 index 000000000..1914a9f67 --- /dev/null +++ b/site/static/logs/baseline-h2c/4096/varnish.log @@ -0,0 +1,5 @@ +Debug: Version: varnish-9.0.3 revision 0a625649cd40af4b6c10be5e58a2e89a5e275baa +Debug: Platform: Linux,6.17.0-22-generic,x86_64,-jnone,-sdefault,-sdefault,-hcritbit +Debug: Child (20) Started +Child launched OK +Info: Child (20) said Child starts diff --git a/site/static/logs/latency-10k/1024/varnish.log b/site/static/logs/latency-10k/1024/varnish.log new file mode 100644 index 000000000..1914a9f67 --- /dev/null +++ b/site/static/logs/latency-10k/1024/varnish.log @@ -0,0 +1,5 @@ +Debug: Version: varnish-9.0.3 revision 0a625649cd40af4b6c10be5e58a2e89a5e275baa +Debug: Platform: Linux,6.17.0-22-generic,x86_64,-jnone,-sdefault,-sdefault,-hcritbit +Debug: Child (20) Started +Child launched OK +Info: Child (20) said Child starts diff --git a/site/static/logs/static-tls/1024/varnish.log b/site/static/logs/static-tls/1024/varnish.log new file mode 100644 index 000000000..40f4bd46d --- /dev/null +++ b/site/static/logs/static-tls/1024/varnish.log @@ -0,0 +1,5 @@ +Debug: Version: varnish-9.0.3 revision 0a625649cd40af4b6c10be5e58a2e89a5e275baa +Debug: Platform: Linux,6.17.0-22-generic,x86_64,-jnone,-sdefault,-sdefault,-hcritbit +Debug: Child (21) Started +Child launched OK +Info: Child (21) said Child starts