失败(104:通过对等方重置连接)

我们正在使用php5-fpm和nginx


     #nginx -v
     nginx版本:nginx / 1.1.19
    
 *

     #php -v
     PHP 5.3.27-1〜dotdeb.0与Suhosin-Patch(cli)(内置:Jul 25 2013 19:30:39) 
    版权所有(c)1997-2013 The PHP Group
     Zend Engine v2.3.0,Zend Technologies版权所有(c)1998-2013
        使用Xdebug v2.2.3,版权所有(c)2002-2013,Derick Rethans

 *

得到以下错误,


     2013/08/21 20:00:20 [error] 12740#0:* 46从上游读取响应头时,recv()失败(104:由对等方重置连接):client:172.17.7.12,server:fe.test。 local,request:“GET / search?gender = female&ageFrom = 20&ageTo = 32&religionId =&casteId =&countryId =&heightFrom =&heightTo =&profileImageStatus =%28y + p%29&search = Search HTTP / 1.1”,upstream:“fastcgi:// unix:/ var / run / php5-fpm.sock:“,host:”fe.test.local“,referrer:”http://fe.test.local/

PHP5-FPMconfiguration,


     #grep ^ [^ \;] /etc/php5/fpm/php-fpm.conf

     [全球]
     pid = /var/run/php5-fpm.pid
     error_log = /var/log/php5-fpm.log
     log_level =通知 
     process_control_timeout = 30 
    包括=的/ etc / PHP5 / FPM / pool.d / *。CONF


     #grep ^ [^ \;] /etc/php5/fpm/pool.d/www.conf 
     [万维网]
     listen = /var/run/php5-fpm.sock
     listen.backlog = -1
     user = www-data
     group = www-data
    下午=dynamic
     pm.max_children = 10
     pm.start_servers = 4
     pm.min_spare_servers = 2
     pm.max_spare_servers = 6
     rlimit_files = 131072 
     rlimit_core =无限
     chdir = /

Nginx的configuration部分


    位置〜\ .php $                                                             
       {                                                                             
       fastcgi_index index.php;                                              
      包括fastcgi_params;                                               
       fastcgi_connect_timeout 120;                                           
       fastcgi_send_timeout 600;                                             
       fastcgi_read_timeout 600;                                             
       fastcgi_buffers 8 256k;                                               
       fastcgi_buffer_size 256k;                                             
       fastcgi_busy_buffers_size 256k;                                       
       fastcgi_temp_file_write_size 256k;                                    
       client_max_body_size 20M;                                             
       fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name;     
       #fastcgi_pass 127.0.0.1:9000;                                          
       fastcgi_pass unix:/var/run/php5-fpm.sock;
     }               


     #strace -f-8000 -p 12761
    过程12761附加 - 中断退出
     epoll_wait(9,{},1,944)= 0
     epoll_wait(9,{},1,1000)= 0
     epoll_wait(9,{},1,1000)= 0
     epoll_wait(9,269f530,1,1000)= -1 EINTR(中断的系统调用)
     --- SIGCHLD(Child exited)@ 0(0)---
    写(6,“C”,1)= 1
     rt_sigreturn(0x6)= -1 EINTR(中断的系统调用)
     epoll_wait(9,{{EPOLLIN,{u32 = 15427040,u64 = 15427040}}},1,122)= 1
    读(4,“C”,1)= 1
     wait4(-1,[{WIFEXITED(s)&& WEXITSTATUS(s)== 127}],WNOHANG | WSTOPPED,NULL)= 12826
    写(3,“[2013年8月21日19时33分37秒]警告:[池www]子12826退出275.844033秒后从代码127开始\ n”,112)= 112
    克隆(过程12832附加(等待父)
    过程12832恢复(父母12761准备好)
     child_stack = 0,flags = CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | SIGCHLD,child_tidptr = 0x7fd7a31cfa10)= 12832
     [pid 12832] set_robust_list(0x7fd7a31cfa20,0x18)= 0
     [pid 12832] dup2(1,2)= 2
     [pid 12832] close(3)= 0
     [pid 12832] dup2(7,0)= 0
     [pid 12832] geteuid()= 0
     septlimit(RLIMIT_NOFILE,{rlim_cur = 128 * 1024,rlim_max = 128 * 1024})= 0
     (pid 12832)setrlimit(RLIMIT_CORE,{rlim_cur = RLIM_INFINITY,rlim_max = RLIM_INFINITY})= 0
     [pid 12832] chdir(“/”)= 0
     [pid 12832] setgid(33)= 0
     open(“/ proc / sys / kernel / ngroups_max”,O_RDONLY)= 3
    阅读(3,“65536 \ n”,31)= 6
     [pid 12832] close(3)= 0
     [pid 12832] open(“/ etc / group”,O_RDONLY | O_CLOEXEC)= 3
     lseek(3,0,SEEK_CUR)= 0
     [pid 12832] fstat(3,{st_mode = S_IFREG | 0644,st_size = 777,...})= 0
     [pid 12832] mmap(NULL,777,PROT_READ,MAP_SHARED,3,0)= 0x7fd7a31c1000
     lseek(3,777,SEEK_SET)= 777
     [pid 12832] fstat(3,{st_mode = S_IFREG | 0644,st_size = 777,...})= 0
     [pid 12832] munmap(0x7fd7a31c1000,777)= 0
     [pid 12832] close(3)= 0
     [pid 12832] setgroups(1,[33])= 0
     [pid 12832] setuid(33)= 0
     [pid 12832] prctl(PR_SET_DUMPABLE,1)= 0
     [pid 12832] close(4)= 0
     [pid 12832]closures(6)= 0
     [pid 12832] rt_sigaction(SIGTERM,{SIG_DFL,[],SA_RESTORER,0x7fd7a02234a0,NULL,8)= 0
     [pid 12832] rt_sigaction(SIGINT,{SIG_DFL,[],SA_RESTORER,0x7fd7a02234a0,NULL,8)= 0
     [pid 12832] rt_sigaction(SIGUSR1,{SIG_DFL,[],SA_RESTORER,0x7fd7a02234a0,NULL,8)= 0
     [pid 12832] rt_sigaction(SIGUSR2,{SIG_DFL,[],SA_RESTORER,0x7fd7a02234a0,NULL,8)= 0
     [pid 12832] rt_sigaction(SIGCHLD,{SIG_DFL,[],SA_RESTORER,0x7fd7a02234a0,NULL,8)= 0
     [pid 12832] rt_sigaction(SIGQUIT,{0x7633f0,[],SA_RESTORER | SA_RESTART,0x7fd7a02234a0},NULL,8)= 0
     [pid 12832] close(7)= 0
     [pid 12832] accept(0,  
     [pid 12761] write(3,“[21-Aug-2013 19:33:37] NOTICE:[pool www] child 12832 started \ n”,62)= 62
     [pid 12761] wait4(-1,0x7fff07258a7c,WNOHANG | WSTOPPED,NULL)= 0
     [pid 12761] read(4,0x7fff07258b5f,1)= -1 EAGAIN(资源暂时不可用)
     [pid 12761] epoll_wait(9,{},1,108)= 0
     [pid 12761] epoll_wait(9,{},1,1000)= 0
     [pid 12761] epoll_wait(9,269f530,1,1000)= -1 EINTR(中断的系统调用)
     [pid 12761] --- SIGCHLD(孩子退出)@ 0(0)---
    写(6,“C”,1)= 1
     [pid 12761] rt_sigreturn(0x6)= -1 EINTR(中断的系统调用)
     [pid 12761] epoll_wait(9,{{EPOLLIN,{u32 = 15427040,u64 = 15427040}}},1,769)= 1
     (pid 12761)read(4,“C”,1)= 1
     [pid 12761] wait4(-1,[{WIFEXITED(s)&& WEXITSTATUS(s)== 127}],WNOHANG | WSTOPPED,NULL)= 12830
     [pid 12761] write(3,“[2013年8月21日19时33分39秒]警告:从开始10.053632秒后[池www]子12830退出代码127 \ n”,111)= 111
     [pid 12761]克隆(附带进程12833)
     child_stack = 0,flags = CLONE_CHILD_CLEARTID | CLONE_CHILD_SETTID | SIGCHLD,child_tidptr = 0x7fd7a31cfa10)= 12833
     [pid 12761] write(3,“[21-Aug-2013 19:33:39] NOTICE:[pool www] child 12833 started \ n”,62)= 62
     [pid 12761] wait4(-1,0x7fff07258a7c,WNOHANG | WSTOPPED,NULL)= 0
     [pid 12761] read(4,0x7fff07258b5f,1)= -1 EAGAIN(资源暂时不可用)
     [pid 12761] epoll_wait(9,  
     [pid 12833] set_robust_list(0x7fd7a31cfa20,0x18)= 0
     [pid 12833] dup2(1,2)= 2
     [pid 12833] close(3)= 0
     [pid 12833] dup2(7,0)= 0
     [pid 12833] geteuid()= 0
     septlimit(RLIMIT_NOFILE,{rlim_cur = 128 * 1024,rlim_max = 128 * 1024})= 0
     septlimit(RLIMIT_CORE,{rlim_cur = RLIM_INFINITY,rlim_max = RLIM_INFINITY})= 0
     [pid 12833] chdir(“/”)= 0
     [pid 12833] setgid(33)= 0
     open(“/ proc / sys / kernel / ngroups_max”,O_RDONLY)= 3
     [pid 12833] read(3,“65536 \ n”,31)= 6
     [pid 12833] close(3)= 0
     [pid 12833] open(“/ etc / group”,O_RDONLY | O_CLOEXEC)= 3
     lseek(3,0,SEEK_CUR)= 0
     [pid 12833] fstat(3,{st_mode = S_IFREG | 0644,st_size = 777,...})= 0
     [pid 12833] mmap(NULL,777,PROT_READ,MAP_SHARED,3,0)= 0x7fd7a31c1000
     lseek(3,777,SEEK_SET)= 777
     [pid 12833] fstat(3,{st_mode = S_IFREG | 0644,st_size = 777,...})= 0
     [pid 12833] munmap(0x7fd7a31c1000,777)= 0
     [pid 12833] close(3)= 0
     [pid 12833] setgroups(1,[33])= 0
     [pid 12833] setuid(33)= 0
     [pid 12833] prctl(PR_SET_DUMPABLE,1)= 0
     [pid 12833] close(4)= 0
     [pid 12833] close(6)= 0
     [pid 12833] rt_sigaction(SIGTERM,{SIG_DFL,[],SA_RESTORER,0x7fd7a02234a0,NULL,8)= 0
     [pid 12833] rt_sigaction(SIGINT,{SIG_DFL,[],SA_RESTORER,0x7fd7a02234a0,NULL,8)= 0
     [pid 12833] rt_sigaction(SIGUSR1,{SIG_DFL,[],SA_RESTORER,0x7fd7a02234a0,NULL,8)= 0
     [pid 12833] rt_sigaction(SIGUSR2,{SIG_DFL,[],SA_RESTORER,0x7fd7a02234a0,NULL,8)= 0
     [pid 12833] rt_sigaction(SIGCHLD,{SIG_DFL,[],SA_RESTORER,0x7fd7a02234a0,NULL,8)= 0
     [pid 12833] rt_sigaction(SIGQUIT,{0x7633f0,[],SA_RESTORER | SA_RESTART,0x7fd7a02234a0,NULL,8)= 0
     [pid 12833] close(7)= 0
     [pid 12833] accept(0,  
     [pid 12761] {},1,766)= 0
     [pid 12761] epoll_wait(9,{},1,1000)= 0这里是中间代码
     [pid 12761] epoll_wait(9,{},1,1000)= 0

上面的nginx错误表明这个问题与fastcgi(php-fpm)有关。

启用/etc/php5/fpm/pool.d/www.conf中的“catch_workers_output”后,在php5-fpm.log上得到相关的错误。 现在明白这个问题与AMQP模块有关。

[21-Aug-2013 23:32:57]警告:[pool www]子16091说成stderr:“php -fpm:pool www:symbol lookup error:/usr/lib/php5/20090626/amqp.so:undefined符号:amqp_open_socket“

问题已经修复,并安装好amqp模块