Created
July 9, 2012 10:39
-
-
Save xinz/3075716 to your computer and use it in GitHub Desktop.
a simple HAProxy configure for the websocket
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log 127.0.0.1 local0 info | |
maxconn 5000 | |
ulimit-n 10000 | |
defaults | |
log global | |
mode http | |
frontend pub-srv 0.0.0.0:8080 | |
maxconn 5000 | |
timeout client 40s | |
use_backend websocket if { hdr(Upgrade) -i WebSocket } | |
default_backend http | |
backend websocket | |
timeout connect 100s | |
timeout server 600s | |
server ws1 localhost:8084 weight 1 maxconn 2500 check | |
server ws2 localhost:8085 weight 1 maxconn 2500 check | |
backend http | |
timeout connect 40s | |
timeout server 30s | |
server www1 localhost:8084 weight 1 maxconn 2500 check | |
server www2 localhost:8085 weight 1 maxconn 2500 check |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note:
0. Ensure you have successfully installed the HAProxy (I'm testing with haproxy-1.4.21), and then execute "haproxy -f {correct_path_for_this_conf}/haproxy.conf"
http://linuxadminzone.com/enable-or-fix-logging-for-haproxy-load-balancer/
http://kevin.vanzonneveld.net/techblog/article/haproxy_logging/
http://code.google.com/p/haproxy-docs/wiki/Logging#Examples_of_logs