Sha256: e92a64bf88b7dec3351b5bfb5ce7c9fadd80a196302095351afe75b57755d384
Contents?: true
Size: 1.37 KB
Versions: 8
Compression:
Stored size: 1.37 KB
Contents
<% @path = "/etc/haproxy/haproxy.cfg" %> global log 127.0.0.1 local0 warning maxconn 1024 defaults log global mode http retries 3 balance roundrobin option abortonclose option redispatch contimeout 4000 clitimeout 150000 srvtimeout 30000 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. app_hosts = rubber_instances.for_role('app').collect { |i| i.name } web_hosts = rubber_instances.for_role('web').collect { |i| i.name } ports = (rubber_env.appserver_base_port.to_i ... rubber_env.appserver_base_port.to_i + rubber_env.appserver_count.to_i).to_a host_count = web_hosts.size host_mod = web_hosts.sort.index(rubber_env.host) rescue 0 ports = ports.find_all {|x| x % host_count == host_mod} %> <% app_hosts.each do |server| %> <% ports.each do |port| %> server <%= server %>_<%= port %> <%= server %>:<%= port %> maxconn 1 check <% end %> <% end %> # Admin interface for proxy stats listen admin 0.0.0.0:<%= rubber_env.haproxy_admin_port %> stats uri /haproxy # So monit can check on haproxy # simple response : 'OK' listen health_check 0.0.0.0:<%= rubber_env.haproxy_monitor_port %> mode health
Version data entries
8 entries across 8 versions & 1 rubygems