On Mon, Jan 14, 2013 at 06:29:55PM -0800, Dennis McEntire scratched on the wall:
Check the network stack on the client and server ("netstat -a -n" works).
I'm guessing you have a whole ton of connections in the TIME_WAIT state.
If you slam through thousands of connections very quickly-- especially
between the same two IP addresses-- it is possible for the system to
simply run out of available ephemeral ports. On BSD systems, there
are only about 4000 ephemeral ports available.
The only thing you can do is: A) pool connections so you're not
opening/closing the connections so quickly B) tune the stack to
raise the number of ephemeral ports C) tune the stack to reduce the
TIME_WAIT state.
Chances are good B and C won't work unless you can make 40K ports
available, and you'll still have issues if the data set gets bigger.
-j
--
Jay A. Kreibich < J A Y @ K R E I B I.C H >
"Intelligence is like underwear: it is important that you have it,
but showing it to the wrong people has the tendency to make them
feel uncomfortable." -- Angela Johnson