Optimizing for cost
On this page, a few strategies for optimizing the cost of using Remotion Lambda are presented.
Lower concurrency
A lot of compute time is spent on warming up the Lambda function, opening browsers, uploading and downloading assets. By using less Lambda functions, less overhead is being produced which will ultimately result in lower cost, however also in slower render speeds. See the Lambda Concurrency page for more information.
Using cheaper regions
Not all AWS regions have the same cost. See the AWS Lambda pricing chart to see if you are using a region that is more expensive.
Pre-compute data
Consider whether your computation will run on every invoked Lambda function. If possible, pre-compute data once and pass it as input props to the render.
Less memory
Reducing the memory will linearly decrease the cost. Try out different values for the memory when deploying a Lambda function and see how low you can set it without experiencing a crash.
Make the render more performant
Making your render more efficient will also reduce the cost of using Lambda. See the general performance tips.
Real life optimization example
See this video of how we optimized the cost of a Lambda function by finding the bottlenecks and eliminating them.