Nope, I'm not wanting to send two Host headers; that's actually the
problem.
To see what I'm getting at, compare siege's behavior here with
curl's. Consider the following:
Example 1 (without a custom Host header):
mybox:~# curl
http://webfarm3/path -v
* About to connect() to webfarm3 port 80 (#0)
* Trying 1.2.3.4... connected
* Connected to webfarm3 (1.2.3.4) port 80 (#0)
> GET /path HTTP/1.1
> User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/
1.2.3.3 libidn/1.8 libssh2/0.18
> Host: webfarm3
> Accept: */*
>
< HTTP/1.1 404 Not Found
[...]
In this instance, since I haven't specified the Host header explicitly
through the -H option, curl seeds it from the URL, just as Siege
does. However, if I do specify an explicit Host header, here's what
happens:
Example 2 (with a custom Host header):
mybox:~# curl
http://webfarm3/path -v -H "Host:
www.example.com"
* About to connect() to webfarm3 port 80 (#0)
* Trying 1.2.3.4... connected
* Connected to webfarm3 (1.2.3.4) port 80 (#0)
> GET /path HTTP/1.1
> User-Agent: curl/7.18.2 (i486-pc-linux-gnu) libcurl/7.18.2 OpenSSL/0.9.8g zlib/
1.2.3.3 libidn/1.8 libssh2/0.18
> Accept: */*
> Host:
www.example.com
>
< HTTP/1.1 200 OK
[...]
See what I mean? When you specify an explicit Host header through the
-H option, curl no longer seeds the Host header from the URL.
Instead, it uses the hostname in the URL to determine which host
should receive its HTTP request (webfarm3), and then provides a Host
header (
www.example.com) that indicates which vhost the request is
for.
Siege's behavior is different. When you specify a Host header through
the --header option, siege still seeds the Host header from the URL,
in addition to sending your custom header. This results in a request
containing two Host headers, the second of which ends up getting
ignored by Apache (even though the second one is the Host header I
actually went to the trouble of sending explicitly). What I'd like is
to be able to stop siege from sending that first, URL-seeded Host
header in the event that I've specified a custom one through the --
header option.
Thanks!
Adam
On Feb 25, 10:10 am, Remi Broemeling <
r...@broemeling.org> wrote:
> Hi Adam,
>
> What siege is doing is correct. Normally the Host header is seeded directly
> from the URL. If you want to set your own Host header without a contest
> from siege, you can do so by re-writing your URL to use the IP address of
> your load-balancer, i.e.
>
> siege --get --header="Host:
www.example.com"
http://1.2.3.4/path<
http://webfarm3/path>
>
> However, what it actually sounds like is that you want TWO Host headers --
> one that the load-balancer can deal with, and then a second one that
> provides the vhost selection on the backend server. To my knowledge this
> cannot be done.
>
> If the webservers have external addresses, you should be able to bypass the
> load-balancer completely and just do this:
>
> siege --get --header="Host:
www.example.com"
> http://<IP-ADDRESS-OF-SERVER-HERE>/path <
http://webfarm3/path>
>
>
>
>
>
>
>
> On Fri, Feb 25, 2011 at 09:03, Jensen, Adam <
Adam.Jen...@unt.edu> wrote:
> > Hello!
>
> > I'm attempting to test performance of a site we've got hosted by a farm of
> > several servers behind a load balancer. I would like to control which
> > server node is running the test, but if I just specify the public URL of the
> > site (e.g.,
http://www.example.com/path), that'll be up to the load