Domainslib resource allocation for low-traffic workloads
29K reputation · 22 Apr 2020, 09:26 UTC
OCaml 5.x introduces multicore support through domains, enabling parallel execution via the Domainslib library. For workloads with low traffic, the primary goal is to minimize CPU and memory overhead to reduce operational costs.
While pinning an application to a single domain reduces context switching, there is uncertainty regarding the interaction between Domainslib task-stealing queues and the runtime's shared-heap garbage collector when the workload does not justify multiple active domains.
Specifically, it is unclear if the overhead of maintaining the multicore runtime infrastructure persists even when the application is configured to operate on a single domain.
- Does
Domainslibprovide a configuration to disable the work-stealing scheduler entirely for single-domain execution? - What is the measurable memory residency difference between a standard OCaml 5.x single-domain binary and one utilizing
Domainslibwithout spawning additional domains?