Skip to content

Remove PHP-FPM's 30 second CPU time limit - #365

Merged
mnapoli merged 2 commits into
4.xfrom
fpm-max-execution-time
Nov 24, 2026
Merged

mnapoli merged 2 commits into
4.xfrom
fpm-max-execution-time

Conversation

@mnapoli

@mnapoli mnapoli commented Nov 24, 2026

Copy link
Copy Markdown
Member

max_execution_time was not set in the layers, so PHP-FPM used PHP's default: 30 seconds. On Linux, that limit counts CPU time only, whatever the timeout of the Lambda function. A CPU-heavy request (PDF generation, a spreadsheet export…) in a function with timeout: 120 failed with Maximum execution time of 30 seconds exceeded after 30 seconds of CPU.

It also never helped with real timeouts: waiting for a database or an API doesn't count as CPU time. Bref already stops PHP-FPM requests 1 second before the Lambda timeout, counting the time spent waiting, and brefphp/bref#2316 makes network calls fail before that.

The CLI is unchanged: it has no limit. Applications can still set a limit in php/conf.d.

Behaviour change, hence v4 only.

PHP-FPM defaulted to max_execution_time=30 (CPU time), whatever the
Lambda function's timeout: a CPU-heavy request in a function with a
longer timeout failed after 30 seconds of CPU. Bref already stops
requests before the Lambda timeout.
@mnapoli mnapoli self-assigned this Nov 24, 2026
mnapoli added a commit to brefphp/bref that referenced this pull request Nov 24, 2026
@mnapoli
mnapoli merged commit 93a0427 into 4.x Nov 24, 2026
9 checks passed
@mnapoli
mnapoli deleted the fpm-max-execution-time branch November 24, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant