-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamically resize the WSTP if availableProcessors()
changes
#3909
Comments
I'm nitpicking, but I don't think the VPA actually dynamically changes container resources. Based on the documentation, it seems to recreate pods with the changed resources. However, it is possible to dynamically change CPU requests/limits (see here), so this issue is definitely relevant. This k8s feature is somewhat new, and behind a feature gate, but it works. (I did try it, and observed the return value of (I assume the VPA will also use this feature in the future, see here.) Interestingly, the |
This is fascinating. I've never seen this note before. For posterity:
So the problem is that actually using this information is somewhat difficult. Resizing the number of worker threads is kinda possible in theory, but I can see a whole host of objections very quickly:
|
Random idea: if we want to scale down, we can probably do it just by abusing the blocking shunt and actively spilling to the external queue. More specifically, mark the thread as a blocker and do the appropriate bookkeeping, then take the entire local queue and spill it to the external queue (this would replace the normal step of creating a replacement thread to take over the local state), then simply park normally. The standard timeout mechanism would eventually come along and clean up the old worker thread, and it could be used as a handily pre-allocated blocker in the interim. This doesn't resolve any of the problems around varying the worker pool size or publishing any of the associated state, but it does suggest a functional strategy for scaling down which doesn't require us to reinvent a very complicated wheel. |
We currently rely on
Runtime#availableProcessors
to size the work-stealing threadpool. The JavaDoc warns thatA concrete example of an environment where the number of available processors may change is Kubernetes with the Vertical Pod Autoscaler.
Marking as "experiment" since this would be a non-trivial enhancement :) and maybe not worth the complexity.
The text was updated successfully, but these errors were encountered: