Lambda functions running on same instance causes various requests to timeout

0

Hi, I created a function to edit videos in lambda function using ffmpeg. I edit the video using child process to gain kernel access in javascript, and editing a video usually takes around 3-4 minutes of time.

Now if two requests spawn simultaneously(within an interval of 2 minutes) both of those requests get into the same instance of lambda and thus one of the request has to stall resulting in timeout of the lambda function without the editing actually being started.

Thus I am being billed for the same lambda function resources twice, and moreover it is also hindering my editing pipeline by getting timed out due to both requests sharing the same resource.

How is this the desired behavior of the lambda function? How do I change the settings to initiate a new request on a separate instance

Kushal
已提問 1 年前檢視次數 314 次
3 個答案
0

If your Lambda function is processing two requests at once they are completely separate instances in separate containers that have no relationship with each other.

Any interaction you're seeing between these two instances would be due to some external resource (outside of Lambda) that both are using.

專家
已回答 1 年前
0

There are logs of several instances in the same log group. Correct me if I am wrong, but I believe the logs are grouped according to the container the lambda function is running in. If this is not the case, then on what basis does one log group contain logs of multiple instances

Kushal
已回答 1 年前
0

A log group is created for the defined lambda function. Each container will have its own log stream in the log group. So if two instances are running they will be in different containers and so in different log streams, but the same log group.

專家
已回答 1 年前

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

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

回答問題指南