-
Notifications
You must be signed in to change notification settings - Fork 50
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
vips_concurrency_set analog #425
Comments
You can set the env var Though libvips will automatically size down threadpools if the host machine becomes overloaded (ie. |
I see, the variable is read only during module import, right? At least my experimentation says so. About the self-balancing, does it use load average or something else? Interesting feature. |
That's true, just on import. It's a single per-process setting. You can also set The adaptive pool sizing works by counting blocked threads. If a thread stops on a mutex, it looks up its threadpool and increments an "n-blocked-threads" counter on the pool. The thread work unit dispatcher watches this variable and (with a bit of hysteresis) sizes the pool up and down so that only a few threads are blocked. Pools starts off with concurrency / 2 workers, then either grow or shrink depending on the workload. Pools generally size on IO, but they'll size on system load too, since a heavily loaded system will tend to leave workers blocked. |
You can see the sizing like this:
That's very IO bound, so the pool is small (this PC has 32 hardware threads). If I do something with more CPU load, the pool sizes larger:
|
Thanks for the detail. |
Hello, is there a way to limit concurrency from within a pyvips using process? I'll probably need it to do process based SMP instead of using internal threads.
Sorry in advance if it's right under my eyes, but perusing the documentation didn't help.
The text was updated successfully, but these errors were encountered: