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;








2















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.










share|improve this question




























    2















    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.










    share|improve this question
























      2












      2








      2


      1






      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.










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 21 '17 at 16:17









      user401676user401676

      162




      162




















          2 Answers
          2






          active

          oldest

          votes


















          1














          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 ()






          share|improve this answer
































            0














            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)






            share|improve this answer























              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
              );



              );













              draft saved

              draft discarded


















              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









              1














              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 ()






              share|improve this answer





























                1














                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 ()






                share|improve this answer



























                  1












                  1








                  1







                  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 ()






                  share|improve this answer















                  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 ()







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Jun 14 '18 at 13:11

























                  answered Jun 14 '18 at 13:01









                  Derek LabianDerek Labian

                  112




                  112























                      0














                      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)






                      share|improve this answer



























                        0














                        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)






                        share|improve this answer

























                          0












                          0








                          0







                          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)






                          share|improve this answer













                          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)







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Jun 14 '18 at 14:16









                          lucasmxlucasmx

                          3921212




                          3921212



























                              draft saved

                              draft discarded
















































                              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.




                              draft saved


                              draft discarded














                              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





















































                              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







                              Popular posts from this blog

                              Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                              Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                              What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company