You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I'm using Poolex to control workers that send commands to kubernetes pods. When the worker exits the pod is stopped so as to avoid orphan pods piling up.
To reduce costs I'd like to have a lower workers_count and a larger max_overflow to scale up to meet workloads. Even when a docker image is cached on the kubernetes node, depending on the image it can take a few seconds for the pod become ready.
When into overflow, I'd like to amortise the cost of starting a pod by keeping the worker+pod alive and idle for a configurable grace period. The overflowed idle worker either becomes busy with a new command, or the period expires and the worker is killed, taking the pod with it.
I also considered a behaviour for worker handling - all the decisions taken through the worker lifecycle, but that seemed like it would be more intrusive and risky.
It is a complicated and specific task. I am not sure about the implementation of adding a new entity type (or an abstraction covering IdleWorkers) to Poolex.
Hi, @spacebat !
Sorry for such a significant delay, and thank you for waiting.
I think adding a shutdown delay configuration for "overflowed" workers is a good idea.
I have some comments on your implementation. Would you still like to contribute that logic yourself? If so, we can discuss some points.
Hey, I'm using Poolex to control workers that send commands to kubernetes pods. When the worker exits the pod is stopped so as to avoid orphan pods piling up.
To reduce costs I'd like to have a lower
workers_count
and a largermax_overflow
to scale up to meet workloads. Even when a docker image is cached on the kubernetes node, depending on the image it can take a few seconds for the pod become ready.When into overflow, I'd like to amortise the cost of starting a pod by keeping the worker+pod alive and idle for a configurable grace period. The overflowed idle worker either becomes busy with a new command, or the period expires and the worker is killed, taking the pod with it.
I have an implementation that I'd be happy to firm up into a worthy contribution if you think this is a good idea:
develop...spacebat:poolex:grace-for-idle-workers
The text was updated successfully, but these errors were encountered: