Intaek
Intaek

Reputation: 526

How to handle AWS Lambda timeout?

I have a lambda function that generates thumbnails on S3 Put event. It works fine. But I want to handle the case when it accidentally takes longer than reserved time(3 sec).

It's because I'm fetching the lambda generated thumbnail by suffixing '-small.jpg' or '-medium.jpg'. If the timeout happens and the thumbnails are not generated, I must have an alternative image in my bucket.

Upvotes: 0

Views: 2311

Answers (2)

Praveen Gowda
Praveen Gowda

Reputation: 162

if you want to increase function timeout you can edit in the general setting of your function. steps and screenshot below will explain how to do it.

  1. Click on the lambda function hyperlink and click on General Configuration. Screenshot 1

  2. click on edit [top right pane], and increase the function timeout.

2: Screenshot 2

Upvotes: 2

jarmod
jarmod

Reputation: 78653

I suspect that creating thumbnails will not take more than 15 minutes at maximum Lambda RAM (and correspondingly max CPU) but if you need to handle that possibility then configure your Lambda function with a DLQ and trigger subsequent processing of failed Lambda functions.

Upvotes: 0

Related Questions