Skip to content

Commit f05f3b3

Browse files
authored
docs: explicitly explain how to use without worker mode (#1275)
1 parent c3031ea commit f05f3b3

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ frankenphp php-cli /path/to/your/script.php
6060

6161
## Docs
6262

63-
* [The worker mode](https://frankenphp.dev/docs/worker/)
63+
* [Classic mode](https://frankenphp.dev/docs/classic/)
64+
* [Worker mode](https://frankenphp.dev/docs/worker/)
6465
* [Early Hints support (103 HTTP status code)](https://frankenphp.dev/docs/early-hints/)
6566
* [Real-time](https://frankenphp.dev/docs/mercure/)
6667
* [Configuration](https://frankenphp.dev/docs/config/)

docs/classic.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Using Classic Mode
2+
3+
Without any additional configuration, FrankenPHP operates in classic mode. In this mode, FrankenPHP functions like a traditional PHP server, directly serving PHP files. This makes it a seamless drop-in replacement for PHP-FPM or Apache with mod_php.
4+
5+
Similar to Caddy, FrankenPHP accepts an unlimited number of connections and uses a [fixed number of threads](config.md#caddyfile-config) to serve them. The number of accepted and queued connections is limited only by the available system resources. The PHP thread pool operates with a fixed number of threads initialized at startup, comparable to the static mode of PHP-FPM.
6+
7+
Queued connections will wait indefinitely until a PHP thread is available to serve them. To prevent that, set a reasonable [write timeout in Caddy](https://caddyserver.com/docs/caddyfile/options#timeouts).
8+
9+
Each Caddy instance will only spin up one FrankenPHP thread pool, which will be shared across all `php_server` blocks.

docs/performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ However, it is possible to substantially improve performance using an appropriat
88
By default, FrankenPHP starts 2 times more threads and workers (in worker mode) than the available numbers of CPU.
99

1010
The appropriate values depend heavily on how your application is written, what it does and your hardware.
11-
We strongly recommend changing these values.
11+
We strongly recommend changing these values. For best system stability, it is recommended to have `num_threads` x `memory_limit` < `available_memory`.
1212

1313
To find the right values, it's best to run load tests simulating real traffic.
1414
[k6](https://k6.io) and [Gatling](https://gatling.io) are good tools for this.

0 commit comments

Comments
 (0)