Here’s the configuration on my serverless.yml
for the lambda:
sendXXX:
handler: functions/sendXXX/index.handler
timeout: 55
provisionedConcurrency: 1
events:
- schedule: rate(1 minute)
Here’s the relevant Cloudwatch log:
2024-06-25T11:50:32.134Z START RequestId: c2cfe6d6-10d3-4520-8ef1-c82730103331 Version: 170
2024-06-25T11:50:35.698Z START RequestId: 3e331a19-31d9-4342-af21-fe0e7e023c6e Version: 170
2024-06-25T11:50:37.443Z END RequestId: c2cfe6d6-10d3-4520-8ef1-c82730103331
2024-06-25T11:50:37.443Z REPORT RequestId: c2cfe6d6-10d3-4520-8ef1-c82730103331 Duration: 5309.22 ms Billed Duration: 5310 ms Memory Size: 512 MB Max Memory Used: 328 MB
2024-06-25T11:50:38.330Z END RequestId: 3e331a19-31d9-4342-af21-fe0e7e023c6e
As you can see, the request c2cfe6d6-10d3-4520-8ef1-c82730103331
started at 11:50:32.134Z
. I expect the next request to start around 11:51:32
, but that’s starting only after 3 seconds (at 11:50:35.698Z
). I wonder why it’s working like this.
I tried removing the provisionedConcurrency
setting altogether and changing the rate(1 minute)
schedule to cron(* * * * ? *)
without success. Wham am I doing wrong?
Is it because the lambda is getting concurrently executed sometimes? If so, is there a way to stop that?