connect() failed (110: Connection timed out) while connecting to upstream

...PaWeL... pawelnpo at mail.ru
Thu Dec 11 02:50:47 MSK 2008


Здравствуйте. Настроили достаточно мощный сервер. Установлен nginx в 
качестве фронтенда к апачу. При сильной нагрузке (10 – 20 тысяч человек 
онлайн) в лог пишется куча ошибок вида:

2008/12/11 00:23:36 [error] 26146#0: *17283950 connect() failed (110: 
Connection timed out) while connecting to upstream, client: 84.168.75.26, 
server: _, request: "GET /eventinfo/17167/ HTTP/1.1", upstream: 
"http://80.93.58.17:80/eventinfo/17167/", host: "domen.ru", referrer: 
"http://domen.ru/eventinfo/17167/"
2008/12/11 00:23:36 [error] 26147#0: *17331326 connect() failed (110: 
Connection timed out) while connecting to upstream, client: 81.200.24.213, 
server: _, request: "GET /crossdomain.xml HTTP/1.1", upstream: 
"http://80.93.58.17:80/crossdomain.xml", host: "domen.ru"
2008/12/11 00:23:36 [error] 26148#0: *17335876 connect() failed (110: 
Connection timed out) while connecting to upstream, client: 84.45.218.224, 
server: _, request: "GET 
/ajax.worker.php?rs=ajax_newmsg&rst=&rsrnd=1228944116062&rsargs[]=17206&rsargs[]=0&rsargs[]=en 
HTTP/1.1", upstream: 
"http://80.93.58.17:80/ajax.worker.php?rs=ajax_newmsg&rst=&rsrnd=1228944116062&rsargs[]=17206&rsargs[]=0&rsargs[]=en", 
host: "domen.ru", referrer: http://domen.ru/en/eventinfo/17206/

И сайт жутко лагает. Страницы открываются по 5-10-20 секунд. Или воовсе не 
открываются. Возможно, переполняется сетевой стек т.к. появляются и дроугие 
сетевые ошибки (например phph скрпит не может подключиться к удаленному 
серверу)..

Конфиг nginx:
-----------------------------------
user     apache;
worker_processes  7;
worker_rlimit_nofile 20240;
worker_rlimit_sigpending 32768;

error_log         /var/log/nginx/error.log;

pid        /var/run/nginx.pid;

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    access_log off;

    sendfile        on;
    tcp_nopush     on;
    tcp_nodelay            on;

    keepalive_timeout  15;
    server_names_hash_bucket_size  256;
    gzip  on;
    gzip_min_length 1100;
    gzip_buffers 12 32k;
    gzip_types text/plain application/x-javascript text/css text/xml;

    client_header_buffer_size 32k;
    large_client_header_buffers 32 8k;

    client_header_timeout 3m;
    client_body_timeout 3m;
    client_max_body_size       500m;
    client_body_buffer_size    128k;

    send_timeout 3m;

    proxy_read_timeout          180;
    proxy_connect_timeout       180;
    proxy_send_timeout          180;

    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_buffers           2048 64k;

    include /etc/nginx/conf.d/*.conf;
}
-----------------------------------

Может быть, стоит отключить keepalive или уменьшить размер каких либо 
буферов? 






More information about the nginx-ru mailing list