go frameworks: add the missing HTTP/1.1 profiles - #1253
Merged
Conversation
Every Go entry that runs an application was missing profiles. gin, echo, chi,
fiber and go-stdlib each carried four endpoints and gain seven profiles;
go-fasthttp gains three.
gin, echo, chi, fiber, go-stdlib static, static-tls, json-tls, async-db,
crud, api-4, api-16 (6 -> 13)
go-fasthttp static-tls, json-tls, crud (10 -> 13)
api-4 and api-16 rotate over /baseline11, /json and /async-db, so wiring
Postgres brings all three profiles with it.
json-tls and static-tls listen on 8081 - the same router behind TLS, not a
second copy of the handlers. go-fasthttp binds it from every worker the same way
they all bind 8080, so the listener is spread rather than parked on one process.
Static file bodies are read from disk on every request. go-fasthttp was serving
them through fasthttp.FS, which keeps small files in an in-memory cache and
writes its own compressed copies next to the originals; the static profiles
forbid holding file bodies in memory in every mode, so that handler is replaced.
Its published static numbers were measured against that cache and should be
expected to move. The standard-mode entries leave the encoding to the
compression middleware they already mount; the tuned ones pick the
pre-compressed sibling from disk per request.
Postgres goes through pgx. One process per entry here, so the whole
DATABASE_MAX_CONN budget is available, less headroom for
superuser_reserved_connections. tags is a JSONB column, so it comes back as
bytes rather than a Go slice.
crud runs cache-aside on Redis through go-redis, 200ms TTL, explicit delete on
update.
go-stdlib had no dependencies and so no go.sum; its Dockerfile copied only
go.mod, which stopped building once it had one.
Validation: 58 passed, 0 failed on all six.
Owner
Author
|
/benchmark-multiple --save |
Contributor
|
👋 Benchmark request received. A collaborator will review and approve the run. |
Contributor
Benchmark ResultsFrameworks: 6 | Test: ✅
|
| Test | Conn | RPS | CPU | Mem | Δ RPS | Δ Mem |
|---|---|---|---|---|---|---|
| baseline | 512 | 289,522 | 2384.7% | 76MiB | -2.0% | +1.3% |
| baseline | 4096 | 476,370 | 3644.2% | 237MiB | -0.2% | +15.0% |
| pipelined | 512 | 721,928 | 3197.4% | 95MiB | -1.2% | +11.8% |
| pipelined | 4096 | 1,063,430 | 4034.7% | 390MiB | -0.8% | +14.4% |
| limited-conn | 512 | 140,107 | 1990.8% | 62MiB | +3.7% | -1.6% |
| limited-conn | 4096 | 162,007 | 2111.8% | 65MiB | +1.8% | ~0% |
| json | 4096 | 216,943 | 3198.7% | 147MiB | +5.5% | +0.7% |
| json-comp | 512 | 187,520 | 5579.1% | 428MiB | +0.5% | -0.7% |
| json-comp | 4096 | 190,659 | 5543.6% | 1.0GiB | -1.7% | -16.7% |
| json-comp | 16384 | 193,444 | 5691.4% | 1.4GiB | -0.6% | -41.7% |
| json-tls | 4096 | 354,283 | 4879.0% | 344MiB | NEW | NEW |
| upload | 32 | 2,448 | 2279.3% | 43MiB | +0.7% | +2.4% |
| upload | 256 | 2,897 | 3848.6% | 90MiB | -0.7% | +32.4% |
| api-4 | 256 | 26,499 | 390.2% | 40MiB | NEW | NEW |
| api-16 | 1024 | 87,714 | 1506.5% | 115MiB | NEW | NEW |
| static | 1024 | 28,807 | 5720.8% | 556MiB | NEW | NEW |
| static | 4096 | 29,796 | 5888.8% | 1.1GiB | NEW | NEW |
| static | 6800 | 30,480 | 5932.1% | 1.3GiB | NEW | NEW |
| static-tls | 1024 | 27,784 | 5778.2% | 550MiB | NEW | NEW |
| static-tls | 4096 | 28,385 | 5859.8% | 1.1GiB | NEW | NEW |
| static-tls | 6800 | 28,885 | 5893.8% | 1.6GiB | NEW | NEW |
| async-db | 1024 | 87,222 | 3961.8% | 179MiB | NEW | NEW |
| crud | 4096 | 54,880 | 2256.1% | 375MiB | NEW | NEW |
✅ echo
| Test | Conn | RPS | CPU | Mem | Δ RPS | Δ Mem |
|---|---|---|---|---|---|---|
| baseline | 512 | 312,867 | 2471.0% | 74MiB | -0.2% | -5.1% |
| baseline | 4096 | 520,255 | 3766.0% | 228MiB | -0.4% | +9.6% |
| pipelined | 512 | 793,549 | 3344.3% | 101MiB | +1.1% | +11.0% |
| pipelined | 4096 | 1,186,570 | 4167.9% | 312MiB | +1.7% | -7.1% |
| limited-conn | 512 | 134,862 | 1925.6% | 62MiB | +6.4% | +3.3% |
| limited-conn | 4096 | 156,603 | 2051.6% | 63MiB | -1.6% | ~0% |
| json | 4096 | 227,296 | 3344.7% | 115MiB | +4.8% | +6.5% |
| json-comp | 512 | 186,720 | 5492.1% | 309MiB | -1.3% | -1.6% |
| json-comp | 4096 | 195,384 | 5686.8% | 1.2GiB | ~0% | ~0% |
| json-comp | 16384 | 193,796 | 5663.9% | 1.6GiB | -2.0% | +14.3% |
| json-tls | 4096 | 376,338 | 4774.4% | 331MiB | NEW | NEW |
| upload | 32 | 2,463 | 2229.2% | 41MiB | +0.9% | -2.4% |
| upload | 256 | 2,889 | 3961.4% | 64MiB | -1.1% | ~0% |
| api-4 | 256 | 27,186 | 392.8% | 40MiB | NEW | NEW |
| api-16 | 1024 | 90,069 | 1510.5% | 108MiB | NEW | NEW |
| static | 1024 | 25,017 | 5950.9% | 808MiB | NEW | NEW |
| static | 4096 | 25,531 | 6038.7% | 1.6GiB | NEW | NEW |
| static | 6800 | 25,394 | 5988.8% | 2.1GiB | NEW | NEW |
| static-tls | 1024 | 24,048 | 5900.8% | 698MiB | NEW | NEW |
| static-tls | 4096 | 23,953 | 6131.9% | 1.5GiB | NEW | NEW |
| static-tls | 6800 | 23,812 | 6022.6% | 1.6GiB | NEW | NEW |
| async-db | 1024 | 98,333 | 4190.1% | 174MiB | NEW | NEW |
| crud | 4096 | 54,628 | 1999.7% | 379MiB | NEW | NEW |
✅ fiber
| Test | Conn | RPS | CPU | Mem | Δ RPS | Δ Mem |
|---|---|---|---|---|---|---|
| baseline | 512 | 1,024,095 | 3841.5% | 68MiB | -2.9% | -4.2% |
| baseline | 4096 | 1,071,059 | 4272.4% | 221MiB | -1.4% | -0.9% |
| pipelined | 512 | 11,779,187 | 6644.6% | 41MiB | -0.2% | ~0% |
| pipelined | 4096 | 11,882,297 | 6500.2% | 131MiB | -0.4% | -0.8% |
| limited-conn | 512 | 310,224 | 2479.6% | 52MiB | -2.8% | ~0% |
| limited-conn | 4096 | 380,194 | 2746.2% | 66MiB | -1.4% | ~0% |
| json | 4096 | 307,066 | 4161.1% | 266MiB | +6.1% | +10.4% |
| json-comp | 512 | 126,846 | 5364.7% | 209MiB | -0.7% | -2.8% |
| json-comp | 4096 | 128,874 | 5457.8% | 405MiB | -2.3% | -8.0% |
| json-comp | 16384 | 132,907 | 5848.2% | 1.1GiB | ~0% | ~0% |
| json-tls | 4096 | 503,453 | 4881.3% | 385MiB | NEW | NEW |
| upload | 32 | 2,176 | 2994.6% | 2.9GiB | -0.3% | ~0% |
| upload | 256 | 2,370 | 6157.7% | 12.9GiB | +0.3% | +2.4% |
| api-4 | 256 | 30,223 | 386.3% | 37MiB | NEW | NEW |
| api-16 | 1024 | 95,143 | 1433.4% | 112MiB | NEW | NEW |
| static | 1024 | 108,635 | 3206.5% | 334MiB | NEW | NEW |
| static | 4096 | 106,186 | 3533.6% | 730MiB | NEW | NEW |
| static | 6800 | 102,847 | 3700.2% | 718MiB | NEW | NEW |
| static-tls | 1024 | 84,991 | 3539.4% | 178MiB | NEW | NEW |
| static-tls | 4096 | 101,849 | 4163.8% | 578MiB | NEW | NEW |
| static-tls | 6800 | 103,092 | 3964.4% | 823MiB | NEW | NEW |
| async-db | 1024 | 98,336 | 3557.8% | 162MiB | NEW | NEW |
| crud | 4096 | 55,765 | 1734.2% | 360MiB | NEW | NEW |
✅ gin
| Test | Conn | RPS | CPU | Mem | Δ RPS | Δ Mem |
|---|---|---|---|---|---|---|
| baseline | 512 | 329,613 | 2501.4% | 77MiB | +3.7% | -8.3% |
| baseline | 4096 | 523,679 | 3807.7% | 209MiB | +0.5% | +2.0% |
| pipelined | 512 | 859,953 | 3340.2% | 103MiB | +3.1% | +7.3% |
| pipelined | 4096 | 1,206,205 | 4337.8% | 314MiB | -0.3% | -4.3% |
| limited-conn | 512 | 163,348 | 2081.5% | 63MiB | +12.0% | +5.0% |
| limited-conn | 4096 | 177,478 | 2201.5% | 68MiB | +6.8% | ~0% |
| json | 4096 | 171,930 | 2913.1% | 162MiB | +4.4% | +3.8% |
| json-comp | 512 | 169,117 | 5333.3% | 379MiB | +0.3% | +3.8% |
| json-comp | 4096 | 176,789 | 5374.9% | 1.2GiB | +0.9% | +43.2% |
| json-comp | 16384 | 183,161 | 5932.9% | 1.8GiB | +0.6% | -5.3% |
| json-tls | 4096 | 322,414 | 4655.6% | 359MiB | NEW | NEW |
| upload | 32 | 2,498 | 2281.2% | 43MiB | +1.8% | +4.9% |
| upload | 256 | 2,912 | 3957.8% | 71MiB | +0.8% | +9.2% |
| api-4 | 256 | 26,023 | 390.9% | 43MiB | NEW | NEW |
| api-16 | 1024 | 86,404 | 1512.3% | 126MiB | NEW | NEW |
| static | 1024 | 23,848 | 5784.8% | 620MiB | NEW | NEW |
| static | 4096 | 24,897 | 6043.3% | 1.4GiB | NEW | NEW |
| static | 6800 | 25,100 | 5945.4% | 1.4GiB | NEW | NEW |
| static-tls | 1024 | 23,269 | 5703.1% | 662MiB | NEW | NEW |
| static-tls | 4096 | 23,481 | 5991.8% | 1.1GiB | NEW | NEW |
| static-tls | 6800 | 22,948 | 5604.2% | 1.4GiB | NEW | NEW |
| async-db | 1024 | 94,132 | 4082.8% | 182MiB | NEW | NEW |
| crud | 4096 | 54,994 | 2200.2% | 380MiB | NEW | NEW |
✅ go-fasthttp
| Test | Conn | RPS | CPU | Mem | Δ RPS | Δ Mem |
|---|---|---|---|---|---|---|
| baseline | 512 | 1,292,872 | 4152.8% | 65MiB | -6.0% | -2.4% |
| baseline | 4096 | 1,195,675 | 4177.7% | 158MiB | -5.0% | +6.4% |
| pipelined | 512 | 14,783,875 | 6579.5% | 61MiB | +4.3% | +23.0% |
| pipelined | 4096 | 14,846,368 | 6536.4% | 154MiB | +5.0% | +8.1% |
| limited-conn | 512 | 710,212 | 4526.2% | 147MiB | +251.9% | +90.2% |
| limited-conn | 4096 | 706,766 | 4658.8% | 309MiB | -1.4% | -3.9% |
| json | 4096 | 454,728 | 4937.2% | 341MiB | -1.7% | +4.8% |
| json-comp | 512 | 32,860 | 2573.9% | 819MiB | -3.8% | +6.8% |
| json-comp | 4096 | 34,504 | 3095.9% | 3.2GiB | -1.5% | -8.6% |
| json-comp | 16384 | 27,078 | 3875.7% | 6.5GiB | +3.7% | -4.4% |
| json-tls | 4096 | 528,603 | 5024.4% | 426MiB | NEW | NEW |
| upload | 32 | 2,031 | 3078.3% | 15.3GiB | +0.4% | -29.8% |
| upload | 256 | 2,157 | 5964.0% | 49.0GiB | ~0% | +0.2% |
| api-4 | 256 | 21,051 | 390.1% | 44MiB | -19.1% | +0.7% |
| api-16 | 1024 | 66,919 | 1458.4% | 138MiB | +3.2% | -3.4% |
| static | 1024 | 310,065 | 3818.2% | 354MiB | -52.6% | +256.1% |
| static | 4096 | 347,691 | 4566.0% | 887MiB | -44.3% | +300.1% |
| static | 6800 | 352,710 | 4552.9% | 1.3GiB | -43.3% | +294.9% |
| static-tls | 1024 | 286,160 | 4193.7% | 328MiB | NEW | NEW |
| static-tls | 4096 | 310,881 | 4832.8% | 925MiB | NEW | NEW |
| static-tls | 6800 | 309,999 | 4829.2% | 1.5GiB | NEW | NEW |
| async-db | 1024 | 57,288 | 3747.2% | 204MiB | -11.7% | +1.3% |
| crud | 4096 | 55,756 | 1953.0% | 370MiB | NEW | NEW |
✅ go-stdlib
| Test | Conn | RPS | CPU | Mem | Δ RPS | Δ Mem |
|---|---|---|---|---|---|---|
| baseline | 512 | 316,195 | 2434.2% | 71MiB | -1.1% | -2.7% |
| baseline | 4096 | 504,598 | 3558.0% | 201MiB | -2.8% | -4.3% |
| pipelined | 512 | 844,550 | 3260.1% | 100MiB | -2.2% | +4.2% |
| pipelined | 4096 | 1,180,568 | 4011.6% | 399MiB | -3.7% | +31.2% |
| limited-conn | 512 | 137,442 | 1930.9% | 59MiB | +7.0% | -1.7% |
| limited-conn | 4096 | 169,377 | 2147.9% | 65MiB | +6.4% | -5.8% |
| json | 4096 | 234,626 | 3457.6% | 134MiB | -9.7% | -23.4% |
| json-comp | 512 | 183,021 | 5291.9% | 245MiB | +0.3% | -5.0% |
| json-comp | 4096 | 192,578 | 5581.6% | 722MiB | +2.7% | -2.3% |
| json-comp | 16384 | 193,771 | 5635.0% | 1.5GiB | +2.7% | +25.0% |
| json-tls | 4096 | 369,093 | 4755.9% | 312MiB | NEW | NEW |
| upload | 32 | 2,447 | 2249.1% | 41MiB | -0.7% | -4.7% |
| upload | 256 | 2,936 | 4032.8% | 63MiB | ~0% | -6.0% |
| api-4 | 256 | 28,113 | 391.1% | 39MiB | NEW | NEW |
| api-16 | 1024 | 92,429 | 1512.6% | 112MiB | NEW | NEW |
| static | 1024 | 157,170 | 3560.7% | 157MiB | NEW | NEW |
| static | 4096 | 233,575 | 4232.7% | 426MiB | NEW | NEW |
| static | 6800 | 249,871 | 4441.6% | 513MiB | NEW | NEW |
| static-tls | 1024 | 150,056 | 3596.3% | 176MiB | NEW | NEW |
| static-tls | 4096 | 202,434 | 4221.0% | 469MiB | NEW | NEW |
| static-tls | 6800 | 206,098 | 4551.9% | 634MiB | NEW | NEW |
| async-db | 1024 | 86,296 | 3976.8% | 178MiB | NEW | NEW |
| crud | 4096 | 54,028 | 1927.8% | 373MiB | NEW | NEW |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every Go entry that runs an application was missing profiles.
grpc-go,go-websocketandcaddyare left alone — the first two aresingle-purpose entries (gRPC and WebSocket only) and caddy is
infrastructure,a reverse proxy with no application endpoints.
api-4andapi-16rotate over/baseline11,/jsonand/async-db, sowiring Postgres brings all three profiles with it.
static — one entry was non-compliant
go-fasthttp served static through
fasthttp.FS, which keeps small files inan in-memory cache and writes its own compressed copies next to the originals.
The static profiles forbid holding file bodies in memory in every mode, so that
handler is replaced with a per-request disk read. Its published
staticnumbers were measured against that cache and should be expected to move.
The standard-mode entries read the raw file from disk and leave the encoding to
the compression middleware they already mount — the same shape as express. The
tuned ones (go-stdlib, go-fasthttp) pick the pre-compressed
.br/.gzsiblingfrom disk per request.
json-tls / static-tls
The same router behind TLS on 8081, not a second copy of the handlers.
go-fasthttp binds it from every worker exactly as they all bind 8080, so the
listener is spread rather than parked on one process — the failure #1245 fixed on
quarkus.
Postgres and Redis
pgxfor Postgres. One process per entry here, so the wholeDATABASE_MAX_CONNbudget is available, less headroom for
superuser_reserved_connections— thesizing bug #1251 fixed on hono-bun.
crudruns cache-aside on Redis throughgo-redis, 200ms TTL, explicit delete on update.
Worth recording:
tagsis a JSONB column, so it comes back as bytes ratherthan a Go slice and needs unmarshalling — the same trap that bit vertx in #1249.
Build fix
go-stdlibhad no dependencies and therefore nogo.sum; its Dockerfile copiedonly
go.mod, which stopped building the moment it had one.Validation
58 passed, 0 failed on all six.
🤖 Generated with Claude Code