brefphp / laravel-bridge

Package to use Laravel on AWS Lambda with Bref
https://bref.sh/docs/frameworks/laravel.html
MIT License
319 stars 63 forks source link

Job processed but lambda function time out #46

Closed otezz closed 3 years ago

otezz commented 3 years ago

Hi,

I create a test app for this package on https://github.com/otezz/test-bref-queue. I can see jobs from laravel are processed and record inserted to RDS successfully, but it seems that the job not quitting immediately and idling until the lambda function time out causing the task marked as failed.

Is there something wrong with my configurations?

deleugpn commented 3 years ago

Do you see the log line on CloudWatch as well?

otezz commented 3 years ago

Yes, I can see the log line

Here's screenshot from cloudwatch image

The task run 3 times before moved to dead-letter

deleugpn commented 3 years ago

Maybe you can try to increase the timeout to see if it solves it (by just giving a bit more time). Timeout are common when your Lambda is in a VPC without NAT Gateway because you lose access to the internet. However, I don't detect any reason why your project would be trying to connect to the internet

https://bref.sh/docs/environment/database.html#accessing-the-internet

otezz commented 3 years ago

I've increased the timeout to 120s but still timed out

image

Is it possible to install new relic's apm to the app to see which function taking too long?

otezz commented 3 years ago

So I managed to make it work by deploying worker in other VPC that have NAT gateway in it. I'm not sure why I need NAT gateway since my function doesn't need to connect to the internet

image