4

We have an apache server stopping serving requests constantly due to the following error:

(70007)The timeout specified has expired: [client xxx.xxx.xxx.xxx:33740] AH01075: Error dispatching request to : (polling), referer: https://www.google.com/
[proxy_fcgi:error] [pid 12363:tid 139906999342848] [client xxx.xxx.xxx.xxx:6318] AH01067: Failed to read FastCGI header

It seems no matter what we do, this keeps happening, I have tried setting the timeout in the php.conf:

#
# Cause the PHP interpreter to handle files with a .php extension.
#
RequestReadTimeout header=180 body=180

  <FilesMatch \.php$>
    SetHandler "proxy:unix:/var/run/php-fpm/php5-fpm.sock|fcgi://127.0.0.1 timeout=1800 connectiontimeout=1800"
  </FilesMatch>
<Proxy "unix:/var/run/php-fpm/php5-fpm.sock|fcgi://127.0.0.1" timeout=1800 connectiontimeout=1800>
ProxySet timeout=1800 connectiontimeout=1800
</Proxy>
<Proxy "fcgi://127.0.0.1">
ProxySet timeout=1800 connectiontimeout=1800
</Proxy>
#<FilesMatch \.php$>
#    SetHandler application/x-httpd-php
#</FilesMatch>

#
# Allow php to handle Multiviews
#
AddType text/html .php

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

#
# Uncomment the following lines to allow PHP to pretty-print .phps
# files as PHP source code:
#
#<FilesMatch \.phps$>
#    SetHandler application/x-httpd-php-source
#</FilesMatch>

From our mpm-worker.conf file:

<IfModule worker.c>
ThreadLimit 60
StartServers 5
MaxClients 60
ServerLimit 60
MinSpareThreads 10
MaxSpareThreads 250
ThreadsPerChild 60
MaxRequestsPerChild 500
MaxRequestWorkers 300
</IfModule>

From our vhosts file:

<VirtualHost *:80>
    LimitRequestBody 0
    RewriteEngine On
    RewriteOptions InheritBefore
    DocumentRoot "/var/www/html"
    ServerName xxxxx.com
</VirtualHost>

PHP_FPM www.conf:

[www]
listen = /var/run/php-fpm/php5-fpm.sock
listen.allowed_clients = 127.0.0.1
listen.backlog = 10240
listen.owner = apache
listen.group = apache
listen.mode = 0666
user = apache
group = apache
pm = dynamic
pm.max_children = 60 
pm.start_servers = 20
pm.min_spare_servers = 20
pm.max_spare_servers = 60
pm.max_requests = 500
;pm.status_path = /status
;ping.path = /ping
;ping.response = pong
rlimit_files = 10240
rlimit_core = unlimited
request_terminate_timeout = 180s
php_admin_value[post_max_size] = 64M

The timeout is set to 180 for Apache. php.ini has default_socket_timeout = 180

Memory Usage: php_fpm:

ps -ylC php-fpm | awk '{x += $8;y += 1} END {print "PHP-FPM Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
PHP-FPM Memory Usage (MB): 5121.8
Average Proccess Size (MB): 62.4609

Apache:

ps -ylC httpd | awk '{x += $8;y += 1} END {print "Apache Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
Apache Memory Usage (MB): 319.66
Average Proccess Size (MB): 39.9575

Memory:

             total       used       free     shared    buffers     cached
Mem:          7483       6141       1342          6         44        945
-/+ buffers/cache:       5150       2332
Swap:            0          0          0

I read an article about a patch but it did not apply to our version of Apache in respect to the timeout issue.

MySQL and Memcached are running on other servers.

Any ideas?

David Eisen
  • 633
  • 5
  • 21

0 Answers0