This is on an Ubuntu 12.04.3 LTS server.
I've added the following to /etc/security/limits.conf (my Golang processes run as root):
* hard nofile 50000
* soft nofile 50000
root hard nofile 50000
root soft nofile 50000
I've added the following to /etc/pam.d/common-session
session required pam_limits.so
I've added the following to /etc/sysctl.conf:
fs.file-max = 50000
Yet when I cat /proc/{PID}/limits, I get:
Limit Soft Limit Hard Limit Units
Max open files 1024 4096 files
This happens only when I start the process from Upstart via sudo initctl start service_name. If I start the process myself, it acknowledges my settings.
How do I fix this?