I would like to amend Discourse so we "automatically" absorb certain
traffic spikes. As it stands we can only configure unicorn with
num_workers and use TTIN and TTOUT to tune the number on the fly.

I was wondering if you would be open to patching unicorn to allow it
to perform auto-tuning based on raindrops info.

How it could work

1. configure unicorn with min_workers, max_workers, wince_delay, scale_up_delay

2. If queued requests is over 0 for N samples over scale_up_delay, add
a worker up until max_workers

3. If queued requests is 0 for N samples over wince_delay scale down
until you reach min workers

Having this system in place can heavily optimize memory in large
deployments and simplifies provisioning logic quite a lot.

Wondering what you think about this and if you think unicorn should
provide this option?

Reply via email to