Handler Selection Strategies
Handler selection controls how container instances are selected from a handler’s pool when processing a task. This is configured per-handler inhandlers.toml.
Available Strategies
Round-Robin (Default)
Cycles through container slots sequentially. Each acquisition starts from the next slot in sequence.handlers.toml
First-Available
Always starts from slot 0 and takes the first available container.handlers.toml
Random
Starts from a random slot each time.handlers.toml
Configuration
Handler selection is configured inhandlers.toml for each handler:
handlers.toml
Performance Notes
Testing showed that round-robin provides the best overall performance for most workloads. The blocking lock creates natural backpressure - workers queue at slots rather than spinning, which improves throughput under load.
Comparison
| Strategy | Behavior | Use Case |
|---|---|---|
round-robin | Sequential cycling | General workloads, even distribution |
first-available | Always start at slot 0 | Cache-heavy handlers |
random | Random starting slot | High concurrency |
Mixing Strategies
You can use different strategies for different handlers based on their characteristics:handlers.toml