A small number of dropped packets shouldn't be a problem, but if you are having spikes where very many packets are being dropped - the majority, say - this will kill the performance of your TCP connection, possibly to the point where it's indistinguishable from "not working at all."
If you want to debug the TCP side of it I suggest using tcpdump or maybe ethereal to see what happens during the connection. You will need to understand the TCP protocol in some detail (but this is WORTH knowing!) and you might have to collect gigs and gigs of capture log before you actually see the fault occur - but it should be revealing.
On the other hand, if you're fairly certain that the problem you're seeing corresponds with major spikes of packet loss, there's not much point spending a lot of effort to confirm something that you already know - the network is broken and that's hurting your script.
This really isn't a Perl issue any more; but you should not be seeing packet loss in a typical GigE LAN environment. Something is probably wrong. Maybe your host can't actually keep up with the network traffic (if you're using a 486 machine, I'd start with that!). Maybe the cabling isn't up to CAT6 spec; maybe the switch fabric is overloaded; maybe someone has an industrial compressor on the same circuit as your switch (this has happened to me). Maybe your routing is seriously screwed up and all your supposed LAN traffic is going over and back on a 64K satellite link to Helsinki (this has also happened to me!).
But I'd certainly try to pin down the cause of that packet loss. |