压力测试后,解决NGINX + CAS双机负载问题

原生CAS, 在loadrunner 500并发下,表现良好,但集成了NGINX后出现的瓶颈。

下面是对NGINX的配置,解决问题:

#
upstream cas_server {
        server      192.168.XX.35:8880 max_fails=3 fail_timeout=3s weight=9;
        server      192.168.XX.67:8080 max_fails=3 fail_timeout=3s weight=9;
 
       #keepalive   16; 
        keepalive   128;
}

server {
    listen              80;
    server_name         localhost;

    location /cas {
        access_log                   logs/oacas.XXX.com-casserver_acc.log main;
        error_log                    logs/oacas.XXX-casserver_err.log warn;
        client_body_buffer_size      128k;
        proxy_redirect               off;
        proxy_set_header             Host $host;
        proxy_set_header             X-Real-IP $remote_addr;
        proxy_set_header             X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_connect_timeout        120;  #60
        proxy_send_timeout           60;
        proxy_read_timeout           120;
        proxy_buffer_size            32k;
        proxy_buffers              4 32k;
        proxy_busy_buffers_size      64k;
        proxy_temp_file_write_size   64k;
        proxy_next_upstream          error timeout invalid_header http_500 http_503 http_404;
        proxy_pass                   http://cas_server;
        
        proxy_http_version 1.1;
        proxy_set_header Connection ""; 

   }

}


你可能感兴趣的:(CAS)