nginx + PHP-FPM (7.0) hangs on some requestsNGINX : Keep alive requests to static content ok - Keep alive requests to php-fpm requests hang until keepalive_timeout is reachedhow exactly does nginx/php-fpm process requests?PHP FPM state Finishing but never completesNginx PHP-FPM stops after connection timeoutWhat's the Relationship Between an nginx worker_process and PHP-FPMNGinX + PHP-FPM Microservices deadlockNginx and PHP-FPM concurrent requests from same IPNginx / PHP-FPM hanging connectionsnginx + php5-fpm: Resource temporarily unavailablePeriodically 504 timeout with nginx and php-fpm
Can I combine SELECT TOP() with the IN operator?
Copper as an adjective to refer to something made of copper
Why would a military not separate its forces into different branches?
Efficient deletion of specific list entries
Is there precedent or are there procedures for a US president refusing to concede to an electoral defeat?
All of my Firefox add-ons been disabled suddenly, how can I re-enable them?
Transistor gain, what if there is not enough current?
What do you call a painting painted on a wall?
What is the meaning of 「隣のおじいさんは言いました」
Is there a reason why Turkey took the Balkan territories of the Ottoman Empire, instead of Greece or another of the Balkan states?
How long does it take a postcard to get from USA to Germany?
Picking a theme as a discovery writer
What does the coin flipping before dying mean?
Emergency stop in plain TeX, pdfTeX, XeTeX and LuaTeX?
TIP120 Transistor + Solenoid Failing Randomly
Two denim hijabs
Why can't argument be forwarded inside lambda without mutable?
How can I obtain and work with a Platonic dodecahedron?
Can an earth elemental drag a tiny creature underground with Earth Glide?
Gerrymandering Puzzle - Rig the Election
Can a good but unremarkable PhD student become an accomplished professor?
Subnumcases as a part of align
How is Pauli's exclusion principle still valid in these cases?
How long did it take Captain Marvel to travel to Earth?
nginx + PHP-FPM (7.0) hangs on some requests
NGINX : Keep alive requests to static content ok - Keep alive requests to php-fpm requests hang until keepalive_timeout is reachedhow exactly does nginx/php-fpm process requests?PHP FPM state Finishing but never completesNginx PHP-FPM stops after connection timeoutWhat's the Relationship Between an nginx worker_process and PHP-FPMNGinX + PHP-FPM Microservices deadlockNginx and PHP-FPM concurrent requests from same IPNginx / PHP-FPM hanging connectionsnginx + php5-fpm: Resource temporarily unavailablePeriodically 504 timeout with nginx and php-fpm
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I'm experiencing a weird issue with nginx + PHP-FPM hosted web app build with Symfony2. Basically, from time to time, there's a request that is not handled, instead the browser shows that it's waiting to start receiving (the wheel in chrome is spinning counter-clockwise).
I have nothing in error logs there that would help me identify the issue, neither in app log itself (Symfony 2.8), nginx nor php-fpm logs.
What is weird is there's no timeout at all, which would suggest php-fpm didn't even receive that request (right?).
Perhaps there's anyone who did experience such issues before and may know the probable cause?
Should I provide anything that would seem relevant (config files?), please do not hesitate to ask in comments.
nginx php-fpm timeout hangs
add a comment |
I'm experiencing a weird issue with nginx + PHP-FPM hosted web app build with Symfony2. Basically, from time to time, there's a request that is not handled, instead the browser shows that it's waiting to start receiving (the wheel in chrome is spinning counter-clockwise).
I have nothing in error logs there that would help me identify the issue, neither in app log itself (Symfony 2.8), nginx nor php-fpm logs.
What is weird is there's no timeout at all, which would suggest php-fpm didn't even receive that request (right?).
Perhaps there's anyone who did experience such issues before and may know the probable cause?
Should I provide anything that would seem relevant (config files?), please do not hesitate to ask in comments.
nginx php-fpm timeout hangs
add a comment |
I'm experiencing a weird issue with nginx + PHP-FPM hosted web app build with Symfony2. Basically, from time to time, there's a request that is not handled, instead the browser shows that it's waiting to start receiving (the wheel in chrome is spinning counter-clockwise).
I have nothing in error logs there that would help me identify the issue, neither in app log itself (Symfony 2.8), nginx nor php-fpm logs.
What is weird is there's no timeout at all, which would suggest php-fpm didn't even receive that request (right?).
Perhaps there's anyone who did experience such issues before and may know the probable cause?
Should I provide anything that would seem relevant (config files?), please do not hesitate to ask in comments.
nginx php-fpm timeout hangs
I'm experiencing a weird issue with nginx + PHP-FPM hosted web app build with Symfony2. Basically, from time to time, there's a request that is not handled, instead the browser shows that it's waiting to start receiving (the wheel in chrome is spinning counter-clockwise).
I have nothing in error logs there that would help me identify the issue, neither in app log itself (Symfony 2.8), nginx nor php-fpm logs.
What is weird is there's no timeout at all, which would suggest php-fpm didn't even receive that request (right?).
Perhaps there's anyone who did experience such issues before and may know the probable cause?
Should I provide anything that would seem relevant (config files?), please do not hesitate to ask in comments.
nginx php-fpm timeout hangs
nginx php-fpm timeout hangs
asked Feb 21 '17 at 16:17
user401676user401676
162
162
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
I have the same issue. What I found is that if the process doesn't complete, then there are no log entries. So the request comes into nginx and is relayed to the upstream, php-fpm. php-fpm doesn't respond and nginx times out the upstream. php-fpm continues operating. So what I see processes building up over time stuck in flock() call. Looking at the stack, I found this was due to trying to obtain a file lock on a debug file. I suggest you check php-fpm's open files to see if anything is hung or running, lsof |grep php-fpm
. Then use strace
or gdb
to debug the issue further.
In my case, I was calling file_put_contents with an exclusive lock, which, for whatever reason, PHP isn't able to get sometimes and just hangs, forever.
Backtrace
0 0x00007f03f7081a67 in flock () from target:/usr/lib/libc.so.6
1 0x000055db7b9ecae6 in ?? ()
2 0x000055db7b9e83ad in _php_stream_set_option ()
3 0x000055db7b93e78e in ?? ()
4 0x000055db7badf0a3 in execute_ex ()
5 0x000055db7bae6fad in zend_execute ()
6 0x000055db7ba34c65 in zend_execute_scripts ()
7 0x000055db7b9cfb89 in php_execute_script ()
8 0x000055db7b7a1543 in ?? ()
9 0x00007f03f6fbaf4a in __libc_start_main () from target:/usr/lib/libc.so.6
10 0x000055db7b7a230a in _start ()
add a comment |
Well NGINX its great, although it doesn't work out-of-the-box properly. You need some tuning. what have you done so far?
Look at this simple guide. There are many other parameters than those described here: https://www.nginx.com/blog/tuning-nginx/
The Backlog Queue
Worker Processes
Keepalive Connections
HTTP2
And much more... In my case i once had a problem like this and i solved by increasing my queue limit (Backlog Queue)
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f833968%2fnginx-php-fpm-7-0-hangs-on-some-requests%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
I have the same issue. What I found is that if the process doesn't complete, then there are no log entries. So the request comes into nginx and is relayed to the upstream, php-fpm. php-fpm doesn't respond and nginx times out the upstream. php-fpm continues operating. So what I see processes building up over time stuck in flock() call. Looking at the stack, I found this was due to trying to obtain a file lock on a debug file. I suggest you check php-fpm's open files to see if anything is hung or running, lsof |grep php-fpm
. Then use strace
or gdb
to debug the issue further.
In my case, I was calling file_put_contents with an exclusive lock, which, for whatever reason, PHP isn't able to get sometimes and just hangs, forever.
Backtrace
0 0x00007f03f7081a67 in flock () from target:/usr/lib/libc.so.6
1 0x000055db7b9ecae6 in ?? ()
2 0x000055db7b9e83ad in _php_stream_set_option ()
3 0x000055db7b93e78e in ?? ()
4 0x000055db7badf0a3 in execute_ex ()
5 0x000055db7bae6fad in zend_execute ()
6 0x000055db7ba34c65 in zend_execute_scripts ()
7 0x000055db7b9cfb89 in php_execute_script ()
8 0x000055db7b7a1543 in ?? ()
9 0x00007f03f6fbaf4a in __libc_start_main () from target:/usr/lib/libc.so.6
10 0x000055db7b7a230a in _start ()
add a comment |
I have the same issue. What I found is that if the process doesn't complete, then there are no log entries. So the request comes into nginx and is relayed to the upstream, php-fpm. php-fpm doesn't respond and nginx times out the upstream. php-fpm continues operating. So what I see processes building up over time stuck in flock() call. Looking at the stack, I found this was due to trying to obtain a file lock on a debug file. I suggest you check php-fpm's open files to see if anything is hung or running, lsof |grep php-fpm
. Then use strace
or gdb
to debug the issue further.
In my case, I was calling file_put_contents with an exclusive lock, which, for whatever reason, PHP isn't able to get sometimes and just hangs, forever.
Backtrace
0 0x00007f03f7081a67 in flock () from target:/usr/lib/libc.so.6
1 0x000055db7b9ecae6 in ?? ()
2 0x000055db7b9e83ad in _php_stream_set_option ()
3 0x000055db7b93e78e in ?? ()
4 0x000055db7badf0a3 in execute_ex ()
5 0x000055db7bae6fad in zend_execute ()
6 0x000055db7ba34c65 in zend_execute_scripts ()
7 0x000055db7b9cfb89 in php_execute_script ()
8 0x000055db7b7a1543 in ?? ()
9 0x00007f03f6fbaf4a in __libc_start_main () from target:/usr/lib/libc.so.6
10 0x000055db7b7a230a in _start ()
add a comment |
I have the same issue. What I found is that if the process doesn't complete, then there are no log entries. So the request comes into nginx and is relayed to the upstream, php-fpm. php-fpm doesn't respond and nginx times out the upstream. php-fpm continues operating. So what I see processes building up over time stuck in flock() call. Looking at the stack, I found this was due to trying to obtain a file lock on a debug file. I suggest you check php-fpm's open files to see if anything is hung or running, lsof |grep php-fpm
. Then use strace
or gdb
to debug the issue further.
In my case, I was calling file_put_contents with an exclusive lock, which, for whatever reason, PHP isn't able to get sometimes and just hangs, forever.
Backtrace
0 0x00007f03f7081a67 in flock () from target:/usr/lib/libc.so.6
1 0x000055db7b9ecae6 in ?? ()
2 0x000055db7b9e83ad in _php_stream_set_option ()
3 0x000055db7b93e78e in ?? ()
4 0x000055db7badf0a3 in execute_ex ()
5 0x000055db7bae6fad in zend_execute ()
6 0x000055db7ba34c65 in zend_execute_scripts ()
7 0x000055db7b9cfb89 in php_execute_script ()
8 0x000055db7b7a1543 in ?? ()
9 0x00007f03f6fbaf4a in __libc_start_main () from target:/usr/lib/libc.so.6
10 0x000055db7b7a230a in _start ()
I have the same issue. What I found is that if the process doesn't complete, then there are no log entries. So the request comes into nginx and is relayed to the upstream, php-fpm. php-fpm doesn't respond and nginx times out the upstream. php-fpm continues operating. So what I see processes building up over time stuck in flock() call. Looking at the stack, I found this was due to trying to obtain a file lock on a debug file. I suggest you check php-fpm's open files to see if anything is hung or running, lsof |grep php-fpm
. Then use strace
or gdb
to debug the issue further.
In my case, I was calling file_put_contents with an exclusive lock, which, for whatever reason, PHP isn't able to get sometimes and just hangs, forever.
Backtrace
0 0x00007f03f7081a67 in flock () from target:/usr/lib/libc.so.6
1 0x000055db7b9ecae6 in ?? ()
2 0x000055db7b9e83ad in _php_stream_set_option ()
3 0x000055db7b93e78e in ?? ()
4 0x000055db7badf0a3 in execute_ex ()
5 0x000055db7bae6fad in zend_execute ()
6 0x000055db7ba34c65 in zend_execute_scripts ()
7 0x000055db7b9cfb89 in php_execute_script ()
8 0x000055db7b7a1543 in ?? ()
9 0x00007f03f6fbaf4a in __libc_start_main () from target:/usr/lib/libc.so.6
10 0x000055db7b7a230a in _start ()
edited Jun 14 '18 at 13:11
answered Jun 14 '18 at 13:01
Derek LabianDerek Labian
112
112
add a comment |
add a comment |
Well NGINX its great, although it doesn't work out-of-the-box properly. You need some tuning. what have you done so far?
Look at this simple guide. There are many other parameters than those described here: https://www.nginx.com/blog/tuning-nginx/
The Backlog Queue
Worker Processes
Keepalive Connections
HTTP2
And much more... In my case i once had a problem like this and i solved by increasing my queue limit (Backlog Queue)
add a comment |
Well NGINX its great, although it doesn't work out-of-the-box properly. You need some tuning. what have you done so far?
Look at this simple guide. There are many other parameters than those described here: https://www.nginx.com/blog/tuning-nginx/
The Backlog Queue
Worker Processes
Keepalive Connections
HTTP2
And much more... In my case i once had a problem like this and i solved by increasing my queue limit (Backlog Queue)
add a comment |
Well NGINX its great, although it doesn't work out-of-the-box properly. You need some tuning. what have you done so far?
Look at this simple guide. There are many other parameters than those described here: https://www.nginx.com/blog/tuning-nginx/
The Backlog Queue
Worker Processes
Keepalive Connections
HTTP2
And much more... In my case i once had a problem like this and i solved by increasing my queue limit (Backlog Queue)
Well NGINX its great, although it doesn't work out-of-the-box properly. You need some tuning. what have you done so far?
Look at this simple guide. There are many other parameters than those described here: https://www.nginx.com/blog/tuning-nginx/
The Backlog Queue
Worker Processes
Keepalive Connections
HTTP2
And much more... In my case i once had a problem like this and i solved by increasing my queue limit (Backlog Queue)
answered Jun 14 '18 at 14:16
lucasmxlucasmx
3921212
3921212
add a comment |
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f833968%2fnginx-php-fpm-7-0-hangs-on-some-requests%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown