React Video Editor Documentation
Lambda Rendering Common Problems
Troubleshooting guide for Lambda-based rendering issues
Common Problems with Lambda Rendering
This guide covers common issues you may encounter when using Lambda rendering and how to resolve them.
Timeout Issues
Problem: Lambda function times out during video processing
Symptoms:
- Rendering jobs fail with timeout errors
- Large videos don't complete processing
- Inconsistent processing times
Solutions:
-
Increase Lambda timeout:
const config = { renderer: new LambdaRenderer({ timeout: 900 // Maximum 15 minutes }) };
-
Optimize video processing:
- Use lower resolution for preview renders
- Implement chunked processing for large videos
- Consider using Step Functions for long-running jobs
Memory Issues
Problem: Lambda function runs out of memory
Symptoms:
OutOfMemoryError
in logs- Processing fails for high-resolution videos
- Inconsistent behavior with different video sizes
Solutions:
-
Increase memory allocation:
const config = { renderer: new LambdaRenderer({ memorySize: 3008 // Maximum Lambda memory }) };
-
Optimize video handling:
- Process videos in smaller chunks
- Use streaming for large files
- Implement memory-efficient algorithms
Cold Start Delays
Problem: First render request is slow
Symptoms:
- Initial render takes significantly longer
- Subsequent renders are faster
- Inconsistent response times
Solutions:
-
Implement warm-up strategy:
// Schedule periodic warm-up calls setInterval(async () => { await renderer.warmUp(); }, 300000); // Every 5 minutes
-
Use provisioned concurrency:
- Configure provisioned concurrency for your Lambda function
- Keep functions warm for consistent performance
AWS Service Limits
Problem: Hit AWS service limits
Symptoms:
TooManyRequestsException
errors- Rendering jobs queued but not processed
- Inconsistent availability
Solutions:
-
Implement retry logic:
const renderer = new LambdaRenderer({ retryAttempts: 3, retryDelay: 1000 });
-
Request limit increases:
- Contact AWS support for limit increases
- Implement exponential backoff
- Use multiple Lambda functions
Cost Optimization
Problem: Lambda rendering costs are high
Symptoms:
- Unexpected AWS charges
- Inefficient resource usage
- Processing times longer than necessary
Solutions:
-
Optimize function configuration:
- Right-size memory allocation
- Use appropriate timeout values
- Implement efficient algorithms
-
Implement caching:
const renderer = new LambdaRenderer({ cacheResults: true, cacheTTL: 3600 // 1 hour });
Debugging Tips
Enable Detailed Logging
const renderer = new LambdaRenderer({
logLevel: 'debug',
enableMetrics: true
});
Monitor CloudWatch Metrics
- Check Lambda invocation metrics
- Monitor duration and error rates
- Set up alarms for critical issues
Common Error Codes
400
: Bad request - check input parameters429
: Too many requests - implement rate limiting500
: Internal server error - check Lambda logs502
: Bad gateway - check function configuration
Getting Help
If you're still experiencing issues:
- Check the AWS Lambda documentation
- Review CloudWatch logs for detailed error information
- Contact support with specific error messages and logs
- Consider using the community forums for similar issues