Areso
Areso

Reputation: 97

Changing number VUs doesn't affect number of actual number of http requests sent in k6 load test

So, I started from 1 VU, and ended with 199, after that value of VUs number of checks doesn't grow up anymore.

So, I tried this

import http from "k6/http";
import { check } from "k6";

export const options = {
  scenarios: { default: {
  executor: 'constant-arrival-rate',
  duration: '30s',
  rate: 5000, timeUnit: '1s',
  preAllocatedVUs: 900
  } }
};

export default function() {
  const res = http.get("http://ipv4:6399/game_heartbeat");
  check(res, { "status was 200": r => r.status == 200 })
};

got

WARN[0002] Insufficient VUs, reached 900 active VUs and cannot initialize more executor=constant-arrival-rate scenario=default

running (0m30.0s), 000/900 VUs, 128808 complete and 0 interrupted iterations default ✓ [======================================] 000/900 VUs 30s 5000 iters/s

Tried

import http from "k6/http";
import { check } from "k6";

export const options = {
  vus: 199,
  duration: "30s"
};

export default function() {
  const res = http.get("http://ipv4:6399/game_heartbeat");
  check(res, { "status was 200": r => r.status == 200 })
};

and got

running (0m30.0s), 000/199 VUs, 163220 complete and 0 interrupted iterations default ↓ [======================================] 199 VUs 30s

 ✓ status was 200

 checks.........................: 100.00% ✓ 163220      ✗ 0

if I change VUs from 199 to 299, 399, 699 - it doesn't change number of checks. It still would be somewhere around 165k for 30s run

My version is k6 v0.36.0 (2022-01-24T09:50:03+0000/ff3f8df, go1.17.6, linux/amd64)

I am running the script without any additional params, just like k6 run script.js

How I could increase 'pressure' from k6 on a testing service?

Upvotes: 2

Views: 2297

Answers (2)

David Hempy
David Hempy

Reputation: 6237

It will be useful to determine if it is k6 or your app that is running out of gas. Figure that out, and you can move forward.

If your app is the bottleneck...congrats! Your test are indicating what your limits are, and you can start optimizing your app. Or throw more resources at it until you achieve the performance you're looking for.

If it is k6 that can't keep up with the traffic your app can receive, then kudos to your app! See about giving k6 more resources to work with.

BTW, if you're running k6 and your app on the same machine, then they will be fighting for resources. If that's the case and you're hitting bottlenecks, move one of them to a different computer.

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168072

The options are in:

  1. The testing service cannot handle more requests that you're sending, i.e. you reached the bottleneck, in that case you should start looking for the reason and for the ways of improving the service performance
  2. k6 is not capable of sending more requests because it lacks resources like CPU, RAM, network IO, etc. In that case you can either consider moving your load generator to a more powerful machine or consider switching to a load testing tool like JMeter or Locust which support distributed execution mode.

Upvotes: 1

Related Questions