How does FrankenPHP handle sleeping / thread autoscaling / workers? #2419
-
|
I am trying to understand the performance profile of FrankenPHP, and came across a scenario which I am not sure about. Imagine a FrankenPHP instance with 10 workers and no thread autoscaling. Suppose all 10 workers decide to call PHP Similarly, if thread autoscaling is enabled, when all workers are unavailable (e.g. by |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Yes when there are 10 threads and no autoscaling, the maximum number of requests PHP can handle is 10. All other requests will be queued until a PHP thread becomes free. You can also configure If you have If you have certain requests that are interacting with a very slow external API, you can also split the threadpool by path to limit concurrency to certain endpoints. |
Beta Was this translation helpful? Give feedback.
Yes when there are 10 threads and no autoscaling, the maximum number of requests PHP can handle is 10. All other requests will be queued until a PHP thread becomes free. You can also configure
max_wait_timeto set how long these requests are allowed to wait for a thread before just being rejected with 503.If you have
max_threads(autoscaling) configured, new threads will be spawned up to that limit as long as requests are queued for long enough. So the maximum number of concurrent requests PHP can handle ismax_threads.If you have certain requests that are interacting with a very slow external API, you can also split the threadpool by path to limit concurrency to certain endpoints.