KafkaSizing Calculator

The size that actually crosses the wire — record overhead, headers, batching and compression — checked against the broker limits you are about to hit.

In-browser & private
Advertisement
Message value (paste the real payload) Ctrl + Enter
Breakdown
Paste a payload and press Calculate.
Record Batch Throughput

Why this is bigger than key + value

  • Every record carries v2-format overhead. Attributes, timestamp and offset deltas, and a length varint for the key, the value and the record itself. On a small message that overhead is a noticeable fraction of the total.
  • Headers are not free. Each one costs its key and value bytes plus two varints — a tracing header on every message is real traffic.
  • Limits apply to different things. max.request.size is the producer request, message.max.bytes the broker limit on a batch. Sizing against a single record is how a producer that looked fine starts failing under load.
  • Compression applies to the records, not the batch header. The 61-byte header is sent uncompressed, which is why a batch of one compresses far worse than a batch of a thousand.

More free tools