Skip to content

RPC Benchmarks

René Jochum edited this page Nov 26, 2023 · 36 revisions

These are benchmark results from @jochumdev.

My workstation:

  • OS: Arch GNU/Linux
  • CPU: AMD Ryzen 5900X 12-Core @ 3.7 - 4.8GHz
  • Memory: 32GiB DDR4-5200

consul version:

Consul v1.17.0
Revision 4e3f428b
Build Date 2023-11-03T14:56:56Z
Protocol 2 spoken by default, understands 2 to 3 (agent will automatically use protocol >2 when speaking to compatible agents)

consul cmdline:

./consul agent --bind=127.0.0.1 --data-dir=/tmp/consul2 --server --bootstrap-expect=1 --ui

The first number on each result is the number of requests x16 that went trough.

2023-11-26

  • go version go1.21.4 linux/amd64

HTTP: GOMAXPROCS=4 (consul)

Command:

GOMAXPROCS=4 go-task test.sh -- bench client/orb/transport/http

Result:

BenchmarkHTTPProto16-4   	   5605	   200519 ns/op	 112901 B/op	   1601 allocs/op
BenchmarkHTTPJSON16-4    	   5428	   212403 ns/op	 116435 B/op	   1665 allocs/op

HTTP (consul)

Command:

GOMAXPROCS=1 go-task test.sh -- bench client/orb/transport/http

Result:

BenchmarkHTTPProto16 	   3213	   363423 ns/op	 113044 B/op	   1605 allocs/op
BenchmarkHTTPJSON16  	   2880	   396696 ns/op	 116560 B/op	   1669 allocs/op

HTTP (mdns)

Command:

GOMAXPROCS=1 go-task test.sh -- bench client/orb/transport/http

Result:

BenchmarkHTTPProto16 	   3032	   356031 ns/op	 113046 B/op	   1605 allocs/op
BenchmarkHTTPJSON16  	   2767	   383350 ns/op	 116562 B/op	   1669 allocs/op

GRPC (mdns)

Command:

GOMAXPROCS=1 go-task test.sh -- bench client/orb/transport/grpc

Result:

BenchmarkGRPC16 	   1795	   575753 ns/op	 129311 B/op	   2299 allocs/op

H2C (mdns)

Command:

GOMAXPROCS=1 go-task test.sh -- bench client/orb/transport/h2c

Result:

BenchmarkH2CProto16 	   2344	   514805 ns/op	 120968 B/op	   1483 allocs/op
BenchmarkH2CJSON16  	   2016	   596679 ns/op	 124690 B/op	   1547 allocs/op

HTTP3 (mdns)

Command:

GOMAXPROCS=1 go-task test.sh -- bench client/orb/transport/http3

Result:

BenchmarkHTTP3Proto16 	   1639	   705433 ns/op	 288439 B/op	   2472 allocs/op
BenchmarkHTTP3JSON16  	   1342	   843962 ns/op	 291766 B/op	   2584 allocs/op

HTTPS (mdns)

Command:

GOMAXPROCS=1 go-task test.sh -- bench client/orb/transport/https

Result:

BenchmarkHTTPSProto16 	   2715	   393956 ns/op	 113667 B/op	   1624 allocs/op
BenchmarkHTTPSJSON16  	   2578	   417640 ns/op	 117191 B/op	   1688 allocs/op

Clone this wiki locally