HttpListener::acceptConnection(): Accept failed:Too many open files in system!

After a few months of server activity on which I installed Cyberpanel, this morning I found the hard disk saturated. I investigated and found that the /usr/local/lsws/logs path contained hundreds of error.log and access.log files, which filled the disk space.

Before I deleted the logs I downloaded them, and the error.log files always have the same error:

2020-09-15 23:12:44.947967 [ERROR] [:443] HttpListener::acceptConnection(): Accept failed:Too many open files in system!
2020-09-15 23:12:44.947971 [ERROR] [
:443] HttpListener::acceptConnection(): Accept failed:Too many open files in system!
2020-09-15 23:12:44.947975 [ERROR] [:443] HttpListener::acceptConnection(): Accept failed:Too many open files in system!
2020-09-15 23:12:44.947979 [ERROR] [
:443] HttpListener::acceptConnection(): Accept failed:Too many open files in system!
2020-09-15 23:12:44.947982 [ERROR] [:443] HttpListener::acceptConnection(): Accept failed:Too many open files in system!
2020-09-15 23:12:44.947986 [ERROR] [
:443] HttpListener::acceptConnection(): Accept failed:Too many open files in system!

What happens and why does it happen?

Hi Fliva!
I’m sure a more experienced cyp user will be here to assist shortly, but from what i understand it looks like the user which OLS runs as may have exhausted its “open files limit”.
On Centos; OLS runs as root and you can probably check and change these limits by following a simple article like this Increase "Open Files Limit". Solution for "Too many open files (24)"

Your procedure might change depending on your distribution. Feel free to reach out if you have any more questions or need some help getting your server back up.

We have seen cyp host hundreds of WP websites on a single OLS instance and not run into this particular issue, but I can’t say for sure what your limit is or why OLS is trying to potentially open more files than the FS in userland supports by default… As i mentioned at the beginning of the reply, i’m sure that a more experienced cyp admin will be here to help out soon.

Respectfully,
@aitp/nadmin

Actually, here’s a much more relevant article describing a similar symptom and resolution :

As it happens to me, I guess it happens to others, with servers under pressure. Why is this tuning not done automatically by Cyberpanel during installation?

I know this is some old topic but I got the exact same problem. Server is at 51% HDD full size. No errors but suddenly within minutes/seconds it goes to 100% just with error logs with errors like the topic starter.

This is almost 40GB in error logs. Doing a rm -rf /usr/local/lsws/logs/* removes the logs and goes back to 51% disksize.

I monitored this for weeks but every time the server fails the logs are completely writing 40gb in error with errors. This can’t be normal and just fixed with increasing limits right? Must be some underlying issue?

PS: limits somehow where already set on 1000000 so the manual/solution above was not the solution

Anyone? My client is haunting me about this because it comes back once a week. I check it every day but somehow my client is always faster in detecting this