Performance & tuning guide (v1, best-effort)
Synced from repo docs
This page is synced from docs/ops/performance-tuning.md via docs/public-docs.json. Edit the owning repo source instead of this generated copy. GitHub source: https://github.com/byteor-systems/indexbus/blob/master/docs/ops/performance-tuning.md
This is best-effort guidance for getting predictable performance out of IndexBus v1.
Normative behavior is defined by:
- ../spec/v1-semantics.md
- ../spec/v1-failure-lifecycle.md
Rustdoc entry points
For the API-level surfaces behind tuning decisions, start with:
Router loop tuning
Batching
- Increase batch size to improve throughput (amortize per-message overhead).
- Decrease batch size to reduce latency under light load.
Watch:
batches/sec,batch_avg,batch_max- tail latency in consumers
Wait strategy
- Busy spin yields best tail latency at higher CPU cost.
- Backoff reduces CPU but increases wakeup latency.
- Wake-backed waits reduce idle CPU when wake sections are available and used.
Credits and overload policy
credit_maxbounds consumer lag.Droppreserves router throughput but loses data.Parkpreserves data but can stall routing.Detachprevents a persistently slow consumer from dominating behavior (router-local state).
CPU placement and isolation
- Prefer pinning router and critical consumers to dedicated cores.
- Avoid sharing hot-path threads with noisy background work.
- Consider one router per region and (in extreme cases) per NUMA node.
Memory considerations
- Use
mlockall/ memlock where appropriate to avoid paging. - Huge pages can help in some workloads but must be tested end-to-end.
- Ensure SHM files are on a suitable filesystem and have correct permissions.
Diagnosing bottlenecks
- Use ./v1-triage.md first.
- Use ./router-counters.md to interpret counters.
- If drops occur, treat them as explicit overload: reduce offered load or scale consumers.
Anti-patterns
- Expecting fairness guarantees in work-queue selection.
- Treating best-effort drop attribution as exact.
- Assuming blocking/wake changes correctness (it only changes waiting behavior).