PHP-FPM - performance tuning and CPU usageTuning Apache memory usageFPM active processes constantly...

Why can't the Brexit deadlock in the UK parliament be solved with a plurality vote?

What is this high flying aircraft over Pennsylvania?

How were servants to the Kaiser of Imperial Germany treated and where may I find more information on them

What (the heck) is a Super Worm Equinox Moon?

Why does the Persian emissary display a string of crowned skulls?

Air travel with refrigerated insulin

Does the Crossbow Expert feat's extra crossbow attack work with the reaction attack from a Hunter ranger's Giant Killer feature?

If Captain Marvel (MCU) were to have a child with a human male, would the child be human or Kree?

Would this string work as string?

Language involving irrational number is not a CFL

Echo with obfuscation

Can you identify this lizard-like creature I observed in the UK?

In One Punch Man, is King actually weak?

Telemetry for feature health

What is the smallest number n> 5 so that 5 ^ n ends with "3125"?

How do I Interface a PS/2 Keyboard without Modern Techniques?

Pre-Employment Background Check With Consent For Future Checks

How can I, as DM, avoid the Conga Line of Death occurring when implementing some form of flanking rule?

Giving feedback to someone without sounding prejudiced

Has the laser at Magurele, Romania reached a tenth of the Sun's power?

Should I assume I have passed probation?

Ways of geometrical multiplication

What's the name of the logical fallacy where a debater extends a statement far beyond the original statement to make it true?

Difference between shutdown options



PHP-FPM - performance tuning and CPU usage


Tuning Apache memory usageFPM active processes constantly growsnginx+php-fpm help optimize configsPHP-FPM and APC for shared hosting?PHP-FPM using 40% CPU for a Single RequestHigh Performance AWS EC2 / RDS + Nginx + PHP-FPM setupOdd performance fluctation with php-fpm and nginxHow can I monitor resource usage for PHP sites on a per-virtual-host basis on GNU/Linux?Limit the total memory usage of PHP-FPMPHP-FPM child processes are created and not going away













0















I have a web application written in Laravel / PHP that is in the early stages and generally serves about 500 - 600 reqs/min. We use Maria DB and Redis for caching and everything is on AWS.



For events we want to promote on our platform, we send out a push notification (mobile platform) to all users which results in a roughly 2-min long traffic burst that takes us to 3.5k reqs/min



At our current server scale, this completely bogs down the application servers' CPU which usually operate at around 10% CPU. The Databases and Redis clusters seem fine during this burst.



Looking at the logs, it seems all PHP-FPM worker pool processes get occupied and begin queuing up requests from the Nginx upstream.



We currently have:




  • three m4.large servers (2 cores, 8gb RAM each)


  • dynamic PHP-FPM process management, with a max of 120 child processes (servers)on each box



My questions:



1) Should we increase the FPM pool? It seems that memory-wise, we're probably nearing our limit



2) Should we decrease the FPM pool? It seems possible that we're spinning up so many process that the CPU is getting bogged down and is unable to really complete any of them.



3) Should we simply use larger boxes with more RAM and CPU, which will allow us to add more FPM workers?



4) Is there any FPM performance tuning that we should be considering? We use Opcache, however, should we switch to static process management for FPM to cut down on the overhead of processes spinning up and down?









share







New contributor




