Skip to content

Commit c11bff2

Browse files
authored
[#32]: v2024.3 docs update
2 parents 07b3204 + 37cf7f8 commit c11bff2

18 files changed

+401
-128
lines changed

.gitbook.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
root: ./
22

3-
structure:
3+
structure:
44
readme: README.md
5-
summary: SUMMARY.md
5+
summary: SUMMARY.md

SUMMARY.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
* [Code Coverage](php/codecoverage.md)
1919
* [Debugging](php/debugging.md)
2020
* [Environment](php/environment.md)
21-
* [Dynamic scaling](php/scaling.md)
21+
* [Manual workers scaling](php/manual-scaling.md)
22+
* [Auto workers scaling](php/auto-scaling.md)
2223
* [RPC](php/rpc.md)
2324

2425
## 🚀 Customization
@@ -122,6 +123,7 @@
122123

123124
## 📚 Releases
124125

126+
* [v2024.3.0](releases/v2024-3-0.md)
125127
* [v2024.2.1](releases/v2024-2-1.md)
126128
* [v2024.2.0](releases/v2024-2-0.md)
127129
* [v2024.1.5](releases/v2024-1-5.md)

app-server/aws-lambda.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ logs:
341341
mode: production
342342
level: error
343343
encoding: json
344-
output: stderr
344+
output: [ stderr ]
345345

346346
endure:
347347
grace_period: 1s

http/http.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ http:
373373
# directory to store your certificate and key from the LE
374374
#
375375
# Default: rr_cache_dir
376-
certs_dir: rr_le_certs
376+
cache_dir: rr_le_certs
377377
# Your email
378378
#
379379
# Mandatory. Error on empty.

kv/redis.md

+29
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,20 @@ kv:
9494
# Optional section.
9595
# Default: false
9696
read_only: false
97+
98+
# Optional section.
99+
tls:
100+
# Optional section.
101+
# Default: ""
102+
cert: ""
103+
104+
# Optional section.
105+
# Default: ""
106+
key: ""
107+
108+
# Optional section.
109+
# Default: ""
110+
root_ca: ""
97111
```
98112
99113
{% endcode %}
@@ -176,6 +190,21 @@ suffix". A value of `0` is equivalent to a timeout of 512 milliseconds (`512ms`)
176190
every CPU. Please note that specifying the value corresponds to the number of connections **per core**, so if you have 8
177191
cores in your system, then setting the option to 2 you will get 16 connections.
178192

193+
### TLS Configuration
194+
195+
The `tls` section allows you to configure Transport Layer Security (TLS) for secure communication with the Redis server.
196+
If no options are defined in this section, the connection will default to non-TLS.
197+
198+
`cert`: Path to a file containing the client certificate. This certificate is used to authenticate the client
199+
when communicating with the server.
200+
201+
`key`: Path to a file containing the client private key. This key is used in conjunction with the client
202+
certificate for mutual authentication.
203+
204+
`root_ca`: Path to a file containing the Certificate Authority (CA) certificates used to verify the server's certificate.
205+
**Note**: This option can be used independently of the `cert` and `key` options. In cases where the server does not
206+
require client certificate verification, you only need to provide the `root_ca` option.
207+
179208
### Other
180209

181210
`min_idle_conns`: Minimum number of idle connections which is useful when establishing new connection is slow. A value

lab/health.md

+17-5
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,29 @@ status:
2424
The above configuration sets the address to `127.0.0.1:2114`. This is the address that the plugin will listen to. You
2525
can change the address to any IP address and port number of your choice.
2626

27-
To access the health check, you need to use the following URL: http://127.0.0.1:2114/health?plugin=http. This URL will
28-
return the health status of the http plugin.
27+
To access the health check, use the following URL: `http://127.0.0.1:2114/health`. This URL will return the health status of all plugins that are enabled and support health probes. To specify a particular plugin, you need to use the `plugin` query parameter: `http://127.0.0.1:2114/health?plugin=http`. In that case, the health status of the `http` plugin will be returned.
2928

3029
{% hint style="info" %}
3130
You can specify multiple plugins by separating them with a comma. For example, to check the health status of both the
3231
http and grpc plugins, you can use the following URL: http://127.0.0.1:2114/health?plugin=http&plugin=grpc.
3332
{% endhint %}
3433

35-
The health check endpoint will return `HTTP 200` if there is at least one worker ready to serve requests. If there are
36-
no workers ready to service requests, the endpoint will return `HTTP 500`. If there are any other errors, the endpoint
37-
will also return `HTTP 500`.
34+
The health check endpoint will return `HTTP 200` if there is at least one worker ready to serve requests. If there are no workers ready to service requests, the endpoint will return `HTTP 503` (or your unavailable status code, which can be set via configuration of the plugin). If there are any other errors, the endpoint will also return `HTTP 503` (or your unavailable status code). The `status` plugin also returns a payload with a list of checked plugins and errors, if any, in the following format:
35+
36+
```json
37+
[
38+
{
39+
"plugin_name": "http",
40+
"error_message": "",
41+
"status_code": 200
42+
},
43+
{
44+
"plugin_name": "grpc",
45+
"error_message": "some error message",
46+
"status_code": 404
47+
}
48+
]
49+
```
3850

3951
The readiness check endpoint will return `HTTP 200` if there is at least one worker ready to take the request (i.e., not
4052
currently busy with another request). If there is no worker ready or all workers are busy, the endpoint will return

lab/logger.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ the output key.
9595

9696
```yaml
9797
logs:
98-
output: stdout
98+
output: [ stdout ]
9999
```
100100

101101
{% endcode %}
@@ -131,7 +131,7 @@ logs:
131131
channels:
132132
http:
133133
mode: production
134-
output: http.log
134+
output: [ http.log ]
135135
```
136136
137137
{% endcode %}

php/auto-scaling.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Auto Workers Scaling
2+
3+
## Introduction
4+
5+
This feature became available starting from the RoadRunner `2024.3` release.
6+
Users can now scale their RoadRunner workers automatically, up to 100 additional workers.
7+
8+
### Supported plugins
9+
10+
- All plugins that support workers pool are supported.
11+
12+
### Limitations
13+
14+
- This feature is not available when running RoadRunner in debug mode (`*.pool.debug=true`).
15+
- This feature does not scale Temporal Workerflow worker, only activity workers.
16+
17+
### Usage
18+
19+
Below is a configuration example demonstrating how to use this new feature:
20+
21+
{% code title=".rr.yaml" %}
22+
23+
```yaml
24+
version: '3'
25+
26+
rpc:
27+
listen: tcp://127.0.0.1:6002
28+
29+
server:
30+
command: "php worker.php"
31+
32+
http:
33+
address: 127.0.0.1:10085
34+
pool:
35+
num_workers: 2
36+
allocate_timeout: 60s
37+
destroy_timeout: 1s
38+
dynamic_allocator:
39+
max_workers: 25
40+
spawn_rate: 10
41+
idle_timeout: 10s
42+
43+
logs:
44+
mode: development
45+
level: debug
46+
```
47+
48+
{% endcode %}
49+
50+
### Configuration
51+
52+
The new `dynamic_allocator` section has been added to the `*.pool` configuration. It contains the following parameters:
53+
- `max_workers` - the maximum number of workers that can be additionally spawned.
54+
- `spawn_rate` - the number of workers that can be spawned per NoFreeWorkers error (but up to `max_workers`).
55+
- `idle_timeout` - the time after which dynamically allocated workers are considered not needed and would be deallocated.

php/developer.md

+7
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ number of messages consumed.
9292
This enables you to make changes to your codebase and reload it automatically.
9393
{% endhint %}
9494

95+
96+
## RoadRunner-Temporal Debug Mode
97+
98+
{% hint style="warning" %}
99+
Note, that in the Temporal plugin, `pool` is actually called `activities`. All other `pool` options are the same. For example, `pool.num_workers` is `activities.num_workers`.
100+
{% endhint %}
101+
95102
## Stop Command
96103

97104
In RoadRunner, you can send a `stop` command from the worker to the parent server to force process destruction. When
File renamed without changes.

php/rpc.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ Once you have created `$rpc` instance, you can use it to call embedded RPC servi
9090
{% code title="worker.php" %}
9191

9292
```php
93-
$result = $rpc->call('informer.Workers', 'http');
93+
$result = $rpc->call('informer.AddWorker', 'http');
9494
9595
var_dump($result);
9696
```
9797

9898
{% endcode %}
9999

100-
{% hint style="warning" %}
100+
{% hint style="warning" %}
101101
In the case of running workers in debug mode `http: { pool.debug: true }` the number of http workers will be zero
102102
(i.e. an empty array `[]` will be returned).
103103

@@ -165,19 +165,19 @@ final class MetricsIgnoreResponse implements MetricsInterface
165165
166166
public function sub(string $name, float $value, array $labels = []): void
167167
{
168-
168+
169169
$this->rpc->callIgnoreResponse('metrics.Sub', compact('name', 'value', 'labels'));
170170
}
171171
172172
public function observe(string $name, float $value, array $labels = []): void
173173
{
174-
174+
175175
$this->rpc->callIgnoreResponse('metrics.Observe', compact('name', 'value', 'labels'));
176176
}
177177
178178
public function set(string $name, float $value, array $labels = []): void
179179
{
180-
180+
181181
$this->rpc->callIgnoreResponse('metrics.Set', compact('name', 'value', 'labels'));
182182
}
183183

plugins/tcp.md

+8-9
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ tcp:
6060
max_jobs: 0
6161
allocate_timeout: 60s
6262
destroy_timeout: 60s
63+
64+
# The size of the read buffer in MB. Can be increased to reduce the number of read syscalls.
65+
# Consider using a larger buffer size if you expect to receive large payloads on the TCP server.
66+
# Optional; example.
67+
read_buf_size: 20
6368
```
6469
6570
{% endcode %}
@@ -110,15 +115,9 @@ tcp:
110115
- `addr`: The server address and port, specified in the format `tcp://<IP_ADDRESS>:<PORT>`.
111116
- `delimiter`: (Optional) The data packet delimiter. By default, it is set to `\r\n`. Each data packet should end
112117
either with an `EOF` or the specified delimiter.
113-
- `read_buf_size`: (Optional) The size of the read buffer in MB. To reduce the number of read syscalls, consider
114-
using a larger buffer size if you expect to receive large payloads on the TCP server.
115-
116-
- `pool`: Configuration for the PHP worker pool.
117-
- `num_workers`: The number of PHP workers to allocate.
118-
- `max_jobs`: The maximum number of jobs each worker can handle. Set to 0 for no limit.
119-
- `allocate_timeout`: The timeout for worker allocation, specified in the format `<VALUE>s` (e.g., `60s` for 60
120-
seconds).
121-
- `destroy_timeout`: The timeout for worker destruction, specified in the same format as allocate_timeout.
118+
119+
- `pool`: Configuration for the PHP worker pool for the TCP servers. See
120+
https://docs.roadrunner.dev/docs/php-worker/pool for available parameters.
122121

123122
## PHP client
124123

queues/amqp.md

+12-17
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ implementations is not guaranteed.
1313
To install and configure the RabbitMQ, use the
1414
corresponding [documentation page](https://www.rabbitmq.com/download.html).
1515

16+
{% hint style="info" %}
17+
Every messages pushed to the RabbitMQ server uses the publiser confirms. This means that the message is only considered as sent when the server confirms it. This is a reliable way to ensure that the message is delivered to the server.
18+
{% endhint %}
19+
20+
1621
After that, you should configure the connection to the server in the `amqp` section. This configuration section
1722
contains exactly one `addr` key with a [connection DSN](https://www.rabbitmq.com/uri-spec.html). The `TLS` configuration sits in the `amqp.tls` section and consists of the following options:
1823

@@ -67,7 +72,7 @@ the queue settings, including those specific to AMQP.
6772
version: "3"
6873

6974
amqp:
70-
addr: amqp://guest:[email protected]:5672
75+
addr: amqp://guest:[email protected]:5672
7176

7277
# AMQPS TLS configuration
7378
#
@@ -117,11 +122,6 @@ jobs:
117122
# If the job has priority set to 0, it will inherit the pipeline's priority. Default: 10.
118123
priority: 1
119124

120-
# Consume any payload type (not only Jobs structured)
121-
#
122-
# Default: false
123-
consume_all: false
124-
125125
# Redial timeout (in seconds). How long to try to reconnect to the AMQP server.
126126
#
127127
# Default: 60
@@ -215,17 +215,12 @@ from `pipe1` have been processed.
215215

216216
### Prefetch
217217

218-
`prefetch` - rabbitMQ QoS prefetch. See also ["prefetch-size"](https://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.qos.prefetch-size). Note that if you use a large number of workers and a small `prefetch` number, some of the workers may not be loaded with messages (jobs) due to the blocking nature of the prefetch. This would result in poor RoadRunner performance and waste of resources.
218+
`prefetch` - rabbitMQ QoS prefetch. See also ["prefetch-size"](https://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.qos.prefetch-size). Note that if you use a large number of workers and a small `prefetch` number, some of the workers may not be loaded with messages (jobs) due to the blocking nature of the prefetch. This would result in poor RoadRunner performance and waste of resources.
219219

220220
### Queue
221221

222222
`queue` - required, AMQP internal (inside the driver) queue name.
223223

224-
### Consume all
225-
226-
`consume_all` - by default, RoadRunner only supports `Jobs` structures from the queue. Enable this option by setting it
227-
to true if you wish to consume raw payloads as well.
228-
229224
### Exchange
230225

231226
`exchange` - required, rabbitMQ exchange name.
@@ -267,13 +262,13 @@ Read more about Nack in RabbitMQ official docs: https://www.rabbitmq.com/confirm
267262

268263
### Durable
269264

270-
`durable` - create a durable queue.
265+
`durable` - create a durable queue.
271266

272267
Default: `false`
273268

274269
### Delete queue on stop
275270

276-
`delete_queue_on_stop` - delete the queue when the pipeline is stopped.
271+
`delete_queue_on_stop` - delete the queue when the pipeline is stopped.
277272

278273
Default: `false`
279274

@@ -284,20 +279,20 @@ Default: `false`
284279
### Exchange durable
285280

286281
`exchange_durable` - Durable
287-
exchange ([rabbitmq option](https://www.rabbitmq.com/tutorials/amqp-concepts.html#exchanges)).
282+
exchange ([rabbitmq option](https://www.rabbitmq.com/tutorials/amqp-concepts.html#exchanges)).
288283

289284
Default: `false`
290285

291286
### Exchange auto delete
292287

293-
`exchange_auto_delete` - Auto-delete (exchange is deleted when last queue is unbound from it): [link](https://www.rabbitmq.com/tutorials/amqp-concepts.html#exchanges).
288+
`exchange_auto_delete` - Auto-delete (exchange is deleted when last queue is unbound from it): [link](https://www.rabbitmq.com/tutorials/amqp-concepts.html#exchanges).
294289

295290
Default: `false`
296291

297292
### Queue auto delete
298293

299294
`queue_auto_delete` - Auto-delete (queue that has had at least one consumer is deleted when last consumer
300-
unsubscribes): [link](https://www.rabbitmq.com/queues.html#properties).
295+
unsubscribes): [link](https://www.rabbitmq.com/queues.html#properties).
301296

302297
Default: `false`
303298

queues/beanstalk.md

-9
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,6 @@ jobs:
4646
# Default: 10
4747
priority: 10
4848

49-
# Consume any payload type (not only Jobs structured)
50-
# Default: false
51-
consume_all: false
52-
5349
# Optional section.
5450
# Default: 1
5551
tube_priority: 1
@@ -82,8 +78,3 @@ value should not exceed `int32` size.
8278
### Tube
8379

8480
`tube` - The name of the inner "tube" specific to the Beanstalk driver.
85-
86-
### Consume all
87-
88-
`consume_all` - By default, RR supports only `Jobs` structures from the queue. Set this option to true if you want to
89-
also consume the raw payloads.

0 commit comments

Comments
 (0)