Increase quota Synchronous payload on AWS Lambda to receive large video file?

0

Hi Everyone,

Currently we have dedicated microservice API to upload video. this API is not frequently being called by client. Only around 20 times per month. So I plan to move it to Lambda API (with 15 minutes timeout) and integrate it to current Application Load Balancer.

So the stack will become like : Application Load Balancer -> Lambda API -> S3

I verified already, this lambda API can store small video file like 500 KB, but when I want to upload large video (like 80 MB), I get this error : "413 Request Entity Too Large". Although I set Lambda function memory 2 GB & storage 2 GB.

My Question : Do I need to request to increase quota Synchronous payload on AWS Lambda? or maybe any other service quota under AWS Lambda that I need to increase?

Thank You.

已提問 1 年前檢視次數 686 次
3 個答案
2

Hi,

For this kind if operation, I would suggest to have the client directly upload to S3. You can even use S3-Accelaration to reduce the upload time a bit (depending on client and bucket location).

To grant your client access to S3, you have several choices:

You are already using Cognito Identity Pool: Your client will receive temporary credentials upon login. Adapt the role policies to allow S3 PutObject and have the client uploading the file via it's AWS-SDK

Have your API return a presigned URL on which the client can do a POST. Have a trigger on S3 (Object Created) that kicks-off a Lambda to process the file

Hope this helps,

Regards, Daniel

profile picture
已回答 1 年前
2

You can't increase the payload size to a Lambda function. The limit is 256KB for asynchronous invocations and 6MB for synchronous invocations (as from ALB).

The recommended approach is to generate a presigned URL and upload the file directly to S3 from the client using that URL.

profile pictureAWS
專家
Uri
已回答 1 年前
0

Hi Daniel & Uri,

Thanks for the answers. After read your answer, we did some exploration.

We plan to use EFS together with existing ECS. Right now, we still exploring how to link those.

Thank You.

已回答 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南