504 Gateway Time-out using Nginx & ISPCONFIG

Discussion in 'ISPConfig 3 Priority Support' started by tomek, Oct 3, 2013.

  1. tomek

    tomek New Member

    Hello All

    I installed a brand new server Centos 6.4 64bit on a dedicated machine, I followed The Perfect Server - CentOS 6.4 x86_64 (nginx, Dovecot, ISPConfig 3) .

    I have a few wordpress sites and a few joomla sites that I moved from an older server running Apache to the new one I just installed. Everything seems to be running fine, sites load etc, but everything soon stops, I am getting 504 Gateway Time-out errors. I have to restart php-fpm service to get it to start working again, but in a few minutes after restarting I am getting the same error.

    The only things I did that were not part of the guide was:
    For wordpress sites, in ISPCONFIG/Options in the nginx Directives in order for URL rewriting to work, I added

    location / {
    index index.php index.html index.htm;
    try_files $uri $uri/ /index.php?$args;
    }

    and for Joomla sites in the same place I added:

    # Support Clean (aka Search Engine Friendly) URLs</tt>
    location / {
    try_files $uri $uri/ /index.php?q=$request_uri;
    }

    I am not sure what is the cause of this problem. Searching on google, I tried several things I found, but nothing seems to help resolve the problem. Can somebody help me get this resolved?

    Thanks!
     
  2. falko

    falko Super Moderator Howtoforge Staff

  3. tomek

    tomek New Member

    These are last entries of the error log for one of the wordpress sites

    2013/10/02 19:30:53 [error] 2794#0: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.14, server: oelsnet.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9010", host: "oelsnet.net"
    2013/10/02 19:30:57 [error] 2794#0: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.14, server: oelsnet.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9010", host: "oelsnet.net"
    2013/10/02 19:31:08 [error] 2794#0: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.14, server: oelsnet.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9010", host: "oelsnet.net"
    2013/10/02 19:31:09 [error] 2794#0: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.14, server: oelsnet.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9010", host: "oelsnet.net"
    2013/10/02 19:31:09 [error] 2794#0: *2 connect() failed (111: Connection refused) while connecting to upstream, client: 192.168.1.14, server: oelsnet.net, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9010", host: "oelsnet.net"
    2013/10/02 21:50:44 [error] 2794#0: *140 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 192.168.1.122, server: oelsnet.net, request: "GET /wp-content/plugins/dropdown-menu-widget/css/shailan-dropdown.min.css HTTP/1.1", upstream: "fastcgi://127.0.0.1:9010", host: "oelsnet.net", referrer: "http://oelsnet.net/"
    2013/10/02 21:55:43 [error] 2794#0: *139 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 192.168.1.122, server: oelsnet.net, request: "GET /wp-content/plugins/ubm-premium/scripts.php?ver=3.6 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9010", host: "oelsnet.net", referrer: "http://oelsnet.net/"


    These are last entries of php-fpm log

    [01-Oct-2013 22:30:00] NOTICE: fpm is running, pid 9322
    [01-Oct-2013 22:30:00] NOTICE: ready to handle connections
    [01-Oct-2013 22:48:46] NOTICE: Reloading in progress ...
    [01-Oct-2013 22:48:46] NOTICE: reloading: execvp("php-fpm", {"php-fpm", "--daemonize"})
    [01-Oct-2013 22:48:46] NOTICE: using inherited socket fd=8, "127.0.0.1:9000"
    [01-Oct-2013 22:48:46] NOTICE: using inherited socket fd=8, "127.0.0.1:9000"
    [01-Oct-2013 22:48:46] NOTICE: fpm is running, pid 13769
    [01-Oct-2013 22:48:46] NOTICE: ready to handle connections
    [01-Oct-2013 22:50:03] WARNING: [pool ispconfig] child 13779 exited on signal 11 (SIGSEGV - core dumped) after 76.770434 seconds from start
    [01-Oct-2013 22:50:03] NOTICE: [pool ispconfig] child 14158 started
    [01-Oct-2013 22:54:03] NOTICE: Reloading in progress ...
    [01-Oct-2013 22:54:03] NOTICE: reloading: execvp("php-fpm", {"php-fpm", "--daemonize"})
    [01-Oct-2013 22:54:03] NOTICE: using inherited socket fd=8, "127.0.0.1:9000"
    [01-Oct-2013 22:54:03] NOTICE: using inherited socket fd=8, "127.0.0.1:9000"
    [01-Oct-2013 22:54:03] NOTICE: using inherited socket fd=10, "/var/lib/php5-fpm/apps.sock"
    [01-Oct-2013 22:54:03] NOTICE: using inherited socket fd=10, "/var/lib/php5-fpm/apps.sock"
    [01-Oct-2013 22:54:03] NOTICE: using inherited socket fd=12, "/var/lib/php5-fpm/ispconfig.sock"
    [01-Oct-2013 22:54:03] NOTICE: using inherited socket fd=12, "/var/lib/php5-fpm/ispconfig.sock"
    [01-Oct-2013 22:54:03] NOTICE: fpm is running, pid 14430
    [01-Oct-2013 22:54:03] NOTICE: ready to handle connections


    I went to the link you suggested about the emergency PHP-FPM settings, I made the adjustments in /etc/php-fpm.conf but this didn't help, I am still having the same problem.
     
    Last edited: Oct 4, 2013
  4. tomek

    tomek New Member

    I noticed that when the websites stop responding this error is present in /var/log/php-fpm/error.log

    [03-Oct-2013 21:26:18] WARNING: [pool web1] child 27029 exited on signal 11 (SIGSEGV - core dumped) after 555.135693 seconds from start

    I turned debug option and the log is as follows

    [03-Oct-2013 21:44:04.131474] DEBUG: pid 28203, fpm_scoreboard_proc_alloc(), line 296: [pool web1] the proc->free_slot was not free. Let's search
    [03-Oct-2013 21:44:04.132551] DEBUG: pid 28203, fpm_children_make(), line 421: [pool web1] child 28747 started
    [03-Oct-2013 21:44:04.132577] DEBUG: pid 28203, fpm_pctl_perform_idle_server_maintenance(), line 428: [pool web1] 1 child(ren) have been created dynamically
    [03-Oct-2013 21:44:04.132587] DEBUG: pid 28203, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web2] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
    [03-Oct-2013 21:44:04.132596] DEBUG: pid 28203, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool www] currently 0 active children, 5 spare children, 5 running children. Spawning rate 1
    [03-Oct-2013 21:44:04.132608] DEBUG: pid 28203, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web4] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
    [03-Oct-2013 21:44:04.132616] DEBUG: pid 28203, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool ispconfig] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
    [03-Oct-2013 21:44:04.132624] DEBUG: pid 28203, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web3] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
    [03-Oct-2013 21:44:05.132706] DEBUG: pid 28203, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool apps] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
    [03-Oct-2013 21:44:05.132741] DEBUG: pid 28203, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web5] currently 0 active children, 2 spare children, 2 running children. Spawning rate 1
    [03-Oct-2013 21:44:05.132755] DEBUG: pid 28203, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web1] currently 5 active children, 1 spare children, 6 running children. Spawning rate 2
    [03-Oct-2013 21:44:05.132782] DEBUG: pid 28203, fpm_pctl_perform_idle_server_maintenance(), line 379: [pool web2] currently 0 active children, 2 spare children, 2 running children. Spawning

    At this point im stuck....
     
    Last edited: Oct 4, 2013

Share This Page