Worker exhaustion during blocking I/O calls in Swan Lake runtime
24K reputation · 30 Mar 2022, 17:31 UTC
Concurrency Model Constraints
Ballerina's Swan Lake architecture employs a worker-based concurrency model where requests are managed via lightweight strands. While this design aims to reduce OS-level thread switching overhead, the interaction between the event loop and blocking I/O operations can impact service availability.
Resource Contention
When a service executes synchronous blocking calls within a high-concurrency environment, the available worker pool may become saturated. This behavior can lead to increased latency and request queuing without necessarily triggering a crash or a specific runtime exception.
Given the isolation of state within workers, there is uncertainty regarding the optimal configuration of worker thread limits in ballerina.toml to prevent total service unavailability during I/O spikes.
- What is the specific threshold at which the worker pool triggers request queuing?
- How does the runtime prioritize new incoming requests when all available strands are blocked by synchronous I/O?