remotion-dev/remotion · error · Error
AWS Concurrency limit reached (Original Error: ${(err as Err
Error message
AWS Concurrency limit reached (Original Error: ${(err as Error).message}). See https://www.remotion.dev/docs/lambda/troubleshooting/rate-limit for tips to fix this. What it means
Thrown by the streaming Lambda invoker when AWS responds with TooManyRequestsException or ConcurrentInvocationLimitExceeded. Unlike truncated-JSON and stream-stall failures (which this wrapper auto-retries), a concurrency-limit hit is surfaced immediately because retrying right away would deepen the throttle. The message wraps the original AWS error and links the rate-limit troubleshooting page.
Source
Thrown at packages/lambda-client/src/call-lambda-streaming.ts:199
T extends ServerlessRoutines,
>(
options: CallFunctionOptions<T, Provider> & {
receivedStreamingPayload: OnMessage<Provider>;
retriesRemaining: number;
},
): Promise<void> => {
// As of August 2023, Lambda streaming sometimes misses parts of the JSON response.
// Handling this for now by applying a retry mechanism.
try {
// Do not remove this await
await callLambdaWithStreamingWithoutRetry<T, Provider>(options);
} catch (err) {
if (
(err as Error).stack?.includes('TooManyRequestsException') ||
(err as Error).message?.includes('ConcurrentInvocationLimitExceeded')
) {
throw new Error(
`AWS Concurrency limit reached (Original Error: ${(err as Error).message}). See https://www.remotion.dev/docs/lambda/troubleshooting/rate-limit for tips to fix this.`,
);
}
if (
!(err as Error).message.includes(INVALID_JSON_MESSAGE) &&
!(err as Error).message.includes(LAMBDA_STREAM_STALL) &&
// https://discord.com/channels/809501355504959528/1332166561242288220/1332166561242288220
!(err as Error).message.includes('Runtime.TruncatedResponse') &&
!(err as Error).message.includes('aborted')
) {
throw err;
}
console.error('Retries remaining:', options.retriesRemaining);
if (options.retriesRemaining === 0) {
console.error('Throwing error:');
throw err;View on GitHub (pinned to 78fe4bb3fd)
Solutions
- Lower concurrency for the render via maxConcurrency / maxConcurrencyInMb in renderMediaOnLambda options
- Request an AWS account-level concurrent-executions quota increase, or raise reserved concurrency on the Remotion Lambda function
- Add client-side throttling (e.g. p-limit) so streaming calls are not fired in unbounded parallelism
- Check CloudWatch ConcurrentExecutions/Throttles metrics to confirm saturation
Example fix
// before
await Promise.all(renderIds.map(id => renderMediaOnLambda({ ... })));
// after - serialize or cap concurrency
import pLimit from 'p-limit';
const limit = pLimit(2);
await Promise.all(renderIds.map(id => limit(() => renderMediaOnLambda({ ... , maxConcurrency: 1 })))); Defensive patterns
Strategy: retry
Try / catch
// Wrap streaming/render calls in an exponential-backoff retry
const sleep = (ms: number) => new Promise(r => setTimeout(r, ms));
async function renderWithBackoff<T>(fn: () => Promise<T>, tries = 5): Promise<T> {
for (let i = 0; i < tries; i++) {
try { return await fn(); }
catch (err) {
if ((err as Error).message.includes('AWS Concurrency limit reached') && i < tries - 1) {
await sleep(2 ** i * 1000);
continue;
}
throw err;
}
}
throw new Error('unreachable');
} Prevention
- Cap render concurrency with maxConcurrency / maxConcurrencyInMb
- Stagger parallel render triggers with p-limit or a queue
- Monitor CloudWatch Throttles/ConcurrentExecutions before scaling out
- Request AWS quota increases ahead of bulk render campaigns
When it happens
Trigger: Any streaming routine (renderMediaOnLambda progress streaming, getRenderProgress, getCompositionsOnLambda) invoked while the account's concurrent Lambda executions are saturated. The check matches 'TooManyRequestsException' in the error stack or 'ConcurrentInvocationLimitExceeded' in the message.
Common situations: Account-level concurrency (default 1000) exceeded by fan-out chunk renders; reserved concurrency set too low on the Remotion function; many clients triggering renders simultaneously; bursting concurrent progress polls.
Related errors
- Lambda Insights is not supported by AWS in region ${region}.
- Lambda was created but has no name
- Deploying the site failed, and removing the generated bundle
- Render did not finish yet
- No valid AWS Caller Identity detected
AI-assisted analysis of remotion-dev/remotion@78fe4bb3fd (2026-08-12).
Data as JSON: /api/errors/0261d58668978fdf.
Report an issue: GitHub.