Skip to main content

生产清单

你已经使用 Remotion Lambda 实现了你的解决方案,并准备将你的项目推向世界。祝贺你!在上线之前,请查看这个清单,以确保 Lambda 正常运行稳定。

🌐 You have implemented your solution with Remotion Lambda and are ready to launch your project into the world. Congrats! Before you go live, go through this checklist to make sure Lambda is running stable.

优化内存

🌐 Optimizing for memory

为你的 Lambda 函数添加过多内存会使渲染成本更高。将函数的内存减少 25% 也会将成本降低 25%!多次重新部署你的函数,并尽可能降低内存大小,直到你觉得在低成本与对视频可靠渲染的信心之间达到了最佳平衡点。

🌐 Adding too much memory to your Lambda functions can make rendering more costly. Reducing the memory of your function by 25% will also decrease your cost by 25%! Redeploy your function multiple times and lower the memory size as much as possible until you feel you hit the sweet spot between low costs and confidence that your video will render reliably.

最大文件大小

🌐 Maximum file size

Lambda 的最大输出文件大小约为磁盘空间的一半。调整 Lambda 的磁盘空间参数,以适应你希望支持的最大视频长度。测试输出文件的大小,确保它们不会超过限制。如果你的视频是基于用户输入的,请防止用户渲染可能超过 Remotion Lambda 可用空间的超长视频。

🌐 Lambda is constrained to a maximum output file size of approximately half the disk space. Adjust the disk space parameter of Lambda to accommodate for the maximum video length that you would like to support. Test the file sizes of your outputs and make sure they don't run at risk of exceeding the limit. If your video is based on user input, prevent your users from rendering very long videos that would exceed the space available in Remotion Lambda.

权限

🌐 Permissions

确保你的 AWS 用户只拥有所需的权限,并将你的凭证存储为环境变量。查看 权限 页面以了解所需的最少权限。

🌐 Make sure your AWS user only has as many permissions as needed and store your credentials as environment variables. Review the Permissions page to see what the minimum amount of permissions is.

选择合适的并发

🌐 Selecting the right concurrency

如果你使用 framesPerLambda 选项,请确保对于每个渲染的视频,该参数设置在允许的范围内(每次渲染不超过 200 个 lambda 函数)。参见:并发

🌐 If you are using the framesPerLambda option, make sure that for each video you render, the parameter is set in a way that it stays within the allowed bounds (no more than 200 lambda functions per render). See: Concurrency

桶隐私

🌐 Bucket privacy

默认情况下,渲染的视频在你的存储桶中是公开可访问的。如果你希望渲染的视频为私密,可以使用 renderMediaOnLambda()renderStillOnLambda() 中的 privacy 设置。

🌐 By default the rendered videos are publicly accessible in your bucket. Use the privacy setting in renderMediaOnLambda() and renderStillOnLambda() to make renders private if you'd like so.

速率限制

🌐 Rate limiting

考虑用户是否可能调用大量视频渲染,这些渲染最终会出现在你的 AWS 账单上,并实现速率限制器以防止恶意行为者渲染大量视频。

🌐 Consider if it's possible for a user to invoke many video renders that will end up on your AWS bill, and implement a rate limiter to prevent a malicious actor from rendering many videos.

超时

🌐 Timeout

你的 Lambda 函数的默认超时是 120 秒,这应该已经足够,因为视频渲染是高度并行化的。但同样在这里,请根据你的需求测量并调整超时时间,并确保时间足够长,以免你的视频渲染失败。

有效的公司许可

🌐 Valid Company license

超过三人的公司需要购买云渲染席位才能使用 Remotion Lambda。请在启动前熟悉许可证购买所需的云席位

🌐 Companies with more than 3 people need to buy cloud rendering seats in order to use Remotion Lambda. Please familiarize yourself with the license and buy the necessary cloud seats before launching.