module Unicorn::AutoScaling::Configurator

Auto scaling options for the Unicorn::Configurator

Constants

DEFAULTS

Public Class Methods

extend_instance!(c) click to toggle source
# File lib/unicorn/auto_scaling/configurator.rb, line 55
def self.extend_instance!(c)
  c.extend(self)

  c.set.merge!(DEFAULTS)
end

Public Instance Methods

autoscale_check_interval(value) click to toggle source

sets the interval for checking if scaling should be performed

# File lib/unicorn/auto_scaling/configurator.rb, line 41
def autoscale_check_interval(value)
  set_int(:autoscale_check_interval, value, 1)
end
autoscale_idle_time_decrement(value) click to toggle source

sets the time minimum average idle time before a worker decrement is performed

# File lib/unicorn/auto_scaling/configurator.rb, line 23
def autoscale_idle_time_decrement(value)
  set_int(:autoscale_idle_time_decrement, value, 1)
end
autoscale_idle_time_increment(value) click to toggle source

sets the time maximum average idle time before a worker increment is performed

# File lib/unicorn/auto_scaling/configurator.rb, line 29
def autoscale_idle_time_increment(value)
  set_int(:autoscale_idle_time_increment, value, 1)
end
autoscale_idle_time_samples(value) click to toggle source

sets the amount of requests used to calculate the average idle time

# File lib/unicorn/auto_scaling/configurator.rb, line 35
def autoscale_idle_time_samples(value)
  set_int(:autoscale_idle_time_samples, value, 1)
end
autoscale_max_workers(value) click to toggle source

sets the maximum number of worker processes

# File lib/unicorn/auto_scaling/configurator.rb, line 51
def autoscale_max_workers(value)
  set_int(:autoscale_max_workers, value, 1)
end
autoscale_min_workers(value) click to toggle source

sets the minimum number of worker processes

# File lib/unicorn/auto_scaling/configurator.rb, line 46
def autoscale_min_workers(value)
  set_int(:autoscale_min_workers, value, 1)
end
autoscaling(value) click to toggle source

enables autoscaling if set to true or disables it otherwise

# File lib/unicorn/auto_scaling/configurator.rb, line 17
def autoscaling(value)
  set_bool(:autoscaling, value)
end