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

                              Club Baloncesto Breogán Índice Historia | Pavillón | Nome | O Breogán na cultura popular | Xogadores | Adestradores | Presidentes | Palmarés | Historial | Líderes | Notas | Véxase tamén | Menú de navegacióncbbreogan.galCadroGuía oficial da ACB 2009-10, páxina 201Guía oficial ACB 1992, páxina 183. Editorial DB.É de 6.500 espectadores sentados axeitándose á última normativa"Estudiantes Junior, entre as mellores canteiras"o orixinalHemeroteca El Mundo Deportivo, 16 setembro de 1970, páxina 12Historia do BreogánAlfredo Pérez, o último canoneiroHistoria C.B. BreogánHemeroteca de El Mundo DeportivoJimmy Wright, norteamericano do Breogán deixará Lugo por ameazas de morteResultados de Breogán en 1986-87Resultados de Breogán en 1990-91Ficha de Velimir Perasović en acb.comResultados de Breogán en 1994-95Breogán arrasa al Barça. "El Mundo Deportivo", 27 de setembro de 1999, páxina 58CB Breogán - FC BarcelonaA FEB invita a participar nunha nova Liga EuropeaCharlie Bell na prensa estatalMáximos anotadores 2005Tempada 2005-06 : Tódolos Xogadores da Xornada""Non quero pensar nunha man negra, mais pregúntome que está a pasar""o orixinalRaúl López, orgulloso dos xogadores, presume da boa saúde económica do BreogánJulio González confirma que cesa como presidente del BreogánHomenaxe a Lisardo GómezA tempada do rexurdimento celesteEntrevista a Lisardo GómezEl COB dinamita el Pazo para forzar el quinto (69-73)Cafés Candelas, patrocinador del CB Breogán"Suso Lázare, novo presidente do Breogán"o orixinalCafés Candelas Breogán firma el mayor triunfo de la historiaEl Breogán realizará 17 homenajes por su cincuenta aniversario"O Breogán honra ao seu fundador e primeiro presidente"o orixinalMiguel Giao recibiu a homenaxe do PazoHomenaxe aos primeiros gladiadores celestesO home que nos amosa como ver o Breo co corazónTita Franco será homenaxeada polos #50anosdeBreoJulio Vila recibirá unha homenaxe in memoriam polos #50anosdeBreo"O Breogán homenaxeará aos seus aboados máis veteráns"Pechada ovación a «Capi» Sanmartín e Ricardo «Corazón de González»Homenaxe por décadas de informaciónPaco García volve ao Pazo con motivo do 50 aniversario"Resultados y clasificaciones""O Cafés Candelas Breogán, campión da Copa Princesa""O Cafés Candelas Breogán, equipo ACB"C.B. Breogán"Proxecto social"o orixinal"Centros asociados"o orixinalFicha en imdb.comMario Camus trata la recuperación del amor en 'La vieja música', su última película"Páxina web oficial""Club Baloncesto Breogán""C. B. Breogán S.A.D."eehttp://www.fegaba.com

                              Vilaño, A Laracha Índice Patrimonio | Lugares e parroquias | Véxase tamén | Menú de navegación43°14′52″N 8°36′03″O / 43.24775, -8.60070

                              Cegueira Índice Epidemioloxía | Deficiencia visual | Tipos de cegueira | Principais causas de cegueira | Tratamento | Técnicas de adaptación e axudas | Vida dos cegos | Primeiros auxilios | Crenzas respecto das persoas cegas | Crenzas das persoas cegas | O neno deficiente visual | Aspectos psicolóxicos da cegueira | Notas | Véxase tamén | Menú de navegación54.054.154.436928256blindnessDicionario da Real Academia GalegaPortal das Palabras"International Standards: Visual Standards — Aspects and Ranges of Vision Loss with Emphasis on Population Surveys.""Visual impairment and blindness""Presentan un plan para previr a cegueira"o orixinalACCDV Associació Catalana de Cecs i Disminuïts Visuals - PMFTrachoma"Effect of gene therapy on visual function in Leber's congenital amaurosis"1844137110.1056/NEJMoa0802268Cans guía - os mellores amigos dos cegosArquivadoEscola de cans guía para cegos en Mortágua, PortugalArquivado"Tecnología para ciegos y deficientes visuales. Recopilación de recursos gratuitos en la Red""Colorino""‘COL.diesis’, escuchar los sonidos del color""COL.diesis: Transforming Colour into Melody and Implementing the Result in a Colour Sensor Device"o orixinal"Sistema de desarrollo de sinestesia color-sonido para invidentes utilizando un protocolo de audio""Enseñanza táctil - geometría y color. Juegos didácticos para niños ciegos y videntes""Sistema Constanz"L'ocupació laboral dels cecs a l'Estat espanyol està pràcticament equiparada a la de les persones amb visió, entrevista amb Pedro ZuritaONCE (Organización Nacional de Cegos de España)Prevención da cegueiraDescrición de deficiencias visuais (Disc@pnet)Braillín, un boneco atractivo para calquera neno, con ou sen discapacidade, que permite familiarizarse co sistema de escritura e lectura brailleAxudas Técnicas36838ID00897494007150-90057129528256DOID:1432HP:0000618D001766C10.597.751.941.162C97109C0155020