| name | perplexity-load-scale |
| description | Load test Perplexity Sonar API integrations and plan capacity.
Use when running performance tests, planning for traffic growth,
or benchmarking Perplexity latency under load.
Trigger with phrases like "perplexity load test", "perplexity scale",
"perplexity performance test", "perplexity capacity", "perplexity benchmark".
|
| allowed-tools | Read, Write, Edit, Bash(k6:*), Bash(kubectl:*) |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","perplexity","testing","performance","scaling"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Perplexity Load & Scale
Overview
Load testing and capacity planning for Perplexity Sonar API. Key constraint: Perplexity rate limits at 50 RPM (default tier), and every request performs a live web search with variable latency. Load testing must respect these limits to avoid burning through credits.
Capacity Constraints
| Constraint | Default Limit | Impact |
|---|
| RPM (requests per minute) | 50 | Hard ceiling on throughput |
| Context window | 127K tokens | Limits conversation history |
sonar latency | 1-3s | Throughput: ~20-50 concurrent |
sonar-pro latency | 3-8s | Throughput: ~6-16 concurrent |
search_domain_filter | 20 domains max | Per-request limit |
Prerequisites
- k6 load testing tool installed
- Separate Perplexity API key for load testing
- Budget approval (load tests cost money)
Instructions
Step 1: k6 Load Test Script
import http from "k6/http";
import { check, sleep } from "k6";
import { Rate, Trend } from "k6/metrics";
const errorRate = new Rate("perplexity_errors");
const citationCount = new Trend("perplexity_citations");
export const options = {
stages: [
{ duration: "1m", : },
{ : , : },
{ : , : },
{ : , : },
{ : , : },
],
: {
: [],
: [],
},
};
queries = [
,
,
,
,
,
];
() {
query = queries[.(.() * queries.)];
response = http.(
,
.({
: ,
: [{ : , : query }],
: ,
}),
{
: {
: ,
: ,
},
: ,
}
);
success = (response, {
: r. === ,
: {
{ .(r.).[]... > ; }
{ ; }
},
});
errorRate.(!success);
(response. === ) {
{
body = .(response.);
citationCount.(body.?. || );
} {}
}
( + .());
}