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?
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.
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.
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.