-
Notifications
You must be signed in to change notification settings - Fork 16
v2024.3 docs update #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
96d7dcb
713c2c9
951c603
10c57a0
ccfb465
cfd26f2
845a7e0
33fb9f0
522f022
bc1b4fe
fdcee28
37cf7f8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
root: ./ | ||
|
||
structure: | ||
structure: | ||
readme: README.md | ||
summary: SUMMARY.md | ||
summary: SUMMARY.md |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -95,7 +95,7 @@ the output key. | |
|
||
```yaml | ||
logs: | ||
output: stdout | ||
output: [ stdout ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Breaking Change: Output format now requires array syntax The configuration format for Consider adding a migration note at the beginning of this section to help users update their existing configurations, for example: > **Breaking Change**: Starting from version 2024.3, the `output` configuration requires array syntax.
> Update your configuration from `output: stdout` to `output: [ stdout ]`. |
||
``` | ||
|
||
{% endcode %} | ||
|
@@ -131,7 +131,7 @@ logs: | |
channels: | ||
http: | ||
mode: production | ||
output: http.log | ||
output: [ http.log ] | ||
``` | ||
|
||
{% endcode %} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Auto Workers Scaling | ||
|
||
## Introduction | ||
|
||
This feature became available starting from the RoadRunner `2024.3` release. | ||
Users can now scale their RoadRunner workers automatically, up to 100 additional workers. | ||
|
||
### Supported plugins | ||
|
||
- All plugins that support workers pool are supported. | ||
|
||
### Limitations | ||
|
||
- This feature is not available when running RoadRunner in debug mode (`*.pool.debug=true`). | ||
- This feature does not scale Temporal Workerflow worker, only activity workers. | ||
|
||
### Usage | ||
|
||
Below is a configuration example demonstrating how to use this new feature: | ||
|
||
{% code title=".rr.yaml" %} | ||
|
||
```yaml | ||
version: '3' | ||
|
||
rpc: | ||
listen: tcp://127.0.0.1:6002 | ||
|
||
server: | ||
command: "php worker.php" | ||
|
||
http: | ||
address: 127.0.0.1:10085 | ||
pool: | ||
num_workers: 2 | ||
allocate_timeout: 60s | ||
destroy_timeout: 1s | ||
dynamic_allocator: | ||
max_workers: 25 | ||
spawn_rate: 10 | ||
idle_timeout: 10s | ||
|
||
logs: | ||
mode: development | ||
level: debug | ||
``` | ||
|
||
{% endcode %} | ||
|
||
### Configuration | ||
|
||
The new `dynamic_allocator` section has been added to the `*.pool` configuration. It contains the following parameters: | ||
- `max_workers` - the maximum number of workers that can be additionally spawned. | ||
- `spawn_rate` - the number of workers that can be spawned per NoFreeWorkers error (but up to `max_workers`). | ||
- `idle_timeout` - the time after which dynamically allocated workers are considered not needed and would be deallocated. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -86,10 +86,11 @@ while (true) { | |
// | ||
// Reply by the 500 Internal Server Error response | ||
$psr7->respond(new Response(500, [], 'Something Went Wrong!')); | ||
|
||
// Additionally, we can inform the RoadRunner that the processing | ||
// of the request failed. | ||
$psr7->getWorker()->error((string)$e); | ||
// of the request failed. Use error instead of response to indicate | ||
// worker error, do not use both. | ||
// $psr7->getWorker()->error((string)$e); | ||
Comment on lines
+89
to
+93
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Enhance error handling documentation with examples and implications. While the comment clarifies that
try {
// Application code here
$psr7->respond(new Response(200, [], 'Success!'));
} catch (WorkerException $e) {
// Worker-level errors (initialization, configuration, etc.)
$psr7->getWorker()->error((string)$e);
} catch (\Throwable $e) {
// Request-level errors (validation, not found, etc.)
$psr7->respond(new Response(500, [], 'Internal Server Error'));
}
|
||
} | ||
} | ||
``` | ||
|
@@ -222,7 +223,6 @@ final class HttpDispatcher implements DispatcherInterface | |
$worker->respond(new Response(200, [], 'Hello RoadRunner!')); | ||
} catch (\Throwable $e) { | ||
$worker->respond(new Response(500, [], 'Something Went Wrong!')); | ||
$worker->getWorker()->error((string)$e); | ||
} | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation needs improvement for the configuration change
The rename from
certs_dir
tocache_dir
requires additional documentation:The default value is inconsistently documented:
Migration guidance is missing for users updating from previous versions.
Consider adding:
certs_dir
tocache_dir