Is it normal to get a very high max latency but 0 for p99,p95 etc

I have been testing with K6 recently and I have seen some output that caused me to question if it is valid

the output in full is below:

   data_received..................: 1.4 GB  394 kB/s
     data_sent......................: 570 MB  158 kB/s
     dropped_iterations.............: 84514   23.47609/s
     http_req_blocked...............: min=103ns    med=222ns    avg=143.28µs p(90)=286ns   p(95)=308ns   p(99)=368ns   max=5.16s
     http_req_connecting............: min=0s       med=0s       avg=155ns    p(90)=0s      p(95)=0s      p(99)=0s      max=10.02ms
   ✓ http_req_duration..............: min=337.42µs med=549.45µs avg=2.23ms   p(90)=1.16ms  p(95)=3.23ms  p(99)=39.2ms  max=2.49s
       { expected_response:true }...: min=337.42µs med=549.45µs avg=2.23ms   p(90)=1.16ms  p(95)=3.23ms  p(99)=39.2ms  max=2.49s
   ✓ http_req_failed................: 0.00%   ✓ 0           ✗ 7115487
     http_req_receiving.............: min=6.7µs    med=28.25µs  avg=30.22µs  p(90)=42.5µs  p(95)=46.76µs p(99)=59.64µs max=12.39ms
     http_req_sending...............: min=15.6µs   med=31.41µs  avg=33.51µs  p(90)=42.84µs p(95)=48.25µs p(99)=67.55µs max=16.5ms
     http_req_tls_handshaking.......: min=0s       med=0s       avg=142.76µs p(90)=0s      p(95)=0s      p(99)=0s      max=5.16s
     http_req_waiting...............: min=0s       med=483.59µs avg=2.17ms   p(90)=1.09ms  p(95)=3.17ms  p(99)=39.14ms max=2.49s
     http_reqs......................: 7115487 1976.522415/s
     iteration_duration.............: min=392.51µs med=630.17µs avg=2.45ms   p(90)=1.25ms  p(95)=3.39ms  p(99)=39.46ms max=5.16s
     iterations.....................: 7115487 1976.522415/s
     vus............................: 60      min=0         max=60
     vus_max........................: 60      min=20        max=60

specifically the line that troubles me is the TLS handshaking line:

     http_req_tls_handshaking.......: min=0s       med=0s       avg=142.76µs p(90)=0s      p(95)=0s      p(99)=0s      max=5.16s

to me it does not seem right that the max is so high (5 sec), but the p99,p95 and p90 are all 0. With such high max’s I would have expected the p99 etc to be dragged up as well.

Can anyone help me make sense of this?

Hi @apiguy !

Welcome to the community forums! :wave:

to me it does not seem right that the max is so high (5 sec), but the p99,p95 and p90 are all 0. With such high max’s I would have expected the p99 etc to be dragged up as well.

To be honest, I think the results are fine, considering the total number of requests (7 115 487), so this max could land into the rest of p(99), right?

Do such results repeat over time?

Cheers!

Hi @apiguy - How did you add p(99) into your http_req_duration?

Hi @olegbespalov yes I think you are right the max was just the outliers, I managed to reduce the TLS handshaking max’s by increasing connection reuse and timeouts in nginx.

1 Like

Hi @suyashnatural ,
to get the p(99) in the http_req_duration I just modified the summaryTrendStats in the options block in the k6 js file. full options block I use is below, I hope this helps

  export const options = {
    tlsAuth: [
      {
        cert: CERT,
        key: KEY,
      },
    ],
    thresholds: {
      http_req_failed: ['rate<0.01'], 
      http_req_duration: ['p(95)<300'],
    },
    scenarios: {
      constant_request_rate: {
        executor: 'constant-arrival-rate',
        rate: __ENV.RATE || 1,
        timeUnit: __ENV.TIME_UNIT || '5s',
        duration: __ENV.DURATION || '15m',
        preAllocatedVUs: __ENV.VUS || 50,
        maxVUs: __ENV.MAX_VUS || 900,
      },
    },
    summaryTrendStats: ["min", "med", "avg", "p(50)", "p(90)", "p(95)", "p(99)", "max"],
  };

I think you can also pass this in as a command line parameter Results output

k6 run --iterations=100 --vus=10 \
--summary-trend-stats="med,p(95),p(99.9)" script.js
2 Likes