[#66] Group pool config parameters

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-10-13 09:41:57 +03:00 committed by Alex Vanin
parent 8d83320120
commit ac5750670f
6 changed files with 131 additions and 100 deletions

View file

@ -10,23 +10,18 @@ There are some custom types used for brevity:
# Structure
| Section | Description |
|-----------------|-------------------------------------------------------|
| no section | [General parameters](#general-section) |
| `wallet` | [Wallet configuration](#wallet-section) |
| `peers` | [Nodes configuration](#peers-section) |
| `logger` | [Logger configuration](#logger-section) |
| `pprof` | [Pprof configuration](#pprof-section) |
| `prometheus` | [Prometheus configuration](#prometheus-section) |
| Section | Description |
|--------------|-------------------------------------------------|
| no section | [General parameters](#general-section) |
| `wallet` | [Wallet configuration](#wallet-section) |
| `pool` | [Pool configuration](#pool-section) |
| `logger` | [Logger configuration](#logger-section) |
| `pprof` | [Pprof configuration](#pprof-section) |
| `prometheus` | [Prometheus configuration](#prometheus-section) |
# General section
```yaml
node-dial-timeout: 10s
healthcheck-timeout: 15s
rebalance-timer: 60s
pool-error-threshold: 100
scheme: [ http ]
cleanup-timeout: 10s
graceful-timeout: 15s
@ -50,10 +45,6 @@ tls-write-timeout: 30s
| Parameter | Type | Default value | Description |
|------------------------|------------|------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `node-dial-timeout` | `duration` | `10s` | Timeout to connect to a node. |
| `healthcheck-timeout` | `duration` | `15s` | Timeout to check node health during rebalance. |
| `rebalance-timer` | `duration` | `60s` | Interval to check node health. |
| `pool-error-threshold` | `uint32` | `100` | The number of errors on connection after which node is considered as unhealthy. |
| `scheme` | `[]string` | `[http]` | The listeners to enable, this can be repeated and defaults to the schemes in the swagger spec. |
| `cleanup-timeout` | `duration` | `10s` | Grace period for which to wait before killing idle connections. |
| `graceful-timeout` | `duration` | `15s` | Grace period for which to wait before shutting down the server. |
@ -87,36 +78,51 @@ wallet:
| `address` | `string` | | Account address to get from wallet. If omitted default one will be used. |
| `passphrase` | `string` | | Passphrase to decrypt wallet. |
# `peers` section
# `pool` section
```yaml
# Nodes configuration
# This configuration makes the gateway use the first node (node1.neofs:8080)
# while it's healthy. Otherwise, gateway uses the second node (node2.neofs:8080)
# for 10% of requests and the third node (node3.neofs:8080) for 90% of requests.
# Until nodes with the same priority level are healthy
# nodes with other priority are not used.
# The lower the value, the higher the priority.
peers:
0:
address: node1.neofs:8080
priority: 1
weight: 1
1:
address: node2.neofs:8080
priority: 2
weight: 0.1
2:
address: node3.neofs:8080
priority: 2
weight: 0.9
pool:
node-dial-timeout: 10s
healthcheck-timeout: 15s
rebalance-timer: 60s
error-threshold: 100
# Nodes configuration
# This configuration makes the gateway use the first node (node1.neofs:8080)
# while it's healthy. Otherwise, gateway uses the second node (node2.neofs:8080)
# for 10% of requests and the third node (node3.neofs:8080) for 90% of requests.
# Until nodes with the same priority level are healthy
# nodes with other priority are not used.
# The lower the value, the higher the priority.
peers:
0:
address: node1.neofs:8080
priority: 1
weight: 1
1:
address: node2.neofs:8080
priority: 2
weight: 0.1
2:
address: node3.neofs:8080
priority: 2
weight: 0.9
```
| Parameter | Type | Default value | Description |
|------------|----------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `address` | `string` | | Address of storage node. |
| `priority` | `int` | `1` | It allows to group nodes and don't switch group until all nodes with the same priority will be unhealthy. The lower the value, the higher the priority. |
| `weight` | `float` | `1` | Weight of node in the group with the same priority. Distribute requests to nodes proportionally to these values. |
| Parameter | Type | Default value | Description |
|-----------------------|------------|---------------|---------------------------------------------------------------------------------|
| `node-dial-timeout` | `duration` | `10s` | Timeout to connect to a node. |
| `healthcheck-timeout` | `duration` | `15s` | Timeout to check node health during rebalance. |
| `rebalance-timer` | `duration` | `60s` | Interval to check node health. |
| `error-threshold` | `uint32` | `100` | The number of errors on connection after which node is considered as unhealthy. |
## `peers` section
| Parameter | Type | Default value | Description |
|------------------------|------------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|
| `address` | `string` | | Address of storage node. |
| `priority` | `int` | `1` | It allows to group nodes and don't switch group until all nodes with the same priority will be unhealthy. The lower the value, the higher the priority. |
| `weight` | `float` | `1` | Weight of node in the group with the same priority. Distribute requests to nodes proportionally to these values. |
# `logger` section