tags:

views:

88

answers:

1

I need to check hundreds of URLs and use stream_socket_client to create sockets for each one and then stream_select to retrieve them and assess their response times etc...

However, after 237 created sockets I fail to create anymore sockets there is no error code or message indicating that the problem occur before "connect". I've tried running this against different servers and I get the same result so probably no throttling on their side.

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

A: 

This is your local open file limit. Check the output of ulimit -n if you are on Unix. Factor in standard files like stdin/out/err and any files opened by PHP interpreter.

Nikolai N Fetissov
Thanks! It was set to 256 so makes perfect sense.I solved it by launching groups of 100 sockets at a time instead. It will be gentler for the receiver as well ;).
Fredde