ulimit -n
command. Example:{error,emfile}
in the VerneMQ log files, you now know what to do, though: increase the OS settings as described below.sysctl
.file-max
settings is:fs.file-max
setting represents the global maximum of file handlers a Linux kernel will allocate. Make sure this is high enough for your system.file-max
, you still need to configure the per-process open files limit. You'll set the number of file descriptors a single process or application like VerneMQ is allowed to grab. As every process belongs to a user, you need to bind the setting to a Linux user (here, the vernemq
user). To do this, edit /etc/security/limits.conf
, for which you'll need superuser access. If you installed VerneMQ from a binary package, add lines for the vernemq
user, substituting your desired hard and soft limits:/etc/security/limits.conf
if you’re solely relying on init scripts.sudo
properly inherits the values from the executing user.LimitNOFILE
setting in the vernemq.service
file to the value you need. It is set to infinity
by default already, so you only need to adapt it in case you want a lower value. The reason we need to enforce the setting is that systemd doesn't automatically take over the nofile
settings from the OS.vernemq
user, may specify a higher value for maximum open files. For example, follow these steps to enable PAM user limits and set the soft and hard values for all users of the system to allow for up to 65536 open files./etc/pam.d/common-session
and append the following line:/etc/pam.d/common-session-noninteractive
exists, append the same line as above./etc/security/limits.conf
and append the following lines to the file:/etc/ssh/sshd_config
and uncomment the following line:yes
as shown here:/etc/security/limits.conf
and append the following lines tovernemq
user only by substituting the two asterisks (*) in the examples with vernemq
./etc/system
:/etc/launchd.conf
and increase the limits for both values as appropriate.1launchctl limitCopied!The response output should look something like this:1cpu unlimited unlimited2filesize unlimited unlimited3data unlimited unlimited4stack 8388608 671047685core 0 unlimited6rss unlimited unlimited7memlock unlimited unlimited8maxproc 709 10649maxfiles 10240 10240Copied!
/etc/launchd.conf
and increase the limits. Add lines that look like the following (using values appropriate to your environment):1limit maxfiles 16384 32768Copied!
1launchctl limitCopied!The response output should look something like this:1cpu unlimited unlimited2filesize unlimited unlimited3data unlimited unlimited4stack 8388608 671047685core 0 unlimited6rss unlimited unlimited7memlock unlimited unlimited8maxproc 709 10649maxfiles 16384 32768Copied!