Jump to content

Recommended Posts

Posted

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

Posted

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. 

Posted

Unfortunately without more information, there isnt really anything to point to software being an issue there. Only your hosting company would be able to assist with this

Posted

I'm not sure what more information to provide, all I know is the too many open files erro didn't seem to happen before I set up Cloudflare. I don't know if its related or not.

Posted
17 minutes ago, marklcfc said:

I'm not sure what more information to provide, all I know is the too many open files erro didn't seem to happen before I set up Cloudflare. I don't know if its related or not.

There would certainly be one way to test that. Remove cloudflare again

Posted (edited)

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
Posted (edited)
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
Posted
1 minute ago, marklcfc said:

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

Could contain: Page, Text, Plot, Chart

I would recommend working with your hosting provider on any server configuration change.

Posted

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.  

  • Recently Browsing   0 members

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