frankenphp icon indicating copy to clipboard operation
frankenphp copied to clipboard

Fix/doc config num threads

Open sergehardy opened this issue 4 months ago • 0 comments

Hi, first PR on that great project.

Having heavily played with configuration in the past weeks, I have noticed using Prometheus metrics frankenphp_total_threads and frankenphp_total_workers that the default value for num_threads changes whether the worker mode is enabled or not.

In other words, with the following restrictions on my compose stack for the FrankenPHP service:

  deploy:
    resources:
      limits:
        cpus: 2

In classic mode : 4 threads are created In worker mode with "num : 4" : 5 threads are created.

So if you happen to explicity set num_threads, it has to be > that num to ensure the request thread is created, otherwise FKPHP won't start and will output this error message:

Error: loading initial config: loading new config: frankenphp app module: start: num_threads (4) must be greater than the number of worker threads (4).

sergehardy avatar Oct 15 '25 12:10 sergehardy