jrm has asked for the wisdom of the Perl Monks concerning the following question:
I have a virtual server IP that maps onto 6 possible "real" servers. The real servers have a simple html page that displays the hostname which allows me to view where the SLB has sent the http request.
I have put together a simple script using LWP::UserAgent to get the servername from the html returned.
I have this running in an endless while loop. I recreate the user-agent in each itteration of the loop but my results suggest that each new user-agent is re-using the previous user-agent's TCP connecion, consequently, the load balancer does not map me onto the next real server in the pool. If I kill and restart the script I do get mapped onto a new server (suggesting that the load balancer sees a new connection).
My question is:
How can I force LWP to initiate a new TCP connection every time I create a new useragent ?
Thanks
James
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
LWP::UserAgent - new connection for each new user-agent?
by pg (Canon) on Oct 31, 2004 at 03:13 UTC | |
|
Re: LWP::UserAgent - new connection for each new user-agent?
by Anonymous Monk on Oct 31, 2004 at 19:56 UTC |