devinus / poolboy

A hunky Erlang worker pool factory
http://github.com/devinus/poolboy
ISC License
1.56k stars 348 forks source link

What is max_overflow? #82

Closed laheadle closed 8 years ago

laheadle commented 8 years ago

The documentation states:

max_overflow: maximum number of workers created if pool is empty

What does this mean? When might this happen? How is this different from max_size?

devinus commented 8 years ago

Overflow are workers that are created and discarded on checkin when the pool is full.

amokan commented 8 years ago

@devinus I know you closed the issue here, but I'm wondering the same thing. If I specify a pool has a size of, say, 10 - why would I want it to overflow to more than this?

I'm just trying to understand a use-case or scenario where this makes sense. Thanks.

devinus commented 8 years ago

@amokan If you want to keep 10 connections around but want to allow the pool to overflow to e.g. allow 20 open connections but no more. The pool will reduce size to 10 when the 10 overflow get checked in.

amokan commented 8 years ago

@devinus :+1: Makes sense. Any reason on the naming here? Seems like min and max pool size would be clearer. Not suggesting a change, but it seems a little more clear right? And I don't blame you if the answer is no :)

devinus commented 8 years ago

I think overflow makes sense in this regard. Also I copied the naming from SQLAlchemy.