zombocom / puma_worker_killer

Automatically restart Puma cluster workers based on max RAM available
747 stars 77 forks source link

Add option to adjust restart randomizer #78

Closed SuperQ closed 4 years ago

SuperQ commented 4 years ago
schneems commented 4 years ago

Can we make it accept a range object instead of and end value. Also I would like the argument to be named jitter_range.

If you're worried about it being a float we can also call to_f after the rand() call.

Can you also add some docs for using this to the README?

SuperQ commented 4 years ago

Sorry, this fell out of my inbox. I'm not sure what you're going for with the range object.

It doesn't seem like .to_f is necessary. As long as the rand() argument has a float argument, the output is a float.

schneems commented 4 years ago

What's the desire here? What is the end goal, did you run into a problem you're trying to address?

SuperQ commented 4 years ago

The goal is to avoid thundering herd and distributed clock synchronization problems by having randomized offsets. In addition, for very large services, the restart and warmup of workers is a lot of resources. Doing them too quickly can lead to overloaded instances.

schneems commented 4 years ago

I merged in some rubocop rules. Can you update your branch again?

Locally this should fix things:

bundle exec rubocop --auto-correct
SuperQ commented 4 years ago

Whups, had some typos. Thanks!

schneems commented 4 years ago

Released in v0.3.0

SuperQ commented 4 years ago

Nice! Thanks!