devinus / poolboy

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

Trying to understand max_overflow #100

Open wminghao opened 7 years ago

wminghao commented 7 years ago

Hi,

I am trying to whether poolboy can dynamically increase the pool size until it reaches the size.

Allocating resources in the beginning of the world seems to be wasteful.

Regards, Thanks

atlas-comstock commented 6 years ago

@wminghao
poolboy will allocating child at the beginning.

If you don't want this , you can set size to 1 and max_overflow to the size you want. When the size(1) of workers are all checked out, then poolboy can dynamically new works for you. Except that in this situation poolboy have to start_child for you, which may cost a little time, othes are all the same.

atlas-comstock commented 6 years ago

@devinus Am I right? I figured out this by reading code.

zugolosian commented 6 years ago

That sounds right ^ It'll only start overflow workers when all the original workers are checked out

Vagabond commented 6 years ago

Yes, overflow children are started on-demand (and destroyed on being checked back in).