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
Copy file name to clipboardExpand all lines: docs/using-the-python-driver/using-plugins/UsingTheFastestResponseStrategyPlugin.md
+6-8Lines changed: 6 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,11 @@
1
1
## 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.
4
3
5
4
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.
6
5
7
6
## Using the Fastest Response Strategy Plugin
8
7
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.
10
9
11
10
> [!IMPORTANT]\
12
11
> **`reader_response_strategy` must be set to `fastest_reponse` when using this plugin. Otherwise an error will be thrown:**
|`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`|
33
32
|`response_measurement_interval_ms`|`Integer`| No | Interval in milliseconds between measuring response time to a database host |`30_000`|
34
33
35
34
36
35
## 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.
39
37
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:
|`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 |
107
107
|`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) |
108
108
|`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 |
0 commit comments