So I am trying to change my hard limit for file descriptors on Ubuntu18.04 laptop. I have tried everything but the changes have still not taken effect.
I need to run a go program which keeps throwing this error.
too many open files
So I made some changes to my
/etc/security/limits.conf file according to this blog post https://medium.com/@muhammadtriwibowo/set-permanently-ulimit-n-open-files-in-ubuntu-4d61064429a
These are the contents of
* soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard nofile 65535 root soft nproc 65535 root hard nproc 65535 root soft nofile 65535 root hard nofile 65535
And I also changed /etc/pam.d/common-session to add the line session required pam_limits.so
The I restarted my terminal and
ulimit -Hn still showed 4096 but when I did sudo su and ran the same command it gave me 65535
But since I am not running my go program inside of the su session it still doesn't work out for me, I need to change my actual hard limit to a higher value for all the users not just the super user
What am I doing wrong?