• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question Too many open files..

tkalfaoglu

Silver Pleskian
Server operating system version
Alma Linux 8.8
Plesk version and microupdate number
Obsidian
I wrote a little chron thing that warns me when there are too many open files (which can be fatal on the server)..
I got a warning at 4 AM..

The open files number comes from /proc/sys/fs/file-nr, the 42 thousand..

Apparently my script that lists the open files doesn't work as well as I hoped -- it's missing lots of things as it only found ~15K files.

Anyway, what could be the cause of too many open files?

Many thanks,
-t


It says:

3 Jun 2023 04:05:02 current open files at 42016

108 (sd-pam)
130 /usr/libexec/postfix/master
142 smtpd
202 dovecot/imap-login
240 /opt/plesk/php/8.0/bin/php-cgi
244 /usr/sbin/dovecot
252 Passenger
267 dovecot/imap
267 dovecot/imap
386 php-fpm:
408 /opt/plesk/php/7.4/bin/php-cgi
423 /usr/lib/systemd/systemd
1983 /usr/libexec/mysqld
3217 /usr/sbin/httpd
4856 nginx:
TOTAL: 14968
 
I'd need to see your script to get a better idea of why the output is different. Open files can change very quickly, so the script may be a millisecond too late and get fewer files than the alert got.

For example, this will tell you how many open files each process is using, but it will take a while to run, so the actual number will be different by the time it finishes:
Code:
lsof | awk '{ print $1 " " $2; }' | sort -rn | uniq -c | sort -rn | head -15
/proc/sys/fs/file-nr shows allocated file handles, not open files. These indicate whether a process has active connections to a file. A single process can assign multiple handles to the same file, so there can be multiple handles for a single file. This could be the reason for the 15K to 42K difference.
 
Back
Top