Skip to content

Commit 3115869

Browse files
committed
Fix docs.
1 parent 2ce6f4e commit 3115869

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

docs/sections/configuration.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,23 +32,27 @@ You may create a file called `app_queue.php` inside your `config` folder (NOT th
3232
// Legacy: 'defaultworkerretries' is deprecated but still supported
3333
```
3434

35-
- Seconds of running time after which the worker process will terminate (0 = unlimited):
35+
- Seconds of running time after which the worker process will terminate:
3636

3737
```php
38-
$config['Queue']['workerLifetime'] = 60; // 1 minutes (same as respawn time)
38+
$config['Queue']['workerLifetime'] = 60; // 1 minute (same as respawn time)
3939
// Legacy: 'workermaxruntime' is deprecated but still supported
4040
```
4141

42-
*Warning:* Do not use 0 if you are using a cronjob to permanently start a new worker once in a while and if you do not exit on idle.
42+
**Important:** This value cannot be 0. A value of 0 would mean "unlimited" which is not supported and will throw a RuntimeException. This setting is required to prevent workers from running indefinitely and potentially piling up if spawned faster than they can terminate, which could overload your server.
4343

44-
- Seconds of running time after which the PHP process of the worker will terminate (0 = unlimited):
44+
If you need workers to run for extended periods, use a very large value (e.g., 86400 for 24 hours). However, it's recommended to use shorter durations (e.g., 60-300 seconds) with cronjob respawning for better control and safety.
45+
46+
- Seconds of running time after which the PHP process of the worker will terminate:
4547

4648
```php
4749
$config['Queue']['workerPhpTimeout'] = 120; // 2 minutes
4850
// Legacy: 'workertimeout' is deprecated but still supported
4951
```
5052

51-
*Warning:* Do not use 0 if you are using a cronjob to permanently start a new worker once in a while and if you do not exit on idle. This is the last defense of the tool to prevent flooding too many processes. So make sure this is long enough to never cut off jobs, but also not too long, so the process count stays in manageable range.
53+
**Important:** While technically 0 (unlimited) is allowed for this setting, it is **strongly discouraged** if you are using a cronjob to permanently start new workers and if you do not exit on idle. This timeout serves as the last line of defense to prevent an excessive number of worker processes from accumulating, which could overload your server.
54+
55+
Set this value high enough to never cut off running jobs, but low enough to keep the process count manageable. A good practice is to set it to at least 2x your `workerLifetime` value.
5256

5357
- Should a worker process quit when there are no more tasks for it to execute (true = exit, false = keep running):
5458

docs/sections/tips.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,9 @@ Thus it is disabled by default for trivial use cases.
9999

100100
## Killing workers
101101

102-
First of all: Make sure you don't run workers with `workerLifetime` and `workerPhpTimeout` of `0`.
103-
Then they would at least not run forever, and might pile up only if you start them faster than they terminate.
104-
That can overload the server.
102+
**Important:** The `workerLifetime` setting cannot be set to 0 - it will throw a RuntimeException if you try. This is by design to prevent workers from running indefinitely and potentially overloading your server. If you need long-running workers, use a very large value instead (e.g., 86400 for 24 hours).
103+
104+
Similarly, avoid setting `workerPhpTimeout` to 0 (unlimited). While technically allowed, this removes the last safeguard against process accumulation and can lead to server overload if workers start faster than they terminate.
105105

106106
Note: The old config names `workermaxruntime` and `workertimeout` are deprecated but still supported.
107107

0 commit comments

Comments
 (0)