Why it matters
Unbounded concurrency in bot workers amplifies 429s and memory spikes; set per-process and per-dependency limits.
Practical steps
- Cap in-flight webhook handlers per process.
- Use a separate, lower limit for LLM calls.
- Queue overflow instead of accepting forever.
- Expose current in-flight gauges on /metrics.
- Load-test the limit you chose, not the limit you wish.
Watch out for
- One giant async gather over an entire backlog.
- Sharing one HTTP client without connection limits.