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

In php-fpm.conf I have:

rlimit_files = 8192

My server is a 1G SmartMachine from Joyent, meaning it is a Solaris with 1GB memory.

My problem is that on high load I get errors like this:

Warning (2): touch() [function.touch]: Unable to create file app/tmp/cache/persistent/cake_core_users_da because Too many open files in [cake/libs/file.php, line 125]

Is my rlimit_files too low, and if so how high should I set it?

share|improve this question

Are you sure it's actually working? You can use "pfiles" on the process ID to see what it actually has open. You can also run "prctl" on the process ID and look for the "process.max-file-descriptor" value. There will be a basic, privileged, and system value listed. The limit on the process is the lowest of those. It could be a file descriptor leak bug in the application if it really has that many open.

share|improve this answer
No, I doesn't seem to. Here's how php-fpm start via SMF: [ Apr 23 09:14:19 Executing start method ("newtask -p php-fpm /opt/local/sbin/php-fpm -c /opt/local/etc/php.ini"). ] prctl [pid]: process: [pid]: /opt/local/sbin/php-fpm -c /opt/local/etc/php.ini NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT process.max-file-descriptor basic 8.19K - deny 8044 system 2.15G max deny - – webjay Apr 23 '11 at 9:32
# cat /etc/project | grep php php-fpm:104:PHP FastCGI Process Manager:::process.max-file-descriptor=(basic,8192,deny) – webjay Apr 23 '11 at 9:33

There's another limit on the number of open files that might be imposed by Solaris itself. For example, there's an article about getting around the limitation of 256 file descriptors in 32-bit binaries on Solaris.

Try figuring out whether your php binary is 32- or 64-bit.

share|improve this answer
up vote 0 down vote accepted

I think my problem was/is somewhere else and related to php processes staying alive. I fixed it somehow by not letting them stay alive forever.

share|improve this answer

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.