Skip to content

Commit cbefc69

Browse files
committed
docs rewording
1 parent 9624544 commit cbefc69

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

aws_advanced_python_wrapper/fastest_response_strategy_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def get_host_info_by_strategy(self, role: HostRole, strategy: str) -> HostInfo:
145145

146146
def notify_host_list_changed(self, changes: Dict[str, Set[HostEvent]]):
147147
self._hosts = self._plugin_service.hosts
148-
if self._host_response_time_service:
148+
if self._host_response_time_service is not None:
149149
self._host_response_time_service.set_hosts(self._hosts)
150150

151151
@dataclass

docs/using-the-python-driver/using-plugins/UsingTheFastestResponseStrategyPlugin.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
## Fastest Response Strategy Plugin
2-
The Fastest Response Strategy Plugin is a host selection strategy plugin that monitors the response time of each reader host, and returns the host with the fastest response time. The plugin stores the fastest host in a cache so it can easily be retrieved again.
3-
2+
The Fastest Response Strategy Plugin is a host selection strategy plugin monitoring the response time of each reader host, and returns the host with the fastest response time. The plugin stores the fastest host in a cache so it can easily be retrieved again.
43

54
The host response time is measured at an interval set by `response_measurement_interval_ms`, at which time the old cache expires and is updated with the current fastest host.
65

76
## Using the Fastest Response Strategy Plugin
87

9-
The plugin can be loaded by adding the plugin code `fastest_response_strategy` to the [`plugins`](../UsingThePythonDriver.md#aws-advanced-python-driver-parameters) parameter. The Fastest Response Strategy Plugin is not loaded by default, and must be loaded along with the `read_write_splitting`.
8+
The plugin can be loaded by adding the plugin code `fastest_response_strategy` to the [`plugins`](../UsingThePythonDriver.md#aws-advanced-python-driver-parameters) parameter. The Fastest Response Strategy Plugin is not loaded by default, and must be loaded along with the `[read_write_splitting](https://github.com/awslabs/aws-advanced-python-wrapper/blob/main/docs/using-the-python-driver/using-plugins/UsingTheReadWriteSplittingPlugin.md)` plugin.
109

1110
> [!IMPORTANT]\
1211
> **`reader_response_strategy` must be set to `fastest_reponse` when using this plugin. Otherwise an error will be thrown:**
@@ -29,15 +28,14 @@ conn = AwsWrapperConnection.connect(psycopg.Connection.connect, **params)
2928
## Configuration Parameters
3029
| Parameter | Value | Required | Description | Default Value |
3130
|------------------------------------|:---------:|:--------:|:--------------------------------------------------------------------------------------------------------|-------------------|
32-
| `reader_response_strategy` | `String` | Yes | Sets the reader response strategy to choose the fastest host using the Fastest Response Strategy Plugin | `fastest_reponse` |
31+
| `reader_response_strategy` | `String` | Yes | Setting to `fastest_reponse` sets the reader response strategy to choose the fastest host using the Fastest Response Strategy Plugin | `random` |
3332
| `response_measurement_interval_ms` | `Integer` | No | Interval in milliseconds between measuring response time to a database host | `30_000` |
3433

3534

3635
## Host Response Time Monitor
37-
Host Response Time Monitoring measures the host response time in a separate monitoring thread. If the monitoring thread has not been called for a response time for 10 minutes, the thread is stopped. When the topology changes, the new hosts will be added to monitoring.
38-
The thread reports the current host response time to the telemetry engine, as well as the number of currently monitored hosts.
36+
The Host Response Time Monitor measures the host response time in a separate monitoring thread. If the monitoring thread has not been called for a response time for 10 minutes, the thread is stopped. When the topology changes, the new hosts will be added to monitoring.
3937

40-
Configuration parameters for a database connection in the host response time monitoring thread may be provided with a prefix `frt-`, as in the following example:
38+
The host response time monitoring thread creates new database connections. By default it uses the same set of connection parameters provided for the main connection, but you can customize these connections with the `frt-` prefix, as in the following example:
4139

4240
```python
4341
import psycopg
@@ -58,7 +56,7 @@ conn = AwsWrapperConnection.connect(
5856
```
5957

6058
> [!IMPORTANT]\
61-
> **If specifying a frt- prefixed timeout, always ensure you provide a non-zero timeout value**
59+
> **When specifying a frt- prefixed timeout, always ensure you provide a non-zero timeout value**
6260
6361
### Sample Code
6462
[Postgres fastest response strategy sample code](../../examples/PGFastestResponseStrategy.py)

docs/using-the-python-driver/using-plugins/UsingTheReadWriteSplittingPlugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ conn = AwsWrapperConnection.connect(psycopg.Connection.connect, **params)
106106
| `round_robin` | The round robin strategy will select a reader instance by taking turns with all available database instances in a cycle. A slight addition to the round robin strategy is the weighted round robin strategy, where more connections will be passed to reader instances based on user specified connection properties. | See the rows `round_robin_host_weight_pairs` and `round_robin_default_weight` for configuration parameters |
107107
| `round_robin_host_weight_pairs` | This parameter value must be a `string` type comma separated list of database host-weight pairs in the format `<host>:<weight>`. The host represents the database instance name, and the weight represents how many connections should be directed to the host in one cycle through all available hosts. For example, the value `instance-1:1,instance-2:4` means that for every connection to `instance-1`, there will be four connections to `instance-2`. <br><br> **Note:** The `<weight>` value in the string must be an integer greater than or equal to 1. | `""` (empty string) |
108108
| `round_robin_default_weight` | This parameter value must be an integer value. This parameter represents the default weight for any hosts that have not been configured with the `round_robin_host_weight_pairs` parameter. For example, if a connection were already established and host weights were set with `round_robin_host_weight_pairs` but a new reader node was added to the database, the new reader node would use the default weight. <br><br> **Note:** This value must be an integer greater than or equal to 1. | 1 |
109-
| `fastest_response` | The fastest_response strategy will select reader instances based on which database instance has the fastest response time. Note that this strategy can only be used when the `fastest_response_strategy` plugin is loaded. See [`Fastest Response Strategy Plugin`](./UsingTheFastestResponseStrategyPlugin.md) | N/A |
109+
| `fastest_response` | The fastest_response strategy will select reader instances based on which database instance has the fastest response time. Note that this strategy requires that the `fastest_response_strategy` and `read_write_splitting` plugins are both enabled. See [`Fastest Response Strategy Plugin`](./UsingTheFastestResponseStrategyPlugin.md) | N/A |
110110

111111
### Limitations
112112

0 commit comments

Comments
 (0)