Load testing GET call using Wrk is giving Non-2xx or 3xx responses

36 Views Asked by At

How to get the following wrk command to work. I am not sure what I am missing here

Following wrk command is getting 404 for all the responses for a simple GET call.

wrk -t12 -c400 -d6s -H 'host: sample.svc.com' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0'  http://XX.XXX.XX.XX 

Running 6s test @ http://XX.XX.XX.XX
  12 threads and 400 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   342.10ms  102.34ms   1.18s    95.59%
    Req/Sec   105.70     91.58   320.00     64.60%
  6470 requests in 6.08s, 758.20KB read
  **Non-2xx or 3xx responses: 6470**
Requests/sec:   1064.81
Transfer/sec:    124.78KB

While If I try to use curl with all the headers same. It is working

 curl -H 'host: sample.svc.com' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' -H 'User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0'  http://XX.XX.XX.XX -v

> GET / HTTP/1.1
> Host: sample.svc.com
> Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
> User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0
> 
< HTTP/1.1 200 OK
< date: Thu, 30 Nov 2023 17:19:14 GMT
< server: envoy
< last-modified: Mon, 11 Jun 2007 18:53:14 GMT
< etag: "2d-432a5e4a73a80"
< accept-ranges: bytes
< content-length: 45
< content-type: text/html
< x-envoy-upstream-service-time: 1
< vary: Accept-Encoding
< 
<html><body><h1>It works!</h1></body></html>

Thank you in advance

0

There are 0 best solutions below