windows 2003+nginx+php 服务停止

东门淋雨 发布于 2012/12/03 16:32
阅读 1K+
收藏 0

系统环境是windows 2003 +nginx +php 5.2.6

采用Fast-cgi的方式。

运行10几分钟,有400个人访问后,就很慢,然后就直接没有响应了,即使在服务器上也打不开网页,只能重新起动NGINX服务,再运行十几分钟后,又不行了


系统配置是 1cpu+8G内存 服务器性能应该不错的 。。

请高手指点


nginx.conf文件配置如下:

#user  nobody;
worker_processes  1;

#worker_processes 4;
#worker_cpu_affinity 0001 0010 0100 1000;

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

events {
    worker_connections  10000;
    accept_mutex off;
}

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


    #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  500;


    #413 Request Entity Too Large 错误

    client_max_body_size 1m;

    #gzip  on;


    server {
        listen       80 default;
        server_name  localhost;


        charset gbk;


        #access_log  logs/host.access.log  main;


        location / {
        #    root   html;
   root   d:/wwwroot/guozhan;
            index  index.php index.html index.htm;
        autoindex on;
        }

        #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  /scripts$fastcgi_script_name;
        #    include        fastcgi_params;
    fastcgi_intercept_errors on;
        #}
        location ~ \.php$ {
   fastcgi_read_timeout 360;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  d:/wwwroot/guozhan$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;
        #}
    }

}

加载中
0
东门淋雨

2012/12/03 18:11:35 [error] 848#1412: *8660 upstream timed out (10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond) while connecting to upstream, client: 114.138.20.69, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "218.249.123.32", referrer: "http://www.cphoto123.com/"

总是报类似的错误。到现在也没有解决,没有办法,我换成APACHE就可以了。但还是希望能够解决 !

0
phper845
phper845

Nginx中要用第三方的FastCGI进程管理器,才能在生产环境中使用,不然php-cgi.exe进程运行几分钟就会死掉,可以用Visual-NMP有集成,Apache在Windows下性能太差,根本不能应付并发请求。

OSCHINA
登录后可查看更多优质内容
返回顶部
顶部