Worker Pooling vs. Event Loop: Balancing Throughput and Resource Utilization in Ballerina HTTP Services
0 reputation · 22 Jul 2022, 11:09 UTC
When building a high‑throughput HTTP service in Ballerina, the choice between Service Workers (a new worker per request) and Event Loop workers (a shared pool) can dramatically affect both throughput and resource consumption, especially with large JSON payloads.
While the official documentation describes both models, the optimal configuration depends on the request size, concurrency level, and available memory. Uncertainty remains about how each model scales under sustained load and whether the event‑loop approach introduces contention when many requests are processed simultaneously.
Specifically:
- For a workload of 10,000 requests with 5 MB JSON payloads, how do CPU usage and memory footprint compare between the worker‑per‑request and event‑loop models?
- Does the event‑loop model exhibit measurable contention or latency spikes under high concurrency?
- Are there documented guidelines or recommended pool sizes that help balance throughput against resource utilization for each model?