diff --git a/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/haproxy/haproxy-mongrel.conf b/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/haproxy/haproxy-mongrel.conf index 4e55fb989..97d72f27d 100644 --- a/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/haproxy/haproxy-mongrel.conf +++ b/generators/vulcanize/templates/complete_mongrel_mysql/config/rubber/role/haproxy/haproxy-mongrel.conf @@ -8,14 +8,14 @@ listen mongrel_proxy 0.0.0.0:<%= rubber_env.haproxy_listen_port %> # Since we do "fair" load balancing to the mongrels, we don't want to share mongrels # between haproxy instances otherwise we still end up with requests getting queued behind # slow ones. - mongrel_hosts = rubber_instances.for_role('mongrel').collect { |i| i.name } + app_hosts = rubber_instances.for_role('app').collect { |i| i.name } haproxy_hosts = rubber_instances.for_role('haproxy').collect { |i| i.name } ports = (rubber_env.mongrel_base_port.to_i ... rubber_env.mongrel_base_port.to_i + rubber_env.mongrel_count.to_i).to_a host_count = haproxy_hosts.size host_mod = haproxy_hosts.sort.index(rubber_env.host) rescue 0 ports = ports.find_all {|x| x % host_count == host_mod} %> - <% mongrel_hosts.each do |server| %> + <% app_hosts.each do |server| %> <% ports.each do |port| %> server <%= server %>_<%= port %> <%= server %>:<%= port %> maxconn 1 check <% end %>