4

I am randomly getting timeout issues when publishing a message to an SNS Topic via my Lambda (node.js v8.10). My lambda is invoked via API Gateway, and only validates that a couple of properties exist and then publishes to a SNS Topic. As you can see from the log below I am publishing about 3-4 messages / second and most finish within 100-400ms and 1 every so often will fail due to timing out at 10 seconds (my configured lambda timeout which should be more than enough). Whenever it does hit the timeout limit it's always at the step of publishing to SNS (with no error or response ever being received). My lambda is not in a VPC and as this post does not seem to have any answers other than "Up The Memory" which I have previously done.

Log

Jarred Olson
  • 3,075
  • 1
  • 19
  • 34
  • You won't see an error because you aren't giving the code enough time to actually let it fail properly. Yes, 10000 ms should be more than enough, but that is not the point. The point is **not** that it needs more time to *succeed*, but rather that it needs more time to *fail on its own*. You need to increase the Lambda time limit to 60s or perhaps even more than that, temporarily, so that it can fail however it's going to eventually fail and throw whatever error it's going to eventually throw, so you can see what the exception is. You're killing it before it can die. – Michael - sqlbot May 15 '18 at 23:02

0 Answers0