perlmonkey76 has asked for the wisdom of the Perl Monks concerning the following question:
Here's one that has me pounding my head against a wall. I have an Apache VirtualHost that is served by two machines behind a load-balancer. I need to accurately get the load time from server A vs server B for a specific URL that resolves to the load balancer. I'm trying to find some way to make a "hostfile" that's local to the script itself without affecting name resolution for the rest of the monitoring server. There are 20,000 different ways to access the standard gethostbyname() function, but I have to find a way to short-circuit it. Thoughts? Ideas? Comments? Offers of alcohol?
Re: Short-circuiting name resolution
by Fletch (Bishop) on Nov 10, 2010 at 16:37 UTC
|
Presuming A and B can be connected to without going through the load balancer, is there some reason not to use their IP addresses rather than a name? That'd seem simplest.
Addendum: if the problem is getting the correct virtual host to reply just forge an appropriate Host: foo header along with the request. curl or LWP both should be capable of doing this.
The cake is a lie.
The cake is a lie.
The cake is a lie.
| [reply] [Watch: Dir/Any] [d/l] [select] |
|