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.
SkyRainCloud 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 |
|---|---|---|---|---|---|---|---|
| VPS 1 — AMD | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Websites, small APIs, bots, staging and VPN servers | Order |
| VPS 2 — AMD | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,299/month | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| VPS 3 — AMD | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,499/month | Production databases, high-traffic sites, multi-container apps | Order |
| VPS 4 — AMD | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,899/month | 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 |
|---|---|---|---|---|---|---|---|
| VPS 1 — Intel | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Business websites, small apps, scheduled jobs and bots | Order |
| VPS 2 — Intel | 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 |
| VPS 3 — Intel | 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 |
| VPS 4 — Intel | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,299/month | High-memory workloads and consolidated production servers | Check stock |
Prices are monthly in INR as listed on the SkyRainCloud 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 SkyRainCloud 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