Hello ! I have questions ! please help me ! thank you very much !
my cluster works , but not excellent. that's
please see this architecture below my questions first.
Q1:on the tomcats ,there are always 500~800 TIME_WAIT connections from haproxy;
Q2:when I use loadrunner to test this cluster , the result disappointed my very
much.
#!/bin/bash
netstat -ant | awk '{++S[$NF]} END{for(a in S) print a, S[a]}'
LISTEN 5
State 5
CLOSE_WAIT 7
State 1
ESTABLISHED 4
established) 1
FIN_WAIT1 9
FIN_WAIT2 6
TIME_WAIT 3135
please help to make this cluster works better !
------------------------------------------------
here is my architecture :
------------------------------------------------
first server:
haproxy port:80
nginx port:8080 (in charge of the statics pages and pics by the ACLs)
middle server:
totally has 4 servers,every server has 4 tomcats , totally has 16
tomcats.
database:
mysql-5.1.41
-------------------------------------------------
and this is my haproxy.cfg
-------------------------------------------------
global
log 127.0.0.1 local0 notice
maxconn 40960
chroot /usr/local/haproxy/chroot
uid 99
gid 99
nbproc 8
pidfile /usr/local/haproxy/logs/haproxy.pid
stats socket /var/run/haproxy.stat mode 600
stats maxconn 65536
ulimit-n 65536
daemon
#debug
#quiet
nosepoll
defaults
log global
mode http
option httplog
retries 3
option redispatch
option abortonclose
maxconn 40960
contimeout 5000
clitimeout 30000
srvtimeout 30000
timeout check 2000
option dontlognull
frontend haproxy
bind 0.0.0.0:80
mode http
option httplog
option httpclose
option forwardfor
maxconn 50000
clitimeout 30000
acl statcs url_reg
^[^?]*\.(jpg|html|htm|png|gif|css|shtml)([?]|$)
use_backend nginx if statcs
default_backend tomcat
backend nginx
mode http
balance roundrobin
contimeout 5000
srvtimeout 50000
server nginx 127.0.0.1:8080
backend tomcat
mode http
balance roundrobin
cookie JSESSIONID prefix
option redispatch
option httpclose
option forwardfor
retries 2
contimeout 5000
srvtimeout 50000
timeout check 2000
option httpchk ping /ping.jsp HTTP/1.0
server gw6tomcat1 172.23.248.6:8881 cookie gw6tomcat1 weight 3
check
server gw6tomcat2 172.23.248.6:8882 cookie gw6tomcat2 weight 3
check
server gw6tomcat3 172.23.248.6:8883 cookie gw6tomcat3 weight 3
check
server gw6tomcat4 172.23.248.6:8884 cookie gw6tomcat4 weight 3
check
server gw7tomcat1 172.23.248.7:8881 cookie gw7tomcat1 weight 3
check
server gw7tomcat2 172.23.248.7:8882 cookie gw7tomcat2 weight 3
check
server gw7tomcat3 172.23.248.7:8883 cookie gw7tomcat3 weight 3
check
server gw7tomcat4 172.23.248.7:8884 cookie gw7tomcat4 weight 3
check
server gw8tomcat1 172.23.248.8:8881 cookie gw8tomcat1 weight 3
check
server gw8tomcat2 172.23.248.8:8882 cookie gw8tomcat2 weight 3
check
server gw8tomcat3 172.23.248.8:8883 cookie gw8tomcat3 weight 3
check
server gw8tomcat4 172.23.248.8:8884 cookie gw8tomcat4 weight 3
check
2010-01-23