Configurable worker dismiss timeout
arjan opened this issue · 2 comments
I would like to have a configurable timeout before an overflow worker is dismissed.
Since starting a worker can be an expensive process (e.g. establishing a db connection), with a certain load on the pool workers are started and stopped continuously, because the waiting queue might be empty but 1msec later it might be filled again. In this case, poolboy would have stopped a worker but milliseconds later need to spin it up again, causing a performance decrease due to the worker startup overhead.
My proposal is to add a timeout so that workers are only dismissed after the timeout has passed and the queue is empty at that point in time.
This sort of idea has been rejected before: #30
I'd be interested in a fork of poolboy that pursues this kind of development.
Thanks for the link! This makes a lot of sense to me now, i think I'll be putting more logic in the pool worker