feat(mqtt): split signing and publish workers#196
Conversation
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 59 minutes and 19 seconds.Comment |
Additional context from comment filesThese notes were split from the local markdown comment files and attached here because they describe this PR's change. Change 6: JWS sign worker poolFile: Why this was a bottleneck
What we changed
A new top-level config field,
Tradeoff
Expected payoffJWS signing parallelises across MQTT Publish Worker Context Cancellation
Serial MQTT Publishing
Side effect: paho file queue exposureTier 2 lifts the JWS-sign rate from ~40 K/s (sequential, single goroutine) entries := os.ReadDir(dir) // O(N)
for _, e := range entries {
info := os.Lstat(...) // O(N) syscalls + allocations
// pick oldest
}That is O(N) per dequeue, O(N²) per N enqueues. As the queue fills, the …and observing the queue dir grow to 88 903 files / 350 MB at the Why this isn't a Tier 2 regression in the strict sensePre-Tier-2, JWS signing capped the rate at ~40 K/s, well below the What we didFor dev/test setups (the load-gen smoke), the file queue is unnecessary: Without the file queue, paho buffers messages in-memory only, with its
What we did not doWe did not change the file queue's default. The queue is meant to If you do run a deployment with the file queue enabled at high publish |
Summary
Tests