Reduce load on a large cluster
Slow the background reads of klens when a cluster has thousands of topics or consumer groups.
klens reads each cluster in the background on fixed periods, set under tuning.ingest. The defaults suit most clusters. On a cluster with thousands of consumer groups, the number of requests grows with the number of groups, and longer periods lower the load. How klens reads Kafka explains what each lane reads.
Find the slow lanes
GET /api/clusters/<name> returns each lane with lastPollMs, the duration of its last read, and lastError. A lane whose read takes close to its period runs almost without a pause.
curl -s http://localhost:8080/api/clusters/prod | jq '{topology, offsets, watermarks}'Lengthen the periods
-
For a cluster with many groups, lengthen
slow_offset, which reads the offsets of every group nobody is looking at, andtopology, which lists every group and describes each active one.config.yaml tuning: ingest: topology: 30s slow_offset: 60s -
For a cluster with many partitions, lengthen
high_watermark. Produce rates then update less often. -
Lengthen the periods of data that rarely changes, such as
config,acls,quotas, andscram_users. -
Restart klens and check
lastPollMsagain.
A group that someone opens in the UI, or that an agent describes, still updates every fast_offset for interest_ttl, so a longer slow_offset does not slow the group page.
Limit what readers can ask for
tuning.records.max_limitcaps the records one page may ask for.tuning.tail.max_livecaps the live tails across every cluster.tuning.mcp.live_calls_per_minutecaps the MCP calls that read Kafka live.
The configuration reference lists every key with its default.