Skip to content

Commit ad3b88c

Browse files
committed
doc(config): add a section for worker and thread numbers requirements
1 parent 6665004 commit ad3b88c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/worker.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ docker run \
127127
dunglas/frankenphp
128128
```
129129

130+
130131
### Restart the Worker After a Certain Number of Requests
131132

132133
As PHP was not originally designed for long-running processes, there are still many libraries and legacy codes that leak memory.
@@ -163,6 +164,13 @@ frankenphp {
163164
}
164165
```
165166

167+
### Number of threads
168+
169+
When the worker mode is enabled, an additional thread is required to handle the incoming requests,
170+
so the default `num_threads` value is `1 + 2x(number of available CPUs)`.
171+
172+
Thus, in that mode if `num_threads` and `num` are explicitly set, `num_threads` must be strictly greater then `num`.
173+
166174
## Superglobals Behavior
167175

168176
[PHP superglobals](https://www.php.net/manual/en/language.variables.superglobals.php) (`$_SERVER`, `$_ENV`, `$_GET`...)

0 commit comments

Comments
 (0)