Max number of sockets for PHP stream_socket_client

I need to check hundreds of urls and use stream_socket_client to create sockets for each one and then stream_select to get them and estimate their response times, etc.

However, after 237 creation of sockets, I cannot create more sockets, no error code or message indicating the problem occurs before "connect". I tried running this on different servers and I get the same result, so there might be no throttling on their side.

Is there a maximum number of sockets that can be open at any time or what is going on here?

+2


source to share


1 answer


This is the local limit of the open file. Check the output ulimit -n

if you are on Unix. Factor in standard files like stdin / out / err and any files opened by the PHP interpreter.



+1


source







All Articles