Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to limit worker execution time #1216

Open
7-zete-7 opened this issue Nov 29, 2024 · 2 comments
Open

Add ability to limit worker execution time #1216

7-zete-7 opened this issue Nov 29, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@7-zete-7
Copy link

7-zete-7 commented Nov 29, 2024

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 #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:

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.

@7-zete-7 7-zete-7 added the enhancement New feature or request label Nov 29, 2024
@AlliBalliBaba
Copy link
Collaborator

Is PHP in your case actually hanging during a request or while booting up the worker script? If PHP becomes unresponsive even though there's a max_execution_time, then yeah we would need to destroy and re-create the thread.

@7-zete-7
Copy link
Author

7-zete-7 commented Dec 9, 2024

In my case, PHP hangs while processing the request (at the application level).

And yes, PHP does not respond to max_execution_time, stream_set_timeout and PDO::ATTR_TIMEOUT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants