• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Number of files open for a regular server?

tkalfaoglu

Silver Pleskian
Server operating system version
AlmaLinux
Plesk version and microupdate number
Obsidian
Hi.. A server had been having over 50k open files recently. I wrote a small code that checks it and warns me if it's over 50k, so I got some emails like that.
This is the server that crashed a few times from too many open files (not crashed, but apps couldn't open new files) in the past.

I checked it, and it's currently much less:
# cat /proc/sys/fs/file-nr
25312 0 2000000

but what is the "normal" open files for a server with ~250 hostings?
Many thanks, -t
 
Rule of thumb: 90 files per domain. But it strongly depends on what is done on the server and what these domains are. By a typical ratio of 3 domains per user where 2 domains are redirects and 1 is a website.

However, this is only a typical value. Nothing speaks against setting a high number of allowed file handles, like 100,000 for your installation. You always need a lush headroom, because you never know in advance what users will be up to.
 
Many thanks Peter, in that case my 22k files is correct. No idea why it went up to 50k some time in the night. Maybe the backup processes or something.. Regards, -turgut
 
Maybe the backup processes or something..
Might be. The files are just opened and closed sequentially during the backup, but if your users have lots of databases and tables, the sql server will try to keep them open, and those can be several thousand, depending on how you tuned mysqld.
 
Does anyone have a recommended limits.conf file they could share? I think I made mine too generous, and one runaway process can take the server down..
Thanks!
-t
 
Back
Top