1

I have two lambda functions in my AWS. One acts as a custom authorizer and the other acts as a notification service which calls the firebase FCM notification service.

When a request is made first time in a day to the notification lambda there is no response. The lambda does not work and hence does not call the firebase service.

It seemed like a cold start problem to me so I added the provisioned concurrency for both auth and notification lambda to 1 in the hope that it will work. But the problem persists.

Cloudwatch logs are of no help at all since nothing gets printed to it which I can use to figure out the issue. Either the authorizer lambda goes cold and does not response or the primary notification lambda goes cold and does not response or even both of them have issues.

After the first call to lambda fails any subsequent calls then work smoothly like a charm.

I do not want to install any plugin which will keep the lambda warm (not an option from the client) so is there some other way I can diagnose this problem and fix it?

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
codeinprogress
  • 3,193
  • 7
  • 43
  • 69
  • 1
    Coldstart isn't your issue. If the lambda is called, there are logs. If there are no logs, it was not invoked. Look toward that which is invoking it. Any logs about execution duration would probably be helpful. Also information about the runtime, invocation pattern, upstream errors, etc. – theherk Jan 21 '22 at 09:11
  • Now that you said this. I also have an express server in lambda createdusing aws-serverless-express module. Could there be an issue with creating the server in first lambda invocation? – codeinprogress Jan 21 '22 at 09:54
  • Maybe, but it still seems like something should be logged. Maybe you can increase logging in your lambda to get any sort of debugging information. Even if just the event received. – theherk Jan 21 '22 at 10:01
  • What is the timeout and memory allocated to your application? May we ask too what is the language and purpose of the root endpoint? – Allan Chua Jan 21 '22 at 10:57
  • @AllanChua memory for the both lambdas = 256 MB and timeout is 1 minute 40 seconds – codeinprogress Jan 21 '22 at 11:37

0 Answers0