Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Problem increasing max file descriptors for PHP

I have a working socket server in PHP that I wish to improve (allow for more socket connections). I am running into a limit I can't crack, related to the max number of incoming socket connections. Using Macports for package management... I've recompiled PHP with the --enable-fd-setsize=2048 in the port file) … but I still get the following PHP warning once my socket server tries to accept more than 1024 clients (800, 900 are okay):


PHP Warning: socket_select(): You MUST recompile PHP with a larger value of FD_SETSIZE.

It is set to 2048, but you have descriptors numbered at least as high as 1027.

--enable-fd-setsize=2048 is recommended, but you may want to set it

to equal the maximum number of open files supported by your system,


Weird right? Shows I have it set in PHP, so maybe it's a resource limit? But having changed sysctl.conf, ulimit -a shows:


core file size (blocks, -c) 0

data seg size (kbytes, -d) unlimited

file size (blocks, -f) unlimited

max locked memory (kbytes, -l) unlimited

max memory size (kbytes, -m) unlimited

open files (-n) 2048

pipe size (512 bytes, -p) 1

stack size (kbytes, -s) 8192

cpu time (seconds, -t) unlimited

max user processes (-u) 709

virtual memory (kbytes, -v) unlimited


So I should be able to have up to 2048 files (sockets) open, but PHP still complains. What am I missing? Any ideas what I should try next?


...Rene

Mac mini, Mac OS X (10.7.2), Core i7 (quad) 16GB, 2x256GB SSDs

Posted on Nov 7, 2011 11:41 AM

Reply

There are no replies.

Problem increasing max file descriptors for PHP

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.