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
Update Documentation to Reflect GatewayD’s Support for Multiple Proxies and Configuration Blocks (#61)
* Added Configuration block into glossary
* made changes related to loadBalancer in server
* made changes related to configuration block for related component clinets, pools,proxies
* fixed pool link in Clients md
* docs: update environment variables format
- Update configuration example to reflect new nested block structure for clients and servers
- Adjust environment variable section to include the new five-part structure
- Update Mermaid diagram to illustrate the five-part environment variable breakdown
* Update using-gatewayd/configuration.md
Co-authored-by: Mostafa Moradian <[email protected]>
Signed-off-by: sina <[email protected]>
* Update using-gatewayd/configuration.md
Co-authored-by: Mostafa Moradian <[email protected]>
Signed-off-by: sina <[email protected]>
* docs: Update README with enhanced server configuration details
- Added detailed descriptions for new load balancer configuration options:
- `consistentHash` settings with `useSourceIp` parameter.
- Support for `loadBalancingRules` and `distribution` parameters for strategies like `WEIGHTED_ROUND_ROBIN`.
- Expanded possible values for `loadBalancer.strategy` to include `RANDOM` and `WEIGHTED_ROUND_ROBIN`.
- Updated example configuration to reflect the new settings and provide clarity on usage.
* Replaced all activeWrites to writes
---------
Signed-off-by: sina <[email protected]>
Co-authored-by: Mostafa Moradian <[email protected]>
Copy file name to clipboardExpand all lines: miscellaneous/glossary.md
+6-1
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
last_modified_date: 2024-05-31 20:16:38
2
+
last_modified_date: 2024-07-30 16:55:16
3
3
layout: default
4
4
title: Glossary
5
5
description: Glossary of GatewayD terms
@@ -28,6 +28,11 @@ Each configuration file contains multiple configuration objects that correspond
28
28
29
29
To enable multi-tenancy, GatewayD supports configuring multiple instances of each (configuration) object using configuration groups. All the default configuration objects have a single configuration group called `default`, except the `API`.
30
30
31
+
## Configuration block
32
+
Within each configuration group, GatewayD allows for further segmentation of settings through the use of configuration blocks. A configuration block represents a specific set of parameters within a configuration group, tailored to a particular instance.
33
+
34
+
Configuration blocks are supported for the following configuration objects: `clients`, `pools` and `proxies`.
35
+
31
36
## Configuration parameter
32
37
33
38
A configuration object has one or many configuration parameters to set up the corresponding object. For example, the `output` parameter on the `logger` object is used to set the outputs by the `default` (configuration group) logger.
Copy file name to clipboardExpand all lines: using-gatewayd/configuration.md
+36-25
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
last_modified_date: 2024-05-31 20:16:38
2
+
last_modified_date: 2024-07-30 16:36:53
3
3
layout: default
4
4
title: Configuration
5
5
description: GatewayD is fully configurable via various sources, including default values, YAML config files, environment variables, CLI flags and plugins.
@@ -74,28 +74,31 @@ metrics:
74
74
75
75
clients:
76
76
default:
77
-
network: tcp
78
-
address: localhost:5432
79
-
tcpKeepAlive: False
80
-
tcpKeepAlivePeriod: 30s# duration
81
-
receiveChunkSize: 8192
82
-
receiveDeadline: 0s# duration, 0ms/0s means no deadline
83
-
receiveTimeout: 0s# duration, 0ms/0s means no timeout
84
-
sendDeadline: 0s# duration, 0ms/0s means no deadline
85
-
dialTimeout: 60s# duration, 0ms/0s means no timeout
86
-
# Retry configuration
87
-
retries: 3# 0 means no retry
88
-
backoff: 1s# duration
89
-
backoffMultiplier: 2.0# 0 means no backoff
90
-
disableBackoffCaps: false
77
+
writes: # ⬅️ Configuration block
78
+
network: tcp
79
+
address: localhost:5432
80
+
tcpKeepAlive: False
81
+
tcpKeepAlivePeriod: 30s# duration
82
+
receiveChunkSize: 8192
83
+
receiveDeadline: 0s# duration, 0ms/0s means no deadline
84
+
receiveTimeout: 0s# duration, 0ms/0s means no timeout
85
+
sendDeadline: 0s# duration, 0ms/0s means no deadline
86
+
dialTimeout: 60s# duration, 0ms/0s means no timeout
87
+
# Retry configuration
88
+
retries: 3# 0 means no retry
89
+
backoff: 1s# duration
90
+
backoffMultiplier: 2.0# 0 means no backoff
91
+
disableBackoffCaps: false
91
92
92
93
pools:
93
94
default:
94
-
size: 10
95
+
writes:
96
+
size: 10
95
97
96
98
proxies:
97
99
default:
98
-
healthCheckPeriod: 60s# duration
100
+
writes:
101
+
healthCheckPeriod: 60s# duration
99
102
100
103
servers:
101
104
default:
@@ -107,6 +110,11 @@ servers:
107
110
certFile: ""
108
111
keyFile: ""
109
112
handshakeTimeout: 5s# duration
113
+
loadBalancer:
114
+
# Load balancer strategies can be found in config/constants.go
115
+
strategy: ROUND_ROBIN
116
+
consistentHash:
117
+
useSourceIp: true
110
118
111
119
api:
112
120
enabled: True
@@ -158,24 +166,27 @@ plugins:
158
166
159
167
## Environment variables
160
168
161
-
All configuration parameters have a corresponding environment variables, except in certain cases. All environment variables are prefixed with `GATEWAYD` and are in snake case. For example, the `GATEWAYD_LOGGERS_DEFAULT_OUTPUT` environment variable can be set to the outputs required by the default logger and consists of four parts:
169
+
All configuration parameters have a corresponding environment variables, except in certain cases. All environment variables are prefixed with `GATEWAYD` and are in snake case. For example, the `GATEWAYD_CLIENTS_DEFAULT_WRITES_NETWORK` environment variable can be set to the network type for the writes in the default client configuration and consists of five parts:
162
170
163
171
1. Prefix: all environment variables are prefixed with `GATEWAYD`.
164
-
2. Object: the configuration object, in this case `LOGGERS`.
172
+
2. Object: the configuration object, in this case `CLIENTS`.
165
173
3. Group: the configuration group, in this case `DEFAULT`.
166
-
4. Parameter: the configuration parameter, in this case `OUTPUT`.
174
+
4. Block: the configuration block, in this case `WRITES` (if applicable).
175
+
5. Parameter: the configuration parameter, in this case `NETWORK`.
Copy file name to clipboardExpand all lines: using-gatewayd/global-configuration/clients.md
+17-16
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
last_modified_date: 2024-05-31 20:16:38
2
+
last_modified_date: 2024-07-29 17:35:18
3
3
layout: default
4
4
title: Clients
5
5
description: GatewayD client configuration
@@ -10,7 +10,7 @@ grand_parent: Using GatewayD
10
10
11
11
# Clients
12
12
13
-
GatewayD supports multiple client configurations. Each client in each configuration group will connect to the same database server specified in the configuration parameters and will be added to its corresponding [pool](pools) based on their configuration group, i.e.`default`.
13
+
GatewayD supports multiple client configurations. Each client within a configuration group will connect to a database server specified in the configuration parameters and will be added to its corresponding [pool](pools) based on their configuration group (e.g.,`default`) and configuration block (e.g., `writes`).
14
14
15
15
## Configuration parameters
16
16
@@ -33,18 +33,19 @@ GatewayD supports multiple client configurations. Each client in each configurat
33
33
```yaml
34
34
clients:
35
35
default:
36
-
network: tcp
37
-
address: localhost:5432
38
-
tcpKeepAlive: False
39
-
tcpKeepAlivePeriod: 30s# duration
40
-
receiveChunkSize: 8192
41
-
receiveDeadline: 0s# duration, 0ms/0s means no deadline
42
-
receiveTimeout: 0s# duration, 0ms/0s means no timeout
43
-
sendDeadline: 0s# duration, 0ms/0s means no deadline
44
-
dialTimeout: 60s# duration, 0ms/0s means no timeout
45
-
# Retry configuration
46
-
retries: 3# 0 means no retry
47
-
backoff: 1s# duration
48
-
backoffMultiplier: 2.0# 0 means no backoff
49
-
disableBackoffCaps: false
36
+
writes:
37
+
network: tcp
38
+
address: localhost:5432
39
+
tcpKeepAlive: False
40
+
tcpKeepAlivePeriod: 30s# duration
41
+
receiveChunkSize: 8192
42
+
receiveDeadline: 0s# duration, 0ms/0s means no deadline
43
+
receiveTimeout: 0s# duration, 0ms/0s means no timeout
44
+
sendDeadline: 0s# duration, 0ms/0s means no deadline
45
+
dialTimeout: 60s# duration, 0ms/0s means no timeout
Copy file name to clipboardExpand all lines: using-gatewayd/global-configuration/proxies.md
+5-4
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
last_modified_date: 2024-05-31 20:16:38
2
+
last_modified_date: 2024-07-30 16:34:34
3
3
layout: default
4
4
title: Proxies
5
5
description: GatewayD proxy configuration
@@ -12,7 +12,7 @@ grand_parent: Using GatewayD
12
12
13
13
The proxy object is used to proxy connections between database clients and servers.
14
14
15
-
GatewayD supports a fixed proxy that creates a pool with a fixed number of connection to the database server. It honors the pool capacity, and if the number of connections from the clients is more than the capacity, new connections will be rejected.
15
+
GatewayD supports multiple proxies, each creating its own pool of connections to the database server. Each proxy pool honors its capacity, and if the number of connections from the clients exceeds the capacity, new connections will be rejected.
16
16
17
17
The PostgreSQL database expects new connections to authenticate before keeping them connected forever, thus the TCP connections from GatewayD will be timed out and dropped. A health check scheduler is started when creating connections to the database. If there are connections available in the available connections pool after the `healthCheckPeriod` is reached, it will remove and recreate new TCP connections to the database and put them in the pool.
| loadBalancer.consistentHash.useSourceIp | boolean | False | True, False | Whether to use the source IP for consistent hashing |
31
+
| loadBalancer.loadBalancingRules | array || List of rules | Optional configuration for strategies that support rules (e.g., WEIGHTED_ROUND_ROBIN) |
32
+
| loadBalancingRules.condition | string | DEFAULT | DEFAULT | Condition for the load balancing rule (currently, only "DEFAULT" is supported) |
33
+
| loadBalancingRules.distribution | array || List of proxyName and weight pairs | Defines the weight distribution for proxies in the load balancing strategy |
34
+
| distribution.proxyName | string || Valid proxy name | Name of the proxy server (e.g., "writes", "reads") |
35
+
| distribution.weight | integer || Positive integer | Weight assigned to a proxy in the load balancing distribution |
0 commit comments