Hi, what is the current way to increase the number of available open files? This is for a mariadb database server I'm trying to configure based on instructions from the database developer to increase the total number of files to 50000. I've added the following to /etc/security/limits.conf and rebooted:
root - nofile 50000
ulimit -n as root now shows: # ulimit -n 50000
Can this value also be set by using sysctl and setting fs.file-max to 50000? # sysctl -a|grep file fs.file-max = 50000 fs.file-nr = 6864 0 50000 fs.xfs.filestream_centisecs = 3000
Which is the correct way? Also, does fs.file-nr mean there are currently 6864 open files on the system?
Either way works.
Yes, file.files.nr first column is the current number in use.
Also note that systemd used to not load the limits.conf file and as such may have its own lower limits on anything started under a systemd service. I think the theory was anything started under systemd should provide any override limits, and that the low defaults were intended to limit the ability of something to overrun the system.
Note this: cat /proc/3733/limits
will show you the active limits on pid 3733 so find the pid for mariadb and its children and see what their actual limit is.
On Mon, Nov 13, 2023 at 3:50 PM Alex mysqlstudent@gmail.com wrote:
Hi, what is the current way to increase the number of available open files? This is for a mariadb database server I'm trying to configure based on instructions from the database developer to increase the total number of files to 50000. I've added the following to /etc/security/limits.conf and rebooted:
root - nofile 50000
ulimit -n as root now shows: # ulimit -n 50000
Can this value also be set by using sysctl and setting fs.file-max to 50000? # sysctl -a|grep file fs.file-max = 50000 fs.file-nr = 6864 0 50000 fs.xfs.filestream_centisecs = 3000
Which is the correct way? Also, does fs.file-nr mean there are currently 6864 open files on the system?
users mailing list -- users@lists.fedoraproject.org To unsubscribe send an email to users-leave@lists.fedoraproject.org Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue
On 11/13/23 13:48, Alex wrote:
Hi, what is the current way to increase the number of available open files? This is for a mariadb database server I'm trying to configure based on instructions from the database developer to increase the total number of files to 50000. I've added the following to /etc/security/limits.conf and rebooted:
root - nofile 50000
ulimit -n as root now shows: # ulimit -n 50000
As mentioned, this only applies to the root use while logged in, not services.
Can this value also be set by using sysctl and setting fs.file-max to 50000? # sysctl -a|grep file fs.file-max = 50000 fs.file-nr = 6864 0 50000 fs.xfs.filestream_centisecs = 3000
The default value here is: # sysctl -a | grep file fs.file-max = 9223372036854775807
I think that is the maximum for the entire system, so you probably don't want to limit that.
Checking a couple of services, I see that postgresql has Max open files 1024 524288 files and postfix has Max open files 524288 524288 files I assume that postfix has adjusted it's own soft limit as mentioned in another email.
So the answer to the question in the subject is neither. If the service doesn't adjust the limit itself, then you'll need to add an override option for the service file.
As an aside, while doing this investigation I discovered that my desktop has: fs.file-nr = 45472 0 9223372036854775807 so I'm going to do some poking around to find out what is opening so many files.