nginx 0.6.39/php-5.2.5 FastCGI: периодически выпадает 502 Bad Gateway

dannym nginx-forum at nginx.us
Thu Oct 15 15:20:32 MSD 2009


Доброго времени суток!

Связка на CentOS - 2.6.18-92.1.22.el5PAE

Конфиг сервера

user nginx;
worker_processes  4;
worker_rlimit_nofile 10000;

error_log   /var/log/nginx/error.log debug;
pid         /var/run/nginx.pid;

events {
            use epoll;
            worker_connections  1024;
}

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

    access_log      /var/log/nginx/access.log;

    sendfile        on;
    tcp_nopush      on;

    keepalive_timeout 60;

    tcp_nodelay        on;

    gzip  on;
    gzip_min_length  1000;
    gzip_buffers     16 8k;
    gzip_comp_level  1;
    gzip_proxied     any;
    gzip_http_version 1.0;
    gzip_types       text/plain text/html text/xhtml text/css text/js;
    gzip_vary        on;

    include          vhosts.d/*;

}

Пускалка php-cgi
/usr/bin/spawn-fcgi -P /data/www/fcgi/sock_fcgi.pid -s /tmp/.fcgi/fcgi.sock -C 4 -u vuser -f /usr/bin/php-cgi

Лог ошибок заполнен сообщениями

2009/10/12 15:14:33  16723#0: *5853 readv() failed (104: Connection reset by peer) while reading upstream

При 502 такая ошибка
2009/10/12 16:02:30  18307#0: *161275 recv() failed (104: Connection reset by peer) while reading response header from upstream

Нагрузка небольшая. Bad Gateway возникает примерно раз за 2-4 часа. Пробовал повесить FastCGI на localhost, от проблемы не избавило. Интересно то, что бекенд живет, хотя nginx и возвращает 502. Лечится все перезапуском бекенда.
Посоветуйте где копать.

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,13911,13911#msg-13911






More information about the nginx-ru mailing list