+ -
当前位置:首页 → 问答吧 → nginx运行异常,“connect() failed (110: Connection timed out)”问题?

nginx运行异常,“connect() failed (110: Connection timed out)”问题?

时间:2010-07-27

来源:互联网

本帖最后由 huifeideluotuo 于 2010-07-27 11:10 编辑

配置环境

硬件环境:
CPU:Intel(R) Xeon(R) CPU 3050  @ 2.13GHz
内存:4G       

软件环境:centos5.4 + php5.2.8 + nginx0.8.37

nginx.conf配置文件如下:
  1. user  www www;
  2. worker_processes 2;
  3. worker_rlimit_nofile    51200;

  4. events
  5. {
  6.   use                   epoll;
  7.   worker_connections    51200;
  8. }


  9. http
  10. {
  11.   include                       mime.types;
  12.   default_type                  application/octet-stream;

  13.       
  14.   server_names_hash_bucket_size 256;
  15.   client_header_buffer_size     1024k;
  16.   large_client_header_buffers   4 1024k;
  17.   client_max_body_size          32m;
  18.   client_body_buffer_size       256k;
  19.   client_header_timeout         3m;
  20.   client_body_timeout           3m;
  21.   send_timeout                  3m;
  22.       
  23.   sendfile                      on;
  24.   tcp_nopush                    on;

  25.   keepalive_timeout             60;

  26.   tcp_nodelay                   on;

  27.   fastcgi_intercept_errors      on;

  28.   fastcgi_connect_timeout       500;
  29.   fastcgi_send_timeout          500;
  30.   fastcgi_read_timeout          500;
  31.   fastcgi_buffer_size           1024k;
  32.   fastcgi_buffers               8 1024k;
  33.   fastcgi_busy_buffers_size     1024k;
  34.   fastcgi_temp_file_write_size  1024k;

  35.   gzip                          on;
  36.   gzip_min_length               1k;
  37.   gzip_buffers                  4 16k;
  38.   gzip_http_version             1.0;
  39.   gzip_comp_level               2;
  40.   gzip_types                    text/plain application/x-javascript text/css application/xml;
  41.   gzip_vary                     on;
复制代码
问题现象描述:
nginx在运行时出现一些异常问题,此时静态页面(html)可以打开,但是不能加载动态页面,一直处于等待状态,此时重新启动nginx后恢复正常,查看日志错误内容如下:

2010/07/26 09:59:52 [error] 12929#0: *304919 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.10.4, server: 123.test.cn, request: "GET /index.php?module=default&submod=user_setting&method=user_home_page HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "123.test.cn", referrer: "http://123.test.cn/index.php?method=left&parent_id=121&section_id=default&open_mainframe=1"

2010/07/26 10:03:44 [error] 12930#0: *311831 connect() failed (110: Connection timed out) while connecting to upstream, client: 192.168.10.4, server: 123.test.cn, request: "GET /index.php?method=left&parent_id=3&section_id=customer&open_mainframe=1 HTTP/1.0", upstream: "fastcgi://127.0.0.1:9000", host: "123.test.cn", referrer: "http://123.test.cn/index.php?method=top&section_id=&main_url="


也查找了原因,很多朋友也遇到这样的问题,但是没有解决,说是nginx不稳定的原因,如果不稳定,那QQ、迅雷怎么还用呢?

请兄弟们指教,谢谢!

作者: huifeideluotuo   发布时间: 2010-07-27

你php部分怎么搞的

作者: scyzxp   发布时间: 2010-07-30

你php部分怎么搞的

作者: scyzxp   发布时间: 2010-07-30

建议关闭gzip试下

作者: 打酱油   发布时间: 2010-08-12

热门下载

更多