|Subject:||LWP::UserAgent requests timing out early at random times|
I'm having a problem with early timeouts from the request method of LWP::UserAgent. Not sure it if matters, but the request is HTTP PUT and to a server on the local network. I'm using the default timeout of 180 seconds, though this has also happened when I explicitly set the timeout to 120 seconds. Sometimes it takes a while for the server to reply (it's doing some database queries), so it might validly take a minute to respond with its result. The problem is that sometimes (fairly frequently when the server is being slow) I'm seeing the request method return with a "500 read timeout" and "Client-Warning: Internal response" well before my requested timeout. I added code to measure and print out the elapsed time and it can be as low as less than one second all the way up to around minute. Seems pretty random how long it's actually waiting for on a given request. (Of course I would never see a timeout for a length of time longer than it takes the server to respond.) I've seen this with version 5.805 on Debian (2.6.18-3-686-bigmem #1 SMP) running perl 5.8.8 and with version 5.803 on Xubuntu (2.6.1526-386 #1 PREEMPT) running perl 5.8.7. Thanks.