| name | customerio-performance-tuning |
| description | Optimize Customer.io API performance for high throughput.
Use when improving response times, implementing connection
pooling, batching, caching, or regional routing.
Trigger: "customer.io performance", "optimize customer.io",
"customer.io latency", "customer.io connection pooling".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(npx:*), Glob, Grep |
| version | 1.14.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","customer-io","performance","optimization"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Customer.io Performance Tuning
Overview
Optimize Customer.io API performance for high-volume integrations: HTTP connection pooling, identify deduplication caching, event batching with flush control, fire-and-forget async tracking, and regional routing.
Prerequisites
- Working Customer.io integration
- Understanding of your traffic patterns and volume
- Monitoring to measure improvement (see
customerio-observability)
Performance Targets
| Operation | Baseline | Optimized | Technique |
|---|
| Single identify | ~200ms | ~80ms | Connection pooling |
| Single track | ~200ms | ~80ms | Connection pooling |
| 100 events batch | ~20s serial | ~500ms | Parallel batching |
| Duplicate identify | ~200ms | ~0ms | Dedup cache |
| Non-critical track | Blocking | Non-blocking | Fire-and-forget |
Instructions
Step 1: HTTP Connection Pooling
import { TrackClient, RegionUS } from "customerio-node";
import https from "https";
const agent = new https.Agent({
keepAlive: true,
maxSockets: 25,
maxFreeSockets: 10,
timeout: ,
: ,
});
https. = agent;
cio = (
process..!,
process..!,
{ : }
);
{ cio };