2

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?

3 Answers 3

1

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.

2
  • 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, 2011 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, 2011 at 9:33
0

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.

0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .