Introduction
You may see Apache error with "Too many open files" and want to know what is currently set.
Procedure
Use ps to obtain the httpd process ID.
Example:
[root@cptestvm ~]# ps auxw|grep -E '^USER|httpd'
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 28843 0.0 2.4 334880 49196 ? Ss 07:22 0:00 /usr/sbin/httpd -k start
nobody 28847 0.0 2.3 333368 48080 ? S 07:22 0:00 /usr/sbin/httpd -k start
nobody 28864 0.0 2.4 336776 50208 ? S 07:22 0:00 /usr/sbin/httpd -k start
nobody 28865 0.0 2.4 336508 49272 ? S 07:22 0:00 /usr/sbin/httpd -k start
nobody 28866 0.0 2.4 336776 50144 ? S 07:22 0:00 /usr/sbin/httpd -k start
nobody 28867 0.0 2.4 336508 49272 ? S 07:22 0:00 /usr/sbin/httpd -k start
nobody 28870 0.0 2.4 336508 49272 ? S 07:22 0:00 /usr/sbin/httpd -k start
nobody 29237 0.0 2.4 336508 49288 ? S 07:25 0:00 /usr/sbin/httpd -k start
root 30169 0.0 0.0 112812 976 pts/0 S+ 07:33 0:00 grep --color=auto -E ^USER|httpd
[root@cptestvm ~]#
Next using one of those pids you can get the limit setting from the pid proc files.
For example, taking pid 28847 from the ps output above you can check with:
grep 'Max open files' /proc/28847/limits
which provides:
[root@cptestvm ~]# grep 'Max open files' /proc/28847/limits
Max open files 40000 40000 files
[root@cptestvm ~]#
and shows the limit is set to 40000.