Why is My Webserver Hanging?!? (Spoiler: It was PHP-FPM)

Поделиться
HTML-код
  • Опубликовано: 3 окт 2024
  • My webserver randomly hangs, kicking my websites offline. After some investigating, it turned out to be PHP-FPM, and its default settings. With multiple PHP websites, the 5 default children get used up quickly!
    This video shows how to calculate the best number of child processes for your webserver, along with how to make the change on your system. I used the calculator tool found here: https//spot13.com/pmcalculator
    If you'd like to see more videos about my favorite webserver (Caddyserver), let me know in the comments!
    NOTE: I know this video wasn't actually about my webserver at all... but the question still stands, lol!
    If you want to be one of my Patreon supporters, head on over to / shawnp0wers for details on the benefits you could receive! Thanks again, supporters. :)
    All my stuff: shawnp0wers.com
    #linux #php #caddyserver

Комментарии • 28

  • @grillonbleu
    @grillonbleu 27 дней назад

    Very useful info for anyone running PHP-FPM, whatever the web server may be. We’re running it through Apache2 and this is setting us on the right track. Thanks!

  • @rupeshshrestha3752
    @rupeshshrestha3752 Год назад +2

    Hey great stuff we would love to see Caddyserver videos. thanks for your informative video

  • @DigitalMetal
    @DigitalMetal Год назад +3

    Thanks for this info.
    I just want to say, I'm running a few websites of my VPS from Vultr. I'm running Apache, with PHP, and MySQL, and my entire VM only has 1GB of RAM and 1GB of SWAP.
    If you have 12GB or RAM and you're having issues, I don't think the issue is needing more RAM.

    • @shawnp0wers
      @shawnp0wers  Год назад

      I think the issue is quite a few Wordpress sites getting crawled at one time.

  • @B.A.D.O.
    @B.A.D.O. 10 месяцев назад

    Thank you so much. I spent way too many hours that I am ashamed to disclose and tried all sorts of configs with magic calculations from the net. The tool you shared and the steps to calculate size and processes was just what I needed

  • @maicon1121
    @maicon1121 9 месяцев назад

    Thank you for the content! You helped me a lot with a challenge that only who maintain a big traffic website will face of, awesome. Greetings from Brazil 🤘

  • @neorejdv
    @neorejdv Год назад +2

    Hey Shawn good video love these real life examples and troubleshooting.

  • @aminuddin6452
    @aminuddin6452 15 дней назад

    tyvm. this is awesome

  • @yayow_p
    @yayow_p Год назад

    Great stuff, would love to see more caddy material perhaps setting it up from scratch?

  • @abdirahmann
    @abdirahmann Год назад

    great video as always 🙂

  • @nunochaves5223
    @nunochaves5223 Год назад

    You should use a fixed number of child processes in a production server. Killing and respawning processes has a performance hit. Should also have a max requests set to respawn to preventemory leaks

  • @CaseyCarnnia
    @CaseyCarnnia Год назад

    ++ caddy v Apache ; and thank you.
    and this spesefic video totally relates to my past 4 hours.

  • @aristuzabaru
    @aristuzabaru Год назад

    Great video! Thanks!

  • @syedanwar1872
    @syedanwar1872 8 месяцев назад

    Wow best explanation

  • @MrStefanica
    @MrStefanica 10 месяцев назад

    Brilliant ! Thanks !

  • @leeterthanyou
    @leeterthanyou Год назад

    php-fpm is a lovely thing. I once wrote a 3-page document for work detailing how you can `kill -USR2` an fpm poolrunner's PID to cause it to be like "yo shit ain't right" and reload that pool's config.

    • @shawnp0wers
      @shawnp0wers  Год назад +2

      There was more to this story... when my multiple wordpress sites got scanned, it caused a TON of processes. Upwards of 250 were required to keep things working! And in dynamic mode, they would stay active but unresponsive. I moved to "ondemand", which is less responsive (on paper), but seems to work really well with regard to scaling up and down.

    • @Pavelbrov
      @Pavelbrov Год назад

      @@shawnp0wers this comment saved me!

  • @josuaschmid501
    @josuaschmid501 Год назад

    Helpful! I ran too way to many...

  • @komismo
    @komismo 19 дней назад

    i checked my fpm conf its default to 50 child-process. Do I still need to adjust them?

  • @DomingosVarela
    @DomingosVarela 4 месяца назад

    Hi,
    thanks for sharing.
    my new settings based in aval ram;
    pm.max_children = 201
    pm.start_servers = 50
    pm.min_spare_servers = 50
    pm.max_spare_servers = 150
    pm.max_request = 2000
    After changed i have the same error, i thing the values are not set! I already restarted the php and server too.
    The message shows the old value pm.max_children setting (5)!
    WARNING: [pool librenms] server reached pm.max_children setting (5), consider raising it
    What else do I need to do?
    Thanks

  • @AhmadReshadZazai
    @AhmadReshadZazai Год назад

    Thank you.

  • @wangchukdorji3600
    @wangchukdorji3600 8 месяцев назад

    I have multiple php running should the the numbers be remain same for all the php-fpms.

  • @AvelinaEicher-d5f
    @AvelinaEicher-d5f 25 дней назад

    Harris Brian Clark Gary Miller Paul