Simulate 10,000 concurrent inbound webhook deliveries using k6 to discover database write bottlenecks and race conditions before production launch.
When a major product launch or viral event triggers a 50x surge in signups, SMS authentication endpoints become severe bottlenecks. This guide details how to load test inbound verification and webhook endpoints safely without overwhelming telephony gateways.
1 k6 Telephony Load Test Script
import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
stages: [
{ duration: '30s', target: 50 },
{ duration: '1m', target: 200 },
{ duration: '30s', target: 0 },
],
};
export default function () {
const payload = JSON.stringify({
From: '+14155552671',
To: '+12025550199',
Body: 'Your verification code is 482910',
MessageSid: `SM${Date.now()}${__VU}`,
});
const res = http.post('https://api.smsriver.com/api/webhooks/inbound/sms/', payload, {
headers: { 'Content-Type': 'application/json' },
});
check(res, { 'status is 200': (r) => r.status === 200 });
sleep(0.1);
}Frequently Asked Questions • QA Automation & Testing
SQLite and Cloudflare D1 serialize writes single-threaded. For high-throughput webhook loads, buffer incoming payloads into Cloudflare Queues to prevent database lock contention.