Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to change the file descriptor limits for Apache.

The problem is that the limits set through "/etc/security/limits.conf" don't apply to system users like "apache" with no login shell.

I've tested it with this simple PHP code:

echo "User: ";
echo exec('whoami');
echo "<br>FD Soft Limit: ";
echo exec('ulimit -Sn');
echo "<br>FD Hard Limit: ";
echo exec('ulimit -Hn');

I've also tried to modify a variable from "/usr/sbin/apachectl":

ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`"

OS: CentOS release 6.4 (Final) Apache: Apache/2.2.15

share|improve this question

Are you hitting a ceiling of 1,024 file descriptors?

In CentOS/RHEL 6, a new ceiling was introduced by way of /etc/security/limits.d/90-nproc.conf.

This file (and anything in this directory) takes precedence over /etc/security/limits.conf, as it's applied after limits.conf is initially read; and its default is 1,024.

See the history of this via Red Hat Bugzilla, Bug ID #432903.

share|improve this answer
Thanks for reply. Yes, I hit the limit bash: cannot make pipes for command substitution: Too many open files in system. I've tried to change these values in /etc/security/limits.d/90-nproc.conf. however the PHP script still show the defaults (1024/4096)? – HTF Mar 27 '13 at 11:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.