Add ability to limit worker execution time
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 11.3k
- Forks
- 488
- Avg merge
- 4d 10h
- Merged PRs (30d)
- 11
Description
Currently, in worker mode, the execution time limit is entirely PHP's responsibility via the max_execution_time directive. However, there are cases when PHP does not react to the execution time exceeding this directive.
One example of the problem of ignoring the max_execution_time directive was described in https://github.com/dunglas/frankenphp/issues/1162: when connecting to an unavailable database, PHP hangs and stops following the max_execution_time directive.
This behavior leads to blocking workers until they finish. This eventually leads to "Connection timeout" errors.
Similar implementations already exist in:
- Caddy HTTP Server (see https://caddyserver.com/docs/caddyfile/directives/php_fastcgi#read_timeout)
- Nginx (see https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_read_timeout)
- Apache HTTP Server (see https://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html#FcgidBusyTimeout)
Unlike the above implementations, FrankenPHP has the ability to communicate with PHP. It would be great if the execution time could also be configured from PHP code, or if FrankenPHP would react to the call to the set_time_limit function.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing worker-mode execution and how PHP's max_execution_time and set_time_limit are handled. Compare the requested behavior with Caddy's read_timeout, Nginx's fastcgi_read_timeout, and Apache's FcgidBusyTimeout; done means a configurable limit prevents blocked workers and is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100