I want to increase the permitted number of open files for processes started by AWS SSM agent. I have added to /etc/security/limits.conf
:
* - nofile 65535
(I am aware that this is for all users). When I log in to the server and run ulimit -n
, I see the new limit of 65536. However, when I run an SSM RunCommand:
id && ulimit -n
I see the following in the logs:
uid=0(root) gid=0(root) groups=0(root) 1024
It would appear that amazon-ssm-agent
is not picking up the new settings. I can see that the daemon process is running as root, however.
$ ps -ef | grep ssm
root 4843 1 0 07:30 ? 00:00:00 /usr/bin/amazon-ssm-agent
How do I increase the ulimit
value?
You have to close all active sessions windows to get the new value picked up. The easiest way to achieve this would be to reboot the server. If that is not an option you can also adjust the value for the ssm-agent process by using:
prlimit --pid <pid> --<limit>=<soft>:<hard>
So something like:
prlimit --pid 4843 --nofile=65535:65535
should set the soft and hard limit for the ssm-agent process to 65535 without rebooting the server.