You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a laravel lambda function running on PHP 8.1 / bref 2.0 / php-81-fpm layer
which is facing timeouts when trying to access my API endpoints (timeout is set to 30 seconds).
Upon investigating logs, bref seems to have 2 distinct behaviors upon calling one of my API endpoints :
1st behavior
Requests are gracefully terminated and response is 200 OK
Nevertheless, the execution is taking around 3 seconds to reach my first line of code which is simply logging a BEGIN string
In this first case, bref is not logging anything but something seems to be taking too much time
2nd behavior
Requests are timed out by bref after the 29 seconds threshold.
Bref here consumes all the 29 seconds leaving nothing much for my API to respond, in the logs below we can see how much time bref is taking and interrupting the execution of my endpoint...
023-06-09T23:33:10.117000+00:00 2023/06/09/[$LATEST] START RequestId: 5f6abe22-ba3d-4486-b335-caa990c83bbe Version: $LATEST
2023-06-09T23:33:39.147000+00:00 2023/06/09/[$LATEST] The PHP script timed out. Bref will now restart PHP-FPM to start from a clean slate and flush the PHP logs.
2023-06-09T23:33:39.147000+00:00 2023/06/09/[$LATEST] Timeouts can happen for example when trying to connect to a remote API or database, if this happens continuously check for those.
2023-06-09T23:33:39.147000+00:00 2023/06/09/[$LATEST] If you are using a RDS database, read this: https://bref.sh/docs/environment/database.html#accessing-the-internet
2023-06-09T23:33:39.147000+00:00 2023/06/09/[$LATEST] [2023-06-09 23:33:10] local.INFO: >>>>>> BEGIN 0
2023-06-09T23:33:39.148000+00:00 2023/06/09/[$LATEST] [09-Jun-2023 23:33:39] NOTICE: Terminating ...
2023-06-09T23:33:39.149000+00:00 2023/06/09/[$LATEST] [09-Jun-2023 23:33:39] NOTICE: exiting, bye-bye!
It seems the following bref code is facing some problems but i am stuck as no stacktrace is provided..
FYI to clarify for the second behavior: it's "normal" that the BEGIN 0 line appears after 29 seconds. This is because FPM only flushes logs after the timing is caught (#1133).
So for the 2nd behavior, there's no indication that it's something in Bref taking 29s, it could be the application code.
That being said, the 1st behavior is interesting because clearly BEGIN is written after 3 seconds, which is not normal. The START line is written after Bref is fully initialized, so it could be something in Laravel (when booting the app) that takes a long time?
Description:
Hello,
I have a laravel lambda function running on PHP 8.1 / bref 2.0 / php-81-fpm layer
which is facing timeouts when trying to access my API endpoints (timeout is set to 30 seconds).
Upon investigating logs, bref seems to have 2 distinct behaviors upon calling one of my API endpoints :
1st behavior
Requests are gracefully terminated and response is 200 OK
Nevertheless, the execution is taking around 3 seconds to reach my first line of code which is simply logging a BEGIN string
In this first case, bref is not logging anything but something seems to be taking too much time
2nd behavior
Requests are timed out by bref after the 29 seconds threshold.
Bref here consumes all the 29 seconds leaving nothing much for my API to respond, in the logs below we can see how much time bref is taking and interrupting the execution of my endpoint...
It seems the following bref code is facing some problems but i am stuck as no stacktrace is provided..
The text was updated successfully, but these errors were encountered: