Comments (2)
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 availableProcessors()
changing in a single JVM.)
(I assume the VPA will also use this feature in the future, see here.)
Interestingly, the ForkJoinPool
doesn't seem to follow the recommendation in the availableProcessors()
javadoc (it only calls it once).
from cats-effect.
Interestingly, the ForkJoinPool doesn't seem to follow the recommendation in the availableProcessors() javadoc (it only calls it once).
This is fascinating. I've never seen this note before. For posterity:
This value may change during a particular invocation of the virtual machine. Applications that are sensitive to the number of available processors should therefore occasionally poll this property and adjust their resource usage appropriately.
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:
- There are a number of places where we are almost certainly getting higher performance because the worker count is fixed for the lifetime of the application
- The number of race conditions we would have to think through on this bit of state is dizzying. Also have to think carefully about publication of writes, since right now we just write it once before the threads start and then go to town, meaning it's always visible
- Resizing upward is comparatively easy, since we're just adding workers which can then steal and take from the external and what not. Tasks would rebalance relatively quickly and life would be good. Resizing down is much harder, since we would need to first take workers out of rotation, then spill all their work, then wait for the worker to quiesce (while attempting to aggressively spill any excess work on each iteration), with the understanding that quiescence isn't guaranteed.
- We could also put the worker into a state where, at the next suspension, it simply refuses to continue working and forcibly spills whatever is left. That might be better, though it would cause noticeable latency spikes
- How will this interact with blocking?
from cats-effect.
Related Issues (20)
- Native `IORuntime.global` causes `RPCCore$ClosedException` when used for `munitExecutionContext` HOT 1
- Idea: Fiber and worker prod profiling
- Mass fiber wakeup fairness questions
- Enable fiber dumps on Scala Native
- Hotswap#get scaladoc/impl mismatch HOT 2
- Should `blocking` reset the auto-cede counter? HOT 2
- Warning about starvation MBean with sequential runs in SBT
- `Supervisor` accepts tasks after it is closed HOT 2
- Virtual Threads (Project Loom) in IO.blocking / IO.interruptible HOT 11
- Deferred.unsafe[IO, A] not using IODeferred HOT 3
- Hotswap documentation example code has a race condition HOT 1
- Can't get fresh mutable value after *> HOT 1
- Leaky `fromFutureCancelable` HOT 4
- Cancelation hangs in `Dispatcher#unsafeToFutureCancelable` HOT 2
- We need to be more explicit about the Cats Effect memory model HOT 35
- `ArrayIndexOutOfBoundsException` in `ByteStack` HOT 3
- `IOAppSpec` is flaky again…
- Using JDK21 virtual threads as compute pool
- Leaking fiber monitors when running in custom IORuntime using JDK 21 virtual threads HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cats-effect.