I run Debian linux (Debian 4.9.65-3+deb9u2) and Kong 1.4.0 community edition. I’m trying to understand why I’m still getting this warning below in the the /var/log/daemon.log and /var/log/syslog.log.
ulimit is currently set to "1024". For better performance set it to at least "4096" using "ulimit -n"
Here is what I set before I starting Kong. I have set the OS hard and soft limits to 65536 by setting in /etc/security/limits.conf to this below.
* hard nofile 65536
* soft nofile 65536
After these were set, I ran sysctl -p for the changes to take effect. I have verified that these are set by running ulimit -Hn and ulimit -Sn. I set the worker_rlimit_nofile 65536; in the /usr/local/kong.nginx.conf file. Every time I have restarted kong that message will show up in those two log and I’m not understanding why it would warn on this with all the limits set as explained above. Anybody have any ideas on this on why this still shows up? Did I miss a ulimit configuration?
Thank you for this info. That is what it was and that resolved that messaged showing up in /var/log/daemon.log and /var/log/system.log. This is what I did below to apply it.
Added this below to /etc/systemd/system.conf
DefaultLimitNOFILE=65536
Reloaded daemon with systemctl daemon-reload
Stopped and started Kong with the following:
service kong stop service kong start
Checked the limits of the Kong process similar to this below.
ps -ef kong root 1916 1 0 22:58 ? 00:00:00 nginx: master process /usr/local/openresty/nginx/sbin/nginx -p /usr/local/kong -c nginx.conf
cat /proc/1916/limits |grep 'open files'
It showed this below for output: Max open files 65536 65536 files
Check the log files to make sure the 1024 warning is not showing up anymore after restarting kong.
grep 1024 /var/log/syslog |grep kong grep 1024 /var/log/daemon.log |grep kong
The grep above did not show the 1024 ulimit warning anymore.
The message in the logs that sparked this thread is kind of misleading as ulimit -n won’t fix this issue when running on system running systemd.
I’m considering this issue resolved. Thank you to everybody that responded.