AWS lambda running for continuously for timeout duration

0

Hello,

I have developed an AWS Lambda function to process SQS items, and I am currently using a batch size of 1. According to my estimates, processing a single SQS item should take about 10 seconds. However, after deploying the Lambda function, I noticed that the processing time for a batch of SQS items still takes only 10 seconds, but the billing duration metric reports a duration of 500 seconds.

I have thoroughly reviewed the code and tested it locally, and have not encountered any exceptions.

Would someone be able to assist me in resolving this issue?

2개 답변
2

Try to add logging to your function, or use X-Ray, to understand where the time is spent. If you put a timeout of 10 sec, and your function takes effectively 500 sec to run, it will constantly fail.

AWS
전문가
답변함 일 년 전
  • Adding additional logging is definitely the first step to troubleshoot this, and don't forget to check the CloudWatch logs for the executions your function has already run - even without additional function-level logging, if your Lambda function as the basic logging IAM role attached, it will log function start and stop events, and errors, already.

0

Without seeing the code it's difficult to troubleshoot from here. That said, if the processing duration should only be 10 seconds, why not set the timeout to 10 seconds?

If you need to find out why the Lambda function is running longer than 10 seconds, I'd suggest that you contact the support team as they have visibility into your environment and your Lambda functions.

profile pictureAWS
전문가
답변함 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