temporalio / sdk-core

Core Temporal SDK that can be used as a base for language specific Temporal SDKs
MIT License
262 stars 70 forks source link

Worker Slots interface and Resource Based Autotuner First Cut #719

Closed Sushisource closed 3 months ago

Sushisource commented 4 months ago

Implements the first portions of the slot management proposal and an initial take on resource-based auto-tuning.

Here the auto-tuning is done based on PID controllers which target specified CPU and RAM usage levels. This will very likely need more tweaking as we proceed and do more testing, but initial tests are quite promising for your typical sorts of relatively-low-resource-usage activities.

I have already successfully made use of the resource-based tuner in Typescript without much challenge. The lang layer needs little adjustment to use it. Passing through the callbacks to allow users to implement the interface with their own implementation will be more involved, and we've decided to do that after shipping the auto-tuner and letting users try that out.