You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/sections/configuration.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,23 +32,27 @@ You may create a file called `app_queue.php` inside your `config` folder (NOT th
32
32
// Legacy: 'defaultworkerretries' is deprecated but still supported
33
33
```
34
34
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:
36
36
37
37
```php
38
-
$config['Queue']['workerLifetime'] = 60; // 1 minutes (same as respawn time)
38
+
$config['Queue']['workerLifetime'] = 60; // 1 minute (same as respawn time)
39
39
// Legacy: 'workermaxruntime' is deprecated but still supported
40
40
```
41
41
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.
43
43
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:
// Legacy: 'workertimeout' is deprecated but still supported
49
51
```
50
52
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.
52
56
53
57
- Should a worker process quit when there are no more tasks for it to execute (true = exit, false = keep running):
Copy file name to clipboardExpand all lines: docs/sections/tips.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,9 +99,9 @@ Thus it is disabled by default for trivial use cases.
99
99
100
100
## Killing workers
101
101
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.
105
105
106
106
Note: The old config names `workermaxruntime` and `workertimeout` are deprecated but still supported.
0 commit comments