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

Alexey V. Karagodov kav at karagodov.name
Thu Dec 11 17:52:12 MSK 2008


On 11.12.2008, at 2:50, ...PaWeL... wrote:

> Здравствуйте. Настроили достаточно  
> мощный сервер. Установлен 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;
у вас 7 дисков?

во-первых читать в рассылке "нгинх 200 000  
одновременных коннектов)
>
===================================================
> 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;            # жесть  
> какая-то, 7 вокеров, по 128 мегабайт  
> буферов каждый ...
====================================================
из каких соображений взяты цифры выше?

>
>
>   include /etc/nginx/conf.d/*.conf;
> }
> -----------------------------------
>
> Может быть, стоит отключить keepalive или  
> уменьшить размер каких либо буферов?
>
на фрибсд с включенным PF он точно не  
нужен (моё мнение)
какая ОС ?
подробности сюда напишите, что у вас на  
чём, что как работает ( ну хотя бы что top  
показывает во время нагрузки) и ТД и ТП






More information about the nginx-ru mailing list