Unary (gRPC)

Measures unary gRPC call throughput over cleartext HTTP/2 (h2c). The server implements a simple GetSum RPC that adds two integers.

Connections: 256, 1,024 Concurrent streams per connection: 100

Proto definition

syntax = "proto3";
package benchmark;

service BenchmarkService {
  rpc GetSum (SumRequest) returns (SumReply);
}

message SumRequest {
  int32 a = 1;
  int32 b = 2;
}

message SumReply {
  int32 result = 1;
}

Workload

POST /benchmark.BenchmarkService/GetSum sent as a gRPC unary call over h2c. The load generator (h2load) sends pre-encoded protobuf frames with gRPC headers (content-type: application/grpc, te: trailers).

The request payload is a 9-byte gRPC frame: 5-byte frame header + 4-byte protobuf-encoded SumRequest{a=1, b=2}.

What it measures

  • gRPC/HTTP2 frame processing overhead
  • Protocol Buffers serialization/deserialization performance
  • HTTP/2 stream multiplexing efficiency for gRPC
  • Server-side gRPC service dispatch latency

Expected request/response

POST /benchmark.BenchmarkService/GetSum HTTP/2
content-type: application/grpc
te: trailers

<binary: 00 00000004 08011002>
HTTP/2 200 OK
content-type: application/grpc

<binary: 00 00000002 0803>

grpc-status: 0

How it differs from HTTP/2 baseline

Baseline (HTTP/2)Unary (gRPC)
ProtocolHTTP/2 over TLSgRPC over h2c
SerializationPlain textProtocol Buffers
Port84438080
Request methodGETPOST
Load generatorh2loadh2load (raw gRPC frames)

Parameters

ParameterValue
RPCBenchmarkService/GetSum
Connections256, 1,024
Streams per connection100 (-m 100)
Duration5s
Runs3 (best taken)
Load generatorh2load