Load testing answers questions that monitoring cannot: how many users can the site handle before it slows down, what breaks first, and did the last release make things worse? k6 is an open-source load testing tool from Grafana Labs that is scripted in JavaScript, runs from the command line and uses resources efficiently. A VPS makes a good load generator because it has a stable, fast connection and can sit close to your servers.
Before You Start: Test Safely
- Only test systems you own or have permission to test. Load tests against other people's servers can look like an attack.
- Prefer staging with production-like data and configuration (see our staging guide).
- If you test production, do it at a quiet time, start small, tell your team and your hosting provider if they ask for notice, and be ready to stop.
- Avoid side effects: do not place real orders or send real emails; use test accounts and sandbox payment keys.
Step 1: Install k6
On Debian or Ubuntu, add Grafana's package repository and install, following the current instructions in the k6 documentation, or run the official Docker image:
docker run --rm -i grafana/k6 run - <script.js
Check the install with k6 version.
Step 2: Write a Realistic Script
// script.js
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '2m', target: 50 }, // ramp up to 50 virtual users
{ duration: '5m', target: 50 }, // hold
{ duration: '2m', target: 0 }, // ramp down
],
thresholds: {
http_req_duration: ['p(95)<500'], // 95% of requests under 500 ms
http_req_failed: ['rate<0.01'], // less than 1% errors
},
};
const BASE = __ENV.BASE_URL || 'https://staging.example.com';
export default function () {
const home = http.get(`${BASE}/`);
check(home, { 'home 200': (r) => r.status === 200 });
sleep(Math.random() * 3 + 1); // think time, 1-4 s
const product = http.get(`${BASE}/products/sample-product`);
check(product, { 'product 200': (r) => r.status === 200 });
sleep(Math.random() * 3 + 1);
}
Model what users actually do: the pages they visit, in roughly the proportions they visit them, with pauses between actions. A test that hammers one URL with no think time measures something, but not your real capacity.
Step 3: Run It
BASE_URL=https://staging.example.com k6 run script.js
# or
k6 run -e BASE_URL=https://staging.example.com script.js
Run k6 inside tmux on the VPS so the test continues if your SSH connection drops.
Step 4: Read the Results
| Metric | What it tells you |
|---|---|
http_req_duration (p90, p95, max) | Response times; percentiles matter more than the average |
http_req_failed | Share of failed requests (network errors and, by default, 4xx/5xx statuses) |
http_reqs | Total requests and requests per second |
checks | Share of your assertions that passed |
iteration_duration | Time for one full user journey, including think time |
If thresholds are breached, k6 exits with a non-zero code, which makes it easy to fail a CI job automatically.
Step 5: Watch the Server Under Test
k6 tells you that something slowed down; the target server tells you why. During the test, watch CPU, memory, disk I/O and the database (see our bottleneck diagnosis guide):
vmstat 5
iostat -x 5
# and the database's slow query log
A dashboard from your monitoring stack makes correlation much easier (see our monitoring guide).
Test Types
| Type | Shape | Answers |
|---|---|---|
| Smoke | 1–2 users, 1 minute | Does the script and system work at all? |
| Load | Expected peak, held for several minutes | Does it meet targets at normal peak? |
| Stress | Step up beyond expected peak | Where does it break, and how? |
| Spike | Sudden jump in users | Does it survive a burst, such as a campaign launch? |
| Soak | Moderate load for hours | Memory leaks, connection exhaustion, slow degradation |
Common Mistakes
- Running k6 on the same server you test, so both compete for CPU.
- A load generator that becomes the bottleneck: if its CPU is near 100%, the results describe the generator, not your site.
- Testing from far away and blaming the server for network latency; generate load from a location similar to your users.
- Only testing cached pages such as the homepage, missing the expensive logged-in, search and checkout paths.
- Ignoring CDNs and rate limits: they may block or absorb the test; decide whether to test the origin directly.
Load Tests in CI
Run a short load test after each deploy to staging with strict thresholds. A failing threshold catches performance regressions the same way failing unit tests catch bugs. Keep the long stress and soak tests for scheduled runs.
ServoMix Plans for This Workload
k6 is efficient: a 2 vCore / 8 GB load generator drives thousands of simple HTTP requests per second. Use 4–8 vCores for heavy scripts or very high request rates, and always keep the load generator separate from the server under test.
AMD EPYC 7C13 VPS
Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| SMX vPro XS (AMD EPYC) | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹420/mo | Websites, small APIs, bots, staging and VPN servers | Order |
| SMX vPro S (AMD EPYC) | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹560/mo | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| SMX vPro M (AMD EPYC) | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹840/mo | Production databases, high-traffic sites, multi-container apps | Order |
| SMX vPro L (AMD EPYC) | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹1,120/mo | Large production workloads, SaaS platforms, analytics, in-memory caches | Order |
Intel Xeon Platinum 8269CY VPS
KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| SMX vCore XS (Intel Xeon) | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹270/mo | Business websites, small apps, scheduled jobs and bots | Order |
| SMX vCore S (Intel Xeon) | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,169/month | Business software, mid-size databases, several sites on one server | Check stock |
| SMX vCore M (Intel Xeon) | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,249/month | ERP/CRM stacks, heavier databases, multiple production apps | Check stock |
| SMX vCore L (Intel Xeon) | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,248/month | High-memory workloads and consolidated production servers | Check stock |
Prices are monthly in INR as listed on the ServoMix store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.
Frequently Asked Questions
What is k6?
Why run load tests from a VPS?
Can I run k6 on the server I am testing?
How many virtual users do I need?
What are good thresholds?
Is it legal to load test any website?
Should I load test production?
Why is the average response time misleading?
How do I know the load generator is not the bottleneck?
Which ServoMix plan suits a k6 load generator?
Related Guides
- How to Benchmark VPS CPU and Network Performance Yourself
- Signs Your Website Has Outgrown Its Server: Diagnosing CPU, RAM and Disk Bottlenecks
- How to Create a Staging Server for Web Applications Using a VPS
- How to Set Up Monitoring and Logging for Applications on a VPS
- How to Set Up a Load Balancer Across Multiple VPS Servers with Nginx
Frequently Asked Questions
What is k6?
An open-source load testing tool from Grafana Labs. Tests are written in JavaScript and run from the command line, with built-in metrics, checks and pass/fail thresholds.
Why run load tests from a VPS?
A VPS has a stable, fast connection and enough CPU to generate load, and can be placed in the same region as your users. A laptop on home internet often becomes the bottleneck.
Can I run k6 on the server I am testing?
You should not: the load generator and the application compete for CPU and memory, which distorts results. Use a separate server.
How many virtual users do I need?
Enough to reproduce your expected peak concurrency, including think time. Then step higher in a stress test to find where response times or errors break your thresholds.
What are good thresholds?
Common starting points are p95 response time under 500 ms for pages or under 200–300 ms for APIs, and an error rate below 1%. Set targets that match your users' expectations.
Is it legal to load test any website?
Only test systems you own or have explicit permission to test. Unauthorised load tests can disrupt services and may be treated as an attack.
Should I load test production?
Prefer staging with production-like configuration. If you must test production, start small at a quiet time, avoid side effects and monitor closely.
Why is the average response time misleading?
Averages hide slow outliers. Percentiles such as p95 and p99 show what your slower users experience.
How do I know the load generator is not the bottleneck?
Watch its CPU and network during the test. If the generator is near its limits, use a bigger server or several generators.
Which ServoMix plan suits a k6 load generator?
A 2 vCore / 8 GB AMD EPYC or Intel VPS handles most tests; use 4–8 vCores for very high request rates or complex scripts.
Your feedback helps us continuously improve ServoMix guides.
Know someone who may find this guide useful?
