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
asked a year ago307 views
3 Answers
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.

EXPERT
answered a year ago
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
answered a year ago
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.

EXPERT
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions