Skip to content

Conversation

@AlliBalliBaba
Copy link
Contributor

@AlliBalliBaba AlliBalliBaba commented Sep 4, 2025

This PR allows having multiple workers with the same entrypoint (if they match a path)
This allows splitting the worker pool, which can be useful in cases like #1796.

php {
    worker index.php {
        match /slow-requests/* # dedicated pool for fetching from a slow external api
    }
    worker index.php {
        match * # all other requests handled by separate pool
    }
}

Copy link
Member

@alexandre-daubois alexandre-daubois left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm 👍 on this feature. Can be useful, especially given the diff to implement it! The docs should be updated as well I guess?

@dunglas
Copy link
Member

dunglas commented Sep 8, 2025

LGTM. Could you just add some docs?

@AlliBalliBaba
Copy link
Contributor Author

Yeah, will do 👍 , got some time tomorrow on the train

@AlliBalliBaba
Copy link
Contributor Author

Added some docs. I wonder if splitting the thread pool could also be done automatically.
We could theoretically analyze which endpoints tend to take multiple seconds and prevent them from consuming all server resources. Something to think about.

@dunglas dunglas merged commit 960dd20 into main Sep 9, 2025
23 checks passed
@dunglas
Copy link
Member

dunglas commented Sep 9, 2025

Thanks!

@dunglas dunglas deleted the feat/multiple-workers-with-same-path branch September 9, 2025 12:27
henderkes pushed a commit to static-php/frankenphp that referenced this pull request Sep 11, 2025
* Allow multiple workers with the same file.

* Fix formatting of duplicate filename check

* Adds docs.

* suggestions by @alexandre-daubois.

* Update performance.md

---------

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
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.

4 participants