| name | customerio-load-scale |
| description | Implement Customer.io load testing and horizontal scaling.
Use when preparing for high traffic, running load tests,
or designing queue-based architectures for scale.
Trigger: "customer.io load test", "customer.io scale",
"customer.io high volume", "customer.io k6", "customer.io performance test".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(npx:*), Bash(kubectl:*), Glob, Grep |
| version | 1.14.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","customer-io","load-testing","scaling","performance"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Customer.io Load & Scale
Overview
Load testing and scaling strategies for high-volume Customer.io integrations: k6 load test scripts, scaling architecture selection based on volume tier, Kubernetes HPA autoscaling, message queue buffering, and rate-limit-aware batch processing.
Scaling Architecture by Volume
| Daily Events | Architecture | Key Components |
|---|
| < 100K | Direct API | Singleton client, retry, connection pooling |
| 100K - 1M | Batched API | Event queue, batch processor, rate limiter |
| 1M - 10M | Queue-backed | Redis/Kafka queue, worker pool, backpressure |
| > 10M | Distributed | Multiple workspaces, sharded queues, regional routing |
Customer.io rate limit is ~100 req/sec per workspace. Plan your architecture around this.
Instructions
Step 1: k6 Load Test Script
import http from "k6/http";
import { check, sleep } from "k6";
import { Counter, Trend } from "k6/metrics";
const SITE_ID = __ENV.CUSTOMERIO_SITE_ID;
const API_KEY = __ENV.CUSTOMERIO_TRACK_API_KEY;
const BASE_URL = "https://track.customer.io/api/v1";
const AUTH = `${SITE_ID}:${API_KEY}`;
const identifyLatency = ();
trackLatency = ();
errors = ();
options = {
: {
: {
: ,
: ,
: ,
: ,
: ,
: [
{ : , : },
{ : , : },
{ : , : },
],
},
},
: {
: [, ],
: [, ],
: [],
},
};
() {
userId = ;
headers = {
: ,
: ,
};
identifyRes = http.(
,
.({
: ,
: ,
: .(.() / ),
}),
{ headers }
);
identifyLatency.(identifyRes..);
(identifyRes, { : r. === }) || errors.();
trackRes = http.(
,
.({
: ,
: { : __ITER, : __VU },
}),
{ headers }
);
trackLatency.(trackRes..);
(trackRes, { : r. === }) || errors.();
();
}
() {
.();
}