Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache with PHP-FPM intermittent error
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
NathanZachary
Moderator
Moderator


Joined: 30 Jan 2007
Posts: 2469
Location: /home/zach

PostPosted: Fri Oct 21, 2016 5:16 pm    Post subject: Apache with PHP-FPM intermittent error Reply with quote

So, I've been running Apache without mod_php in favour of PHP-FPM connected via proxy_fcgi (UDS) for quite some time now. Seemingly randomly, though, there are some times where performing any function on a site (from updating it, to just browsing, to loading some Piwik stats) will result in a "503 Service Unavailable" error. When that happens, I see the following snippet in the Apache error_log:

Code:

[Mon Oct 17 20:42:01.829980 2016] [proxy_fcgi:error] [pid 2105:tid 140190332966656] [client IP:56535] AH01067: Failed to read FastCGI header, referer: http://site1/wp-admin/theme-editor.php?<snip>
[Mon Oct 17 20:42:01.830077 2016] [proxy_fcgi:error] [pid 2105:tid 140190332966656] (104)Connection reset by peer: [client IP:56535] AH01075: Error dispatching request to : , referer: http://site1/wp-admin/theme-editor.php?<snip>


At the same time, I see the following notices and warnings in the PHP-FPM log:

Code:

[17-Oct-2016 20:42:01] WARNING: [pool site1] child 15811, script '<snip>site1/wp/htdocs/wp-admin/theme-editor.php' (request: "GET /wp-admin/theme-editor.php") execution timed out (1432.230967 sec), terminating
[17-Oct-2016 20:42:01] WARNING: [pool site1] child 15811 exited on signal 15 (SIGTERM) after 14016.074704 seconds from start
[17-Oct-2016 20:42:01] NOTICE: [pool site1] child 23195 started


I have looked up these errors, but can't seem to find a cause of them. Here is the relevant configuration for the given site:

Apache's UDS proxy to PHP:
Code:

        <FilesMatch "\.php$">
                SetHandler "proxy:unix:///var/run/php-fpm/site1.sock|fcgi://site1/"
        </FilesMatch>
        <Proxy fcgi://site1/ enablereuse=on max=10>
        </Proxy>



PHP-FPM:
Code:

[site1]
listen = /var/run/php-fpm/site1.sock
listen.owner = site1
listen.group = apache
listen.mode = 0660
user = site1
group = apache
pm = dynamic
pm.start_servers = 3
pm.max_children = 100
pm.min_spare_servers = 2
pm.max_spare_servers = 5
pm.max_requests = 10000
request_terminate_timeout = 300


I thought that it might have something to do with PHP's OpCache, so I disabled it, but the problem still comes up from time to time.

Any pointers?

Thank you preemptively.

Cheers,
Nathan Zachary
_________________
“Truth, like infinity, is to be forever approached but never reached.” --Jean Ayres (1972)
---avatar cropped from =AimanStudio---
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum