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 the engine each child runs listens with SO_REUSEPORT, so the children share the ports; every listener is a fib.Binding of that one engine (fib.New), sharing its event loop, task pool and buffer pool. 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 Context that carries the *http.Request; TLS through package tls on crypto/tls. Default configuration throughout, but for request bodies past 64 KiB, which stream to their handlers as fit, fib's gateway, has them; 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(...))) with fiber's compress settings, the default level (gzip 6) and fasthttp's 200-byte floor, 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. nothing blocks fib's workers, as in fit: /delay answers its request, retained through Context.Async, from a timer, /async-db hands its query to a taskpool of as many workers as the database pool has connections, request bodies past 64 KiB stream to their handlers (StreamRequestBody, fit's 64 KiB threshold and buffer), and /echo sends a streamed body back as it arrives through OnBody and WriteNoWait, holding the request body with HoldBody until OnWritable while the client is behind, 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

🥇 1 Gold · 🥈 4 Silver · 🥉 3 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
🥇 GoldTest profileHTTP/3 · Static1 of 9
🥈 SilverFamily compositeComposite · HTTP/32 of 10
🥈 SilverWithin its languageGo · WebSocket2 of 3
🥈 SilverTest profileEfficiency · Latency-1M2 of 27
🥈 SilverTest profilegRPC · Unary TLS2 of 7
🥉 BronzeFamily compositeComposite · gRPC3 of 7
🥉 BronzeTest profileHTTP/3 · Baseline3 of 10
🥉 BronzeTest profileWorkload · 8Gbit3 of 24

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.114 of 295032
HTTP/25 of 152529
HTTP/32 of 101879
gRPC3 of 71580
WebSocket8 of 212524

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,0962,899,1611.42ms2.96ms6138.2%295MiB
ConnectionPipelined4,09618,461,6763.55ms7.46ms6637.7%286MiB
ConnectionShort-lived4,0962,281,3281.77ms4.62ms5885.4%300MiB
ConcurrencyAsync Delay32,0001,555,45420.40ms28.50ms4021.6%742MiB
EfficiencyLatency-10K1,0249,98282.3us112.0us44.3%138MiB
EfficiencyLatency-1M1,024998,045114.3us211.0us3959.7%262MiB
EfficiencyLatency-500K/81,024421,3301528069.9us3513344.0us788.1%54MiB
WorkloadJSON Comp4,096289,74814.15ms38.70ms6133.5%476MiB
WorkloadJSON Comp16,384290,33055.77ms97.90ms6040.8%1.1GiB
WorkloadJSON TLS4,096741,9325.63ms95.78ms6350.9%311MiB
Workload8Gbit51249,37498.8us124.0us326.2%237MiB
WorkloadStatic TLS1,0241,177,410801.08us27.47ms5912.0%290MiB
DatabaseAsync DB1,024237,6733.75ms13.40ms5616.9%287MiB
HTTP/2Baseline25611,492,0251.80ms18.36ms5845.1%316MiB
HTTP/2Baseline1,02412,257,8546.83ms84.65ms6322.7%529MiB
HTTP/2Static256911,4198.69ms54.95ms6311.1%622MiB
HTTP/2Static1,024964,43932.25ms128.01ms6451.9%1.1GiB
HTTP/2Baseline (h2c)25612,048,8841.67ms12.26ms5699.6%316MiB
HTTP/2Baseline (h2c)1,02412,872,7756.57ms46.43ms6258.2%521MiB
HTTP/2Baseline (h2c)4,09611,086,84733.66ms143.26ms6266.9%1.6GiB
HTTP/2JSON (h2c)1,0241,173,46427.23ms134.90ms6336.8%1.3GiB
HTTP/2JSON (h2c)4,0961,163,510107.60ms489.71ms6287.8%4.5GiB
HTTP/3Baseline645,996,237559us1.05ms4039.9%317MiB
HTTP/3Static64965,9284.00ms16.74ms4773.9%597MiB
gRPCUnary2565,522,6544.25ms109.94ms6062.5%405MiB
gRPCUnary1,0245,607,26217.15ms418.78ms6359.5%971MiB
gRPCUnary TLS2565,439,2444.32ms123.06ms6052.8%395MiB
gRPCUnary TLS1,0245,449,75216.86ms346.53ms6358.7%950MiB
WebSocketEcho5123,355,329152us413us5741.9%89MiB
WebSocketEcho4,0963,817,9121.07ms2.17ms6138.8%117MiB
WebSocketEcho16,3843,616,4464.49ms8.64ms6382.5%225MiB
WebSocketEcho Pipelined51245,843,977178us475us5923.0%81MiB
WebSocketEcho Pipelined4,09650,981,5901.28ms2.63ms6243.9%118MiB
WebSocketEcho Pipelined16,38448,581,7695.33ms10.20ms6103.5%236MiB
WebSocketEcho Short-lived5121,916,867170us520us5306.3%243MiB
WebSocketEcho Short-lived4,0962,500,4431.18ms3.10ms5771.1%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
fiber-tuned5992+19%head to head
fiber5625+12%head to head
fib-tuned5390+7%head to head
fnet-h14573-9%head to head
go-fasthttp3500-30%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