HttpArena
Frameworks

fib

Experimental · Go · standard configuration · completeness 4/4

fib (Fast In Balance) Go networking library, served through its prefork package: a master process starts a child for every two CPUs, each with two Ps and its own heap, and every engine a child binds listens with SO_REUSEPORT, so the children share the ports. In each child an edge-triggered epoll event loop hands HTTP/1 connections' rounds to a logical worker pool, where each connection is an ordered task that any idle worker may run. Its http package serves HTTP/1.1, HTTP/2 (ALPN and prior-knowledge h2c) and, through package http3, HTTP/3 over its own QUIC, all through one handler taking a *http.Request and a Context; TLS through package tls on crypto/tls. Default configuration throughout; the certificate on the opt-in TLS hardening listener is picked per handshake through tls.Config.GetCertificate, so a renewed pair is served without a restart. Requests are routed by fib's Router (chi's API with fib's handlers), the same one for every protocol, with path parameters read through Context.Param, and JSON answered through Context.JSON, encoding/json's encoding; the JSON routes sit behind fib's compress middleware (Router.With(compress.New()), defaults), which gzips per request as Accept-Encoding allows. The gRPC profiles' BenchmarkService, protoc-generated with google.golang.org/protobuf messages, is served by fib's grpc package through the same router, so gRPC shares 8080 (h2c) and 8443 (h2 over TLS) with HTTP. /delay waits in its handler, on fib's worker pool, which grows for handlers that block, /async-db answers a retained request from a goroutine, and /static goes through fib's FileCache, which serves the files from memory and follows the disk through an inotify watch, choosing the pre-compressed twin on disk off Accept-Encoding.

Achievements

🥇 8 Gold · 🥈 8 Silver · 🥉 4 Bronze. Top three of a field, taken in this entry's own league: the family composite, the same composite among entries written in the same language, and each test profile it is scored on. Every field is the one the badges publish, so a medal and a badge always say the same thing. How medals are awarded.

MedalAwardFieldRank
🥇 GoldFamily compositeComposite · HTTP/21 of 4
🥇 GoldFamily compositeComposite · HTTP/31 of 3
🥇 GoldTest profileEfficiency · Latency-1M1 of 5
🥇 GoldTest profileHTTP/2 · Baseline (h2c)1 of 4
🥇 GoldTest profileHTTP/2 · Static1 of 3
🥇 GoldTest profileHTTP/3 · Baseline1 of 3
🥇 GoldTest profileWebSocket · Echo Short-lived1 of 7
🥇 GoldTest profileWorkload · 8Gbit1 of 5
🥈 SilverFamily compositeComposite · HTTP/1.12 of 7
🥈 SilverFamily compositeComposite · WebSocket2 of 7
🥈 SilverWithin its languageGo · WebSocket2 of 3
🥈 SilverTest profileConcurrency · Async Delay2 of 5
🥈 SilverTest profileConnection · Short-lived2 of 7
🥈 SilverTest profileHTTP/2 · Baseline2 of 3
🥈 SilverTest profileWorkload · JSON Comp2 of 6
🥈 SilverTest profileWorkload · JSON TLS2 of 6
🥉 BronzeTest profileConnection · Baseline3 of 7
🥉 BronzeTest profileEfficiency · Latency-10K3 of 5
🥉 BronzeTest profileHTTP/2 · JSON (h2c)3 of 4
🥉 BronzeTest profileWebSocket · Echo Pipelined3 of 7

Composite rank

Each profile of a family is worth 100 to the entry that leads it, and the composite is the sum over the family, less 2.5% for each of routing, middleware, request and response the entry does not do for you - its completeness factor, which the WebSocket and gRPC families do not carry. The field is this entry's own league: engines and reverse proxies are scored apart from frameworks. How it works.

FamilyRankComposite
HTTP/1.12 of 76302
HTTP/21 of 42737
HTTP/31 of 31955
gRPC1 of 21839
WebSocket2 of 72782

Every result

Alpha Round, 36 runs. Requests per second is the best of three; latency, CPU and memory come from that run.

CategoryProfileConnsReq/secAvgp99CPUMemory
ConnectionBaseline4,0963,164,5041.30ms2.66ms6139.4%293MiB
ConnectionPipelined4,09620,397,4143.21ms7.39ms6555.1%285MiB
ConnectionShort-lived4,0962,548,7221.58ms4.14ms6146.9%298MiB
ConcurrencyAsync Delay32,0001,798,49717.66ms31.30ms5580.7%1.5GiB
EfficiencyLatency-10K1,0249,98178.6us103.0us43.5%161MiB
EfficiencyLatency-1M1,024998,149113.3us204.0us3436.9%260MiB
EfficiencyLatency-500K/81,024444,0921085584.1us2644992.0us789.5%50MiB
WorkloadJSON Comp4,096297,38513.76ms37.20ms6340.3%516MiB
WorkloadJSON Comp16,384296,06454.85ms95.00ms6380.6%1.1GiB
WorkloadJSON TLS4,096774,1825.42ms97.47ms6376.7%375MiB
Workload8Gbit51249,36388.6us120.0us235.8%256MiB
WorkloadStatic TLS1,0241,229,892689.56us19.67ms5751.7%350MiB
DatabaseAsync DB1,024197,1764.65ms25.70ms4489.7%389MiB
HTTP/2Baseline2565,634,1262.30ms20.21ms2505.0%504MiB
HTTP/2Baseline1,0245,490,6438.82ms87.74ms2464.0%804MiB
HTTP/2Static256930,8778.61ms80.39ms6273.2%778MiB
HTTP/2Static1,024945,06532.84ms227.12ms6226.0%1.1GiB
HTTP/2Baseline (h2c)25612,891,4911.43ms17.67ms4912.5%421MiB
HTTP/2Baseline (h2c)1,02413,903,4294.96ms80.60ms5963.3%642MiB
HTTP/2Baseline (h2c)4,09611,484,65730.74ms649.12ms6315.3%1.7GiB
HTTP/2JSON (h2c)1,0241,102,05428.90ms230.41ms6182.7%882MiB
HTTP/2JSON (h2c)4,0961,114,439111.84ms487.00ms6253.7%2.3GiB
HTTP/3Baseline646,067,295555us1.36ms3554.6%402MiB
HTTP/3Static64748,5405.16ms22.19ms4744.4%872MiB
gRPCUnary2566,198,5783.50ms81.67ms5449.7%603MiB
gRPCUnary1,0246,199,04113.90ms346.21ms6198.4%1.1GiB
gRPCUnary TLS2564,246,7843.54ms43.08ms3672.7%562MiB
gRPCUnary TLS1,0244,160,36212.39ms130.08ms3662.4%1022MiB
WebSocketEcho5123,539,300144us385us6064.5%99MiB
WebSocketEcho4,0963,972,9531.03ms1.99ms6458.6%133MiB
WebSocketEcho16,3843,748,4274.36ms8.36ms6142.8%266MiB
WebSocketEcho Pipelined51246,941,744173us406us6273.1%100MiB
WebSocketEcho Pipelined4,09651,031,5321.28ms2.52ms6617.6%134MiB
WebSocketEcho Pipelined16,38448,606,4485.36ms10.20ms6206.1%268MiB
WebSocketEcho Short-lived5122,053,428154us502us5403.9%246MiB
WebSocketEcho Short-lived4,0962,613,7291.05ms2.42ms5887.0%277MiB

Compared with

The Go entries around fib on the HTTP/1.1 composite, and the one leading them. The last column shows every profile side by side.

EntryCompositevs fib
fib-tuned7101+13%head to head
fiber-tuned6372+1%head to head
fiber5932-6%head to head
go-fasthttp3632-42%head to head

Compare fib with any Go entry · Compare fib with any entry, in any language · Every Go entry, ranked

Results updated · How the benchmark is run · The machine · Add or fix an entry