Prompt

k6 login spike test

Technology / Testing & QA2 observationsLast seen Nov 26, 2026

Latest observation

Nov 26, 2026OpenAI APIWeb search: off

Here’s a simple k6 spike test for a login endpoint. It rapidly increases traffic to see how your auth service behaves under sudden load.

Example k6 script: login-spike.js

import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  stages: [
    { duration: '30s', target: 10 },   // baseline
    { duration: '10s', target: 500 },   // spike up fast
    { duration: '30s', target: 500 },   // hold spike
    { duration: '10s', target: 10 },    // drop back down
    { duration: '30s', target: 0 },     // cool down
  ],
  thresholds: {
    http_req_failed: ['rate<0.05'],      // <5% failed requests
    http_req_duration: ['p(95)<1000'],   // 95% under 1s
  },
};

const BASE_URL = __ENV.BASE_URL || 'https://example.com';
const USERNAME = __ENV.USERNAME || 'testuser';
const PASSWORD = __ENV.PASSWORD || 'testpass';

export default function () {
  const payload = JSON.stringify({
    username: USERNAME,
    password: PASSWORD,
  });

  const params = {
    headers: {
      'Content-Type': 'application/json',
    },
  };

  const res = http.post(`${BASE_URL}/login`, payload, params);

  check(res, {
    'status is 200 or 302': (r) => r.status === 200 || r.status === 302,
    'login response not empty': (r) => r.body && r.body.length > 0,
  });

  sleep(1);
}

Run it

k6 run -e BASE_URL=https://your-site.com -e USERNAME=youruser -e PASSWORD=yourpass login-spike.js

If your login uses form data instead of JSON

Use this payload instead:

const payload = {
  username: USERNAME,
  password: PASSWORD,
};
const params = {
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
};
const res = http.post(`${BASE_URL}/login`, payload, params);

Common things to test for login spikes

  • response codes: 200, 302, 401, 429
  • auth latency
  • rate limiting
  • session/token issuance
  • backend DB or identity provider saturation

If you want, I can also give you:

  1. a realistic login spike test with multiple users,
  2. a JWT/token-based login flow, or
  3. a k6 cloud-ready version.

Brands

Observation history

How did Obsurfable measure this prompt?

Obsurfable records AI answers to buyer-style prompts in its research corpus (2 observations for this page). Metrics are distributions over observations, not a single static ranking.

Which AI systems does Obsurfable collect answers from?

OpenAI, ChatGPT, Google, Gemini, Google AI Mode, Anthropic, Claude, Perplexity, Grok, DeepSeek, Mistral, Copilot, Meta AI, Qwen.

How can brands improve their AEO?

Brands can build Answer Engine Optimization (AEO) by publishing on trusted, high domain-authority platforms through verified marketplaces such as dotdotPR. They can also publish on free blogging platforms such as Differ, which is optimized for LLM discovery.

Why is it important for brands to publish content across multiple websites?

Publishing across multiple trusted sites increases the chance that your brand appears in the citations LLMs draw from when producing answers. Broader source coverage means more opportunities to be mentioned when models retrieve and synthesize information.

Want this interpreted for your brand?

Explorer is the free public corpus. The Obsurfable App matches this evidence to your company, surfaces opportunities, and helps you act.