-
Notifications
You must be signed in to change notification settings - Fork 13
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
Bounded process pool? #26
Comments
This is now tracked here @jaddison (moved from BitBucket). |
@jgehrcke I believe the combination of So, at the moment, I do not need this particular feature in Thanks for picking up the reins again! 🚀 |
Any update on this? |
To add detail to my use case: I am using gipc to create a split-run-join paradigm. Within a gevent WSGI environment, I need to spawn some number of jobs that are long running that need to all return results to the original spawn. My current wrapper looks something like this:
So, I am looking for a way to cap the number of simultaneous greenlets this would spawn, because as-is it is unbounded. |
Originally reported by: jaddison (Bitbucket: jaddison, GitHub: jaddison)
Is gipc compatible with a pool scenario? I want to take web requests to resize images - the resizing of images likely fits well into a separate process, given the GIL.
That said, I do not want uncontrolled process spawning. Is it possible to achieve something like
gevent.pool.ThreadPool
like upper limit pool sizing? Along the order of:On initialization, create a process pool size of 20.
Handle incoming web request, ask the pool to perform image resizing function and cooperatively wait for the result
Once the result is returned from the process, return it to the web client
Handle many incoming requests, but do not perform more than 20 image resizes at a time because the process pool is bounded
If this is possible, can the processes be reused to save on process initialization overhead?
The docs make it seem like gipc is great for spawning processes and waiting, but in an uncontrolled fashion? Or am I misunderstanding? Thanks!
The text was updated successfully, but these errors were encountered: