Too many open files

php-fpmsmfsolaris

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?

Best Answer

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.