OK, having done more digging, this bizarre 251-255 connections per socket limit seems to be an OS X thing. (Linux people, any comments?) At least that's I've read: http://www.macgeekery.com/tips/ configuration/mac_os_x_network_tuning_guide_revisited#comment-1433

So... Do any Mac OS X gurus out there know how to increase OS X Server's (10.4.11) maximum connections per socket value? There seems to no such setting in sysctl or ulimit. Any ideas? Anyone? Anyone?

...Rene

On 11-Dec-07, at 4:55 PM, René Fournier wrote:

On 11-Dec-07, at 4:32 PM, René Fournier wrote:

Just curious what people found the limits to be with stream_socket_server(), in terms of maximum concurrent connections, packet sizes, etc. I'm am presently stress-testing a multi-client socket server and am finding I can sometimes break it with as few as 100 concurrent connections, and always break it with [precisely] 252 connections--with a variety of errors getting thrown:

        Client-side (>100 connections, sometimes):
PHP Warning: stream_socket_client(): unable to connect to tcp:// 192.168.0.41:2222 (Operation timed out) in /Tuning/client.php on line 3 PHP Notice: fwrite(): send of 68 bytes failed with errno=32 Broken pipe in /Tuning/client.php on line 14

        Server-side error ( 252+ connections, every time):
PHP Warning: stream_select(): supplied argument is not a valid stream resource in /Tuning/server.php on line 15

Interestingly, this 251 connection limit does not appear to be obviously system-related (I am running Mac OS X 10.4.11). I can run two instances of server.php and have each client.php spawn 175 connections (350 total concurrent to the machine), with no problem.

Interestingly, the above server-side error only occurs when 252 clients are connected. At 251, it's okay. At 252, it generates the above PHP Warning. (Which really is strange. Anyone have any ideas?)

If anyone is interested, I will post the sample code I'm using, in case--perish the thought--the problem is self-inflicted. :-)

...Rene


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to