Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Short-circuiting name resolution

by perlmonkey76 (Initiate)
on Nov 10, 2010 at 15:59 UTC ( [id://870615]=perlquestion: print w/replies, xml ) Need Help??

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?

Replies are listed 'Best First'.
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://870615]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-03-29 11:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found