When i try to perform a ping to a large number of hosts, like so
for i in `cat hosts`
`ping $i -c 2 &> /tmp/pingresult_$i` & # Note the ampersand to run in background
// do some parsing of output
the first 4 or 5 hosts will be 'pinged' but the next hosts wont be pinged until some of the currently running pings are finished. It would appear that there is a maximum number of pings that can be performed at any one time (maybe a limitation on the number of raw sockets used?).... Can anyone explain how I might increase this limitation?
Thanks in advance.
For the sake of forum completeness (someone experiencing the same problem may find this forum question in the future!) here's an update....
I've decided to just use the fping project (fping.com) to ping the sites in parallel, but do without the ability to set ttl and tos available in the simple ping utility.... (unless it is actually possible to do this with fping, but I'm yet to discover this!)