2012-08-08 2 views
2

내가 haproxy 2 개 백엔드와 설정이 있습니다 BE1 및 BE2haproxy - 1 백엔드 큐, 다른도 영향을

I 경로에 따라 경로에 ACL을 사용하고 있습니다.

be2가 큐를 만들기 시작하면 be1에 대한 요청이 부정적으로 영향을받습니다. 일반적으로 100ms가 걸린 요청은 2-3 초가 걸립니다.

be2가 be1의 성능에 영향을 미치지 않고 대기열에 넣을 수있는 방법이 있습니까?

정상에서 나는 약 2000 req/s를 제공하고 있었다.

global 
    log 127.0.0.1 local0 
    log 127.0.0.1 local1 notice 
    #log loghost local0 info 
    maxconn 2000 
    #chroot /usr/share/haproxy 
    user haproxy 
    group haproxy 
    daemon 
    #debug 
    #quiet 
    ulimit-n 65535 
    stats socket /var/run/haproxy.sock 
    nopoll 

defaults 
    log global 
    mode http 
    option httplog 
    option dontlognull 
    retries 3 
    option redispatch 
    maxconn 2000 
    contimeout 5000 
    clitimeout 50000 
    srvtimeout 50000 

frontend http_in *:80 
    option httpclose 
    option forwardfor 
    acl vt path_beg /route/1 
    use_backend be2 if vt 
    default_backend be1 

backend be1 
    balance leastconn 
    option httpchk HEAD /redirect/are_you_alive HTTP/1.0 
    server 01-2C2P9HI x:80 check inter 3000 rise 2 fall 3 maxconn 500 

backend be2 
    balance leastconn 
    option httpchk HEAD /redirect/are_you_alive HTTP/1.0 
    server 01-3TPDP27 x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-3CR0FKC x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-3E9CVMP x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-211LQMA x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-3H974V3 x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-13UCFVO x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-0HPIGGT x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-2LFP88F x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-1TIQBDH x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-2GG2LBB x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-1H5231E x:80 check inter 3000 rise 2 fall 3 maxconn 250 
    server 01-0KIOVID x:80 check inter 3000 rise 2 fall 3 maxconn 250 

listen stats 0.0.0.0:7474  #Listen on all IP's on port 9000 
    mode http 
    balance 
    timeout client 5000 
    timeout connect 4000 
    timeout server 30000 
    #This is the virtual URL to access the stats page 
    stats uri /haproxy_stats   
    #Authentication realm. This can be set to anything. Escape space characters with a backslash. 
    stats realm HAProxy\ Statistics 
    #The user/pass you want to use. Change this password! 
    stats auth ge:test123 
    #This allows you to take down and bring up back end servers. 
    #This will produce an error on older versions of HAProxy. 
    stats admin if TRUE 
나는이 어제 통지를하지 않았지만, 그 MAXCONN는 2000로 설정되어 보는 방법 확실하지

... 그 가능성이 내 문제 중 하나입니다 그래서?

답변

1

두 가지 maxconn 설정이 있습니다. 하나는 프론트 엔드 용이고 다른 하나는 백엔드 용입니다. 프론트 엔드에 대한 설정은 들어오는 연결을 제한하므로 백엔드가 사용 가능하더라도 프론트 엔드 측에서 대기중인 요청을받지 못합니다. 요청이 프론트 엔드를 통과하면 백엔드 대기열이 발생합니다. 프론트 엔드는 "default"섹션의 maxconn 설정의 영향을받습니다. 따라서 백엔드가이를 처리 할 수 ​​있어야하므로 예를 들어 4000으로 증가시킵니다.

maxconn은 초당 요청 수를 제한하지 않고 동시 연결 수를 지정하십시오. 사용 가능한 처리량을 많이 제한 할 수있는 HTTP 연결 유지 요청이 활성 상태 일 수 있습니다.