Skip to Content
DeploymentResource Sizing

Resource Sizing

Pilot’s memory grows with the number of partitions it monitors on the Apache Kafka cluster. CPU stays low between proposal generations.

The numbers below come from our own tests. Use them as a starting point and check your deployment with the process_resident_memory_bytes metric.

Memory

At 20,000 partitions Pilot used about 1.1 GiB (about 56 KiB per partition). Leave headroom above that: the Kubernetes recommendations list limits by partition count.

For more than 20,000 partitions, measure: take the lowest value of the go_memstats_heap_inuse_bytes metric after the first hour and set the limit to about twice that plus 50%.

Memory Limit

Always set a container memory limit. At startup Pilot sets its Go memory limit to 90% of it and logs the value:

Go memory limit: 1843 MiB, 90% of the container memory limit (GOMEMLIMIT overrides it, GOMEMLIMIT=off disables it)

Set GOMEMLIMIT to override the value, or GOMEMLIMIT=off to turn it off. Without a container memory limit, Pilot sets no Go memory limit.

CPU

Monitoring needs little CPU: about 0.06 cores at 20,000 partitions.

Proposal generation runs at least every 5 minutes, in parallel on the available CPUs. PILOT_BALANCE_WORKERS caps the parallelism. On a balanced cluster a generation takes well under a second. On a cluster that needs many moves it takes longer: about 15 CPU-seconds at 10,000 partitions and about 200 at 100,000.

High Availability Replicas

By default, the Helm chart requests 500m CPU and 512Mi per replica and limits each to 2 CPUs and 2Gi. Any standby can become active, so give every replica the same limits.

Large HA Operations

A large HA operation needs memory on top of monitoring: add about 2 KiB per partition in the plan. If an apply fails for lack of memory, raise the limit and check GET /api/v1/ha for an outstanding operation before you apply again.

After a failover, the new active replica first reads the history of earlier operations. In our tests this took less than 10 seconds for plans of up to about a million partitions, and about 45 seconds for 6 million.

Last updated on