Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 42 lines (35 sloc) 1.324 kB
#!/bin/bash -e
. ../../bootstrap
PORT=$(basename "$(pwd)" |awk -F- '{print $2}')
USER=$(id -un)
cat - > haproxy.conf <<END
global
log 127.0.0.1 local0 warning
defaults
balance roundrobin
mode http
retries 3
option abortonclose
option redispatch
maxconn 4096
timeout connect 300000
timeout client 300000
timeout server 300000
listen rails_${USER}_$PORT 127.0.0.1:$PORT
timeout connect 300000
server app-$((PORT + 1)) 127.0.0.1:$((PORT + 1)) maxconn 1 check
server app-$((PORT + 2)) 127.0.0.1:$((PORT + 2)) maxconn 1 check
server app-$((PORT + 3)) 127.0.0.1:$((PORT + 3)) maxconn 1 check
server app-$((PORT + 4)) 127.0.0.1:$((PORT + 4)) maxconn 1 check
server app-$((PORT + 5)) 127.0.0.1:$((PORT + 5)) maxconn 1 check
server app-$((PORT + 6)) 127.0.0.1:$((PORT + 6)) maxconn 1 check
server app-$((PORT + 7)) 127.0.0.1:$((PORT + 7)) maxconn 1 check
server app-$((PORT + 8)) 127.0.0.1:$((PORT + 8)) maxconn 1 check
server app-$((PORT + 9)) 127.0.0.1:$((PORT + 9)) maxconn 1 check
server app-$((PORT + 10)) 127.0.0.1:$((PORT + 10)) maxconn 1 check
server fail-$((PORT - 1)) 127.0.0.1:$((PORT - 1)) backup check
listen stats 127.0.0.1:$((PORT - 2))
mode http
stats uri /
END
exec haproxy -db -f haproxy.conf 2>&1
Jump to Line
Something went wrong with that request. Please try again.