brefphp / bref

Serverless PHP on AWS Lambda
https://bref.sh
MIT License
3.05k stars 364 forks source link

max_execution_time not working #1810

Closed olivier-sabban closed 1 month ago

olivier-sabban commented 1 month ago

Description:

Hi,

I’m working on a project using Bref and need to increase a default execution time of 30 seconds to 60 sec

Here are the steps I’ve taken so far:

  1. I modified the serverless.yml file to set the timeout to 30 seconds.
  2. Despite this, the execution time did not change as expected, so I then modified the php.ini file.

image

image image image

Currently, the execution can exceed 30 seconds, but I am encountering a CloudFront error if the execution time is between 30 and 60 secondes. Interestingly, the CloudWatch error "The request ***** timed out after 58992 ms. Note: that duration may be lower than the Lambda timeout...." that I was previously receiving has disappeared when the execution time is between 30 and 60 secondes evenif CloudFront return a error.

image image

Execution over 60sec. This one is ok :

image

Could you please advise on what might be causing the CloudFront error and what further steps I might need to take to increase execution time ?

Thank you!

mnapoli commented 1 month ago

Just a quick search gave me this

Screen-001775

have you configured cloudfront at some point?

olivier-sabban commented 1 month ago

I changed "Response timeout" in CloudFront > Distributions

image

I still have error with 503 code :

image

No error from lambda in cloudwatch.

I also tryed to change api gateway timeout. I must not be in the right place; I find it surprising that one cannot have a request for 30 seconds on API GATEWAY.

image
mnapoli commented 1 month ago

Wait are you using API gateway? That cannot work then, API gateway doesn't allow that. Please post all the details of your stack so that we can save some time.