nginx + зависание php-fcgi

Mykhail V Diordienko mixa.dior at gmail.com
Sun Nov 15 17:17:24 MSK 2009


Всем доброго дня,
Есть debian lenny, nginx 0.7.63 , php 5.2.11dotdeb , spawn-fcgi 1.6.3
Частенько один из процессов php-cgi зависает и виден через ss в статусе
root at vps_182:/usr/local#ss
State  Recv-Q Send-Q    Local Address:Port  Peer Address:Port    
CLOSE-WAIT  9 0 127.0.0.1:9001 127.0.0.1:52834  

Скрипт запуска spawn-fcgi
#!/bin/sh
PHP_FCGI_MAX_REQUESTS=300
killall -9 php5-cgi
/usr/local/spawn-fcgi/bin/spawn-fcgi -a 127.0.0.1 -p 9001 -u
arteveryday -C 2 -f /usr/bin/php5-cgi

Процесс висит похоже висит пока не отработает свои
PHP_FCGI_MAX_REQUESTS.  Load average при этом 1. Что делать? как
лечить? 
заранее спасибо!



Конфиг nginx:

user  www-data;
worker_processes  3;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;  

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}                            


http {
    client_max_body_size 512M;
    include       mime.types; 
    default_type  application/octet-stream;
    limit_req_zone  $binary_remote_addr  zone=one:10m   rate=2r/s;
                                                                  
    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '            
    #                  '"$http_user_agent" "$http_x_forwarded_for"';          

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;

    server {
        listen       80;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
            root   html;
            index  index.html index.htm;
        }                               

        #error_page  404              /404.html;

        # redirect server error pages to the static page /50x.html
        #                                                         
        error_page   500 502 503 504  /50x.html;                  
        location = /50x.html {                                    
            root   html;                                          
        }                                                         

        # proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #                                                          
        #location ~ \.php$ {                                       
        #    proxy_pass   http://127.0.0.1;                        
        #}                                                         

        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #                                                                   
        location ~ \.php$ {                                                 
            root           html;                                            
            fastcgi_pass   127.0.0.1:9000;                                  
            fastcgi_index  index.php;                                       
            fastcgi_param  SCRIPT_FILENAME  /var/www/test/$fastcgi_script_name;
            include        fastcgi_params;                                     
        }                                                                      

        # deny access to .htaccess files, if Apache's document root
        # concurs with nginx's one                                 
        #                                                          
        #location ~ /\.ht {                                        
        #    deny  all;                                            
        #}                                                         
    }                                                              


    # another virtual host using mix of IP-, name-, and port-based configuration
    #                                                                           
    server {                                                                    
        listen 80;                                                              
        server_name munin.tyty.ggg.org.ua;                                      
        location / {                                                            
            root /var/www/munin;                                                
            index index.html;                                                   
        }                                                                       
    }                                                                           
                                                                   
                                                                         
     server {                                                               
        listen       80;                                                    
                                           
        server_name  arteveryday.org www.arteveryday.org arteveryday.com.ua www.arteveryday.com.ua arteveryday.ru www.arteveryday.ru;

        location / {
            root   /var/www/arteveryday;
            index  index.html index.htm index.php;
            include /usr/local/nginx/conf/wp_super_cache;
        }                                                
        location ~ .php$ {                               
            include /usr/local/nginx/conf/fastcgi_params;
            fastcgi_pass   127.0.0.1:9001;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  /var/www/arteveryday$fastcgi_script_name;
            fastcgi_param  QUERY_STRING     $query_string;
            fastcgi_param  REQUEST_METHOD   $request_method;
            fastcgi_param  CONTENT_TYPE     $content_type;
            fastcgi_param  CONTENT_LENGTH   $content_length;
        }


    }



}





More information about the nginx-ru mailing list