rakyll / hey

HTTP load generator, ApacheBench (ab) replacement
Apache License 2.0
18.18k stars 1.2k forks source link

Host request-header not being passed correctly #50

Open wahmedswl opened 7 years ago

wahmedswl commented 7 years ago

Hi, i am running hey against Linkerd Service, curl works fine but requests with hey resulting in 5xx

curl -H "Host: hello" localhost:4140
Hello linkerd!
hey -H "Host: hello" -n 1000 http://localhost:4140
145 requests done.
480 requests done.
901 requests done.
All requests done.

Summary:
  Total:        1.6437 secs
  Slowest:      0.5925 secs
  Fastest:      0.0010 secs
  Average:      0.0691 secs
  Requests/sec: 608.3906

Status code distribution:
  [502] 1000 responses

Response time histogram:
  0.001 [1]     |
  0.060 [618]   |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.119 [229]   |∎∎∎∎∎∎∎∎∎∎∎∎∎∎∎
  0.178 [90]    |∎∎∎∎∎∎
  0.238 [20]    |∎
  0.297 [8]     |∎
  0.356 [23]    |∎
  0.415 [3]     |
  0.474 [4]     |
  0.533 [3]     |
  0.592 [1]     |

Latency distribution:
  10% in 0.0110 secs
  25% in 0.0230 secs
  50% in 0.0470 secs
  75% in 0.0883 secs
  90% in 0.1400 secs
  95% in 0.2103 secs
  99% in 0.3741 secs

I have posted same kind of issue on https://github.com/codesenberg/bombardier/issues/17

Any help would be appreciated. Thanks

yourchanges commented 7 years ago

hey -c 10 -n 1000 -host www.xxx.com "url"

ahmetb commented 6 years ago

I just hit this too. I think you're supposed to specify -host before the <url> argument. Otherwise it seems to be silently ignored.

SchulteMarkus commented 4 years ago

I just hit this, too. In my opinion hey -H "Host: hello" should work (besides -host).

dolanor commented 4 years ago

Hit this one too, and agree with @SchulteMarkus that the -H "Host: hello" should work. But I actually don't know why it does that.

kong62 commented 3 years ago

curl ok.

# curl -H "host: app-default.hupu.io"  http://10.36.12.104:80
Hostname: app-64bbc65f66-5kgw2
IP: 127.0.0.1
IP: 10.41.49.186
RemoteAddr: 10.36.12.103:50754
GET / HTTP/1.1
Host: app-default.hupu.io
User-Agent: curl/7.29.0
Accept: */*
Accept-Encoding: gzip
X-Forwarded-For: 10.30.21.166
X-Forwarded-Host: app-default.hupu.io
X-Forwarded-Port: 80
X-Forwarded-Proto: http
X-Forwarded-Server: pub-k8s-gw-prd-44083-ecs
X-Real-Ip: 10.30.21.166

hey -H bad.

# hey -H "host: app-default.hupu.io" -c 1 -n 1 http://10.36.12.104:80
Status code distribution:
  [404] 1 responses

hey -host ok.

# hey -host app-default.hupu.io -c 1 -n 1 http://10.36.12.104:80
Status code distribution:
  [200] 1 responses