Skip to content
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

Runtime size changes #26

Open
reiddraper opened this issue Apr 2, 2013 · 3 comments
Open

Runtime size changes #26

reiddraper opened this issue Apr 2, 2013 · 3 comments

Comments

@reiddraper
Copy link

It would be nice to be able to change the size and max_overflow parameters at runtime. This would be useful for situations where you have long-running processes that it would be inconvenient to be interrupted by a node reboot. I suspect, however, that this change would be more complicated than a simple:

update_size(PoolPid, Size, MaxOverflow) ->
  gen_server:call(PoolPid, {update_state, {Size, MaxOverflow}}).

handle_call({update_state, _From, {Size, MaxOverflow}}, State) ->
  UpdatedState = State#state{size=Size, max_overflow=MaxOverFlow},  
  {reply, ok, UpdatedState}.

but I could be over-thinking it. I'm wondering about issues like: what happens if you shrink the pool size, do you kill workers? Just wait for them to be returned to the pool and then gracefully dismiss them? What happens if you raise the base pool size, do you pre-populate again?

Thoughts?

@devinus
Copy link
Owner

devinus commented Apr 10, 2013

This actually wouldn't be hard at all. If it was coded right it would just begin scaling to new parameters. However, reducing the pool size should NOT kill off workers.

@reiddraper
Copy link
Author

Cool, I have a half-started branch that implements this. I'll finish it up and make a PR in the next week or so.

@TurplePurtle
Copy link

Any updates on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants