Load Testing Signup API with 100 VUs (Only One Request per User)

Use Case:
My backend only allows one signup request per unique email ID. If the same email is used again, it returns a 401 Unauthorized error.

My company asked me to conduct load testing with 100 Virtual Users (VUs), but did not provide further instructions.

πŸ“Œ What I Want

  • Each VU should send only one signup request using a unique email.
  • Emails must not repeat across VUs.
  • Test should simulate realistic load with 100 VUs.

πŸ”§ My Current k6 Script

import http from 'k6/http';
import config from '../../config/configuration.js';
import { check } from 'k6';

export const options = {
stages: [
{ duration: β€˜10s’, target: 20 },
{ duration: β€˜10s’, target: 50 },
{ duration: β€˜10s’, target: 100 },
{ duration: β€˜20s’, target: 100 },
{ duration: β€˜10s’, target: 0 },
],
thresholds: {
http_req_duration: [β€˜p(95)<400’],
http_req_failed: [β€˜rate<0.10’],
},
};

let users;
try {
users = JSON.parse(open(β€˜../../data/demo.json’));
} catch (error) {
console.error(β€˜Error reading user data:’, error);
}

export default function () {
if (__ITER === 0) {
const selectedUser = users[__VU - 1];
const signupUrl = ${config.urls.AUTH_BASE_URL}/user/signup/email;

const signupPayload = JSON.stringify({
  email: selectedUser.email,
  password: selectedUser.password,
  deviceInfo: {
    model: "Pixel 4",
    platForm: "Android",
    osVersion: "13",
    operatingSystem: "android"
  }
});

const headers = { ...config.headers };

const signupRes = http.post(signupUrl, signupPayload, { headers });
check(signupRes, {
  'Signup returned 200': (r) => r.status === 200,
});

}
}

❓ My Questions

  • Is this the correct approach to simulate load when only one request per account is allowed?
  • Should I use per-VU iteration or shared-iterations in this case?
  • How do I monitor separate APIs using tags in Grafana without mixing metrics?

🎯 Goal

Run a realistic load test using 100 unique user signups, with clear monitoring of API performance per endpoint.