Jump to content

Regular internal server errors


Recommended Posts

I've been getting internal server errors for the last few months whenever the site gets busy normally. The server isn't overloaded but this is the error in logs

2023/01/10 21:20:49 [alert] 127868#127868: *28491671 socket() failed (24: Too many open files) while connecting to upstream

My hosts don't seem to know and have increased the open files limit to a high amount but it still happening and now just pointing me in your direction to ask how you handle traffic as I've got 167 children spawning which may be causing too many open files? But this was happening at 1am in the morning when the site wasn't busy. Any ideas?

Could contain: Text, City

Link to comment
Share on other sites

This looks to be an issue with your php_fpm config. Those variables it’s complaining about is where I would start my analysis. 

By the way if it’s always happening at 1am, my guess is you have some sort of bot aggressively crawling your site at that time or the host is also doing backups or something similar. 

Link to comment
Share on other sites

Cloudflare will use persistent connections.  Meaning it will open a connection and keep using the same one for multiple requests.  As a result, if your server is having issues with that, disabling CF MIGHT help.  

But...  what I am telling you though is based on the output of what you pasted...  your PHP-FPM settings may simply need updated.  Increase the pm.start_servers value in your PHP-FPM config file.  Then restart PHP-FPM.  

Your host should be able to do this.  

Edited by Randy Calvert
Link to comment
Share on other sites

24 minutes ago, Randy Calvert said:

But...  what I am telling you though is based on the output of what you pasted...  your PHP-FPM settings may simply need updated.  Increase the pm.start_servers value in your PHP-FPM config file.  Then restart PHP-FPM.  

Your host should be able to do this.  

What would you recommend increasing them to? This is what they are at the moment

Could contain: Page, Text, Plot, Chart

Edited by marklcfc
Link to comment
Share on other sites

It's weird they're not labeling it with the actual pm.start_server name.  I would start by increasing the start servers to 10, the min_spare to 10 and max_spare to 20.   It's hard to say what your server can support in terms of memory etc, what else is already running, etc.  But that should at least reduce the impact some.  

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...