djt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    0















    I have a web application written in Laravel / PHP that is in the early stages and generally serves about 500 - 600 reqs/min. We use Maria DB and Redis for caching and everything is on AWS.



    For events we want to promote on our platform, we send out a push notification (mobile platform) to all users which results in a roughly 2-min long traffic burst that takes us to 3.5k reqs/min



    At our current server scale, this completely bogs down the application servers' CPU which usually operate at around 10% CPU. The Databases and Redis clusters seem fine during this burst.



    Looking at the logs, it seems all PHP-FPM worker pool processes get occupied and begin queuing up requests from the Nginx upstream.



    We currently have:




    • three m4.large servers (2 cores, 8gb RAM each)


    • dynamic PHP-FPM process management, with a max of 120 child processes (servers)on each box



    My questions:



    1) Should we increase the FPM pool? It seems that memory-wise, we're probably nearing our limit



    2) Should we decrease the FPM pool? It seems possible that we're spinning up so many process that the CPU is getting bogged down and is unable to really complete any of them.



    3) Should we simply use larger boxes with more RAM and CPU, which will allow us to add more FPM workers?



    4) Is there any FPM performance tuning that we should be considering? We use Opcache, however, should we switch to static process management for FPM to cut down on the overhead of processes spinning up and down?









    share







    New contributor




    djt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      0












      0








      0








      I have a web application written in Laravel / PHP that is in the early stages and generally serves about 500 - 600 reqs/min. We use Maria DB and Redis for caching and everything is on AWS.



      For events we want to promote on our platform, we send out a push notification (mobile platform) to all users which results in a roughly 2-min long traffic burst that takes us to 3.5k reqs/min



      At our current server scale, this completely bogs down the application servers' CPU which usually operate at around 10% CPU. The Databases and Redis clusters seem fine during this burst.



      Looking at the logs, it seems all PHP-FPM worker pool processes get occupied and begin queuing up requests from the Nginx upstream.



      We currently have:




      • three m4.large servers (2 cores, 8gb RAM each)


      • dynamic PHP-FPM process management, with a max of 120 child processes (servers)on each box



      My questions:



      1) Should we increase the FPM pool? It seems that memory-wise, we're probably nearing our limit



      2) Should we decrease the FPM pool? It seems possible that we're spinning up so many process that the CPU is getting bogged down and is unable to really complete any of them.



      3) Should we simply use larger boxes with more RAM and CPU, which will allow us to add more FPM workers?



      4) Is there any FPM performance tuning that we should be considering? We use Opcache, however, should we switch to static process management for FPM to cut down on the overhead of processes spinning up and down?









      share







      New contributor




      djt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      I have a web application written in Laravel / PHP that is in the early stages and generally serves about 500 - 600 reqs/min. We use Maria DB and Redis for caching and everything is on AWS.



      For events we want to promote on our platform, we send out a push notification (mobile platform) to all users which results in a roughly 2-min long traffic burst that takes us to 3.5k reqs/min



      At our current server scale, this completely bogs down the application servers' CPU which usually operate at around 10% CPU. The Databases and Redis clusters seem fine during this burst.



      Looking at the logs, it seems all PHP-FPM worker pool processes get occupied and begin queuing up requests from the Nginx upstream.



      We currently have:




      • three m4.large servers (2 cores, 8gb RAM each)


      • dynamic PHP-FPM process management, with a max of 120 child processes (servers)on each box



      My questions:



      1) Should we increase the FPM pool? It seems that memory-wise, we're probably nearing our limit



      2) Should we decrease the FPM pool? It seems possible that we're spinning up so many process that the CPU is getting bogged down and is unable to really complete any of them.



      3) Should we simply use larger boxes with more RAM and CPU, which will allow us to add more FPM workers?



      4) Is there any FPM performance tuning that we should be considering? We use Opcache, however, should we switch to static process management for FPM to cut down on the overhead of processes spinning up and down?







      php amazon-web-services performance





      share







      New contributor




      djt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share







      New contributor




      djt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share



      share






      New contributor




      djt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 mins ago









      djtdjt

      101




      101




      New contributor




      djt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      djt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      djt is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          0






          active

          oldest

          votes











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


          }
          });






          djt is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f959237%2fphp-fpm-performance-tuning-and-cpu-usage%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          djt is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded


















          djt is a new contributor. Be nice, and check out our Code of Conduct.













          djt is a new contributor. Be nice, and check out our Code of Conduct.












          djt is a new contributor. Be nice, and check out our Code of Conduct.
















          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%2f959237%2fphp-fpm-performance-tuning-and-cpu-usage%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

          As a Security Precaution, the user account has been locked The Next CEO of Stack OverflowMS...

          Список ссавців Італії Природоохоронні статуси | Список |...

          Українські прізвища Зміст Історичні відомості |...