简体   繁体   English

无服务器图像处理程序请求大文件大小时出现 502 错误

[英]502 error when Serverless image handler requests a large file size

I've deployed the AWS Cloud formation Serverless image handler to resize images in an S3 bucket which is working well.我已经部署了 AWS Cloud formation 无服务器图像处理程序来调整运行良好的 S3 存储桶中的图像大小。 It is using Cloudfront, API Gateway, Lamdba, and a custom domain.它使用 Cloudfront、API 网关、Lamdba 和自定义域。

My original images (PNGs) are of a reasonable size (~5MB or ~5000px across) and my derivatives are of various sizes.我的原始图像 (PNG) 大小合理(大约 5MB 或大约 5000 像素),我的衍生图像大小不一。 Up until about fit-in/2048x2048 everything works well.直到大约fit-in/2048x2048一切正常。 Above that though I get a 502 "Internal server error".在此之上,尽管我收到 502“内部服务器错误”。

I've tried maxing out memory and timeouts to no avail.我试过最大化内存和超时无济于事。 Does anyone have any idea what's going on there?有谁知道那里发生了什么? Is there some invisible limit?有一些看不见的限制吗?

{
    "message": "Internal server error"
}

This issue is caused by the payload limit of 6mb for Lambda Functions.此问题是由 Lambda 函数的6mb负载限制引起的。 As a workaround it is possible to save the images directly to a output bucket and deliver them from this bucket to the customer.作为解决方法,可以将图像直接保存到输出桶并将它们从该桶交付给客户。

The issue is in the future backlog since 07/2018 ( see here or here )该问题在 07/2018 之后的未来积压中( 请参阅此处此处

The architecture may need a correction here.此处的体系结构可能需要更正。 Whenever you deliver large files, you need to leave the responsibility to S3 / CloudFront.每当您传送大文件时,您需要将责任留给 S3 / CloudFront。 Lambda should take care of authenticating / authorization of the content. Lambda 应该负责内容的验证/授权。

API Gateway has a limitation on the lambda response limit. API 网关对 lambda 响应限制有限制。

https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 AWS 无服务器图像处理程序错误处理 - AWS Serverless Image Handler Error Handling 在无服务器应用程序架构中处理大负载大小 - handling large payload size in serverless app architecture 具有图像 URL 签名功能的 AWS 无服务器图像处理程序 - AWS Serverless Image Handler with image URL signature feature AWS lambda 无服务器中不存在此类文件错误 - AWS lambda no such file exists error in serverless 无服务器部署时,层消耗超过 262144000 字节的可用大小 - Layers consume more than the available size of 262144000 bytes when serverless deploy Kubernetes GKE 502 服务器错误在多次重新加载时无法选择后端 - Kubernetes GKE 502 server error failed to pick backend when reloaded multiple times 无服务器错误,当自定义命名的资源需要替换时,CloudFormation 无法更新堆栈 - Serverless Error, CloudFormation cannot update a stack when a custom-named resource requires replacing Sequelize 无服务器离线迁移错误 - Error with Sequelize Serverless Offline Migrations 无服务器 AWS Lambda CORS 错误 - Serverless AWS Lambda CORS Error 使用 Twilio 无服务器 SDK 提供音频文件 - Serve audio file using Twilio serverless SDK
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM