HostSelectionStrategies.md
September 17, 2026 ยท View on GitHub
Host Selection Strategies
To balance connections to instances more evenly, different selection strategies can be used. The following table describes the currently available selection strategies and any relevant configuration parameters for each strategy.
| Host Selection Strategy | Configuration Parameter | Description | Default Value | Available Since Version |
|---|---|---|---|---|
random | This strategy does not have configuration parameters. | The random strategy is the default selection strategy. When selecting a host, a random host will be selected from the list of available hosts. | N/A | 2.0.0 |
leastConnections | This strategy does not have configuration parameters. | The least connections strategy will select instances based on which database instance has the least number of currently active connections. Note that this strategy is only available when internal connection pools are enabled - if you set the connection property without enabling internal pools, an exception will be thrown. | N/A | 2.2.0 |
roundRobin | See the following rows for configuration parameters. | The round robin strategy will select an 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 instances based on user specified connection properties. | N/A | 2.2.5 |
roundRobinHostWeightPairs | 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. Note: The <weight> value in the string must be an integer greater than or equal to 1. | null | ||
roundRobinDefaultWeight | This parameter value must be an integer value in the form of a string. This parameter represents the default weight for any hosts that have not been configured with the roundRobinHostWeightPairs parameter. For example, if a connection were already established and host weights were set with roundRobinHostWeightPairs but a new instance was added to the database, the new instance would use the default weight. Note: This value must be an integer greater than or equal to 1. | 1 | ||
fastestResponse | See the following rows for configuration parameters. | The fastest response strategy identifies the fastest response host, then stores this host in a cache for future use. Note: The Fastest Response Strategy plugin must also be loaded into the plugins list by setting the plugins connection configuration parameter to include the fastestResponseStrategy plugin code. When telemetry is enabled, the plugin submits a frt.response.time.[NODE] gauge per monitored node, holding the last measured response time in milliseconds (-1 when it could not be measured). See the list of metrics. | N/A | 2.3.2 |
responseMeasurementIntervalMs | Interval in millis between measuring response time to a database node. | 30000 | ||
highestWeight | This strategy does not have configuration parameters. | Deprecated. Please consider using the lowestLoad instead. Selects the available host with the largest value of HostSpec.weight. The meaning of weight depends on which component populated it. For Aurora Limitless routers it is a fitness score (higher = healthier router with lower CPU), so this strategy picks the healthiest router. For standard Aurora topology, weight is lag*100 + cpu (higher = more loaded), so this strategy would pick the most loaded reader and is therefore inappropriate. Used internally by the Limitless plugin; for Aurora reader load balancing prefer lowestLoad. | N/A | 2.5.0 |
weightedRandom | See the following rows for configuration parameters. | Selects a host using cumulative weighted-random selection. Hosts with higher weights are chosen proportionally more often. By default the per-host weight is read from HostSpec.weight; if weightedRandomHostWeightPairs is set, those values override the per-host weight. :warning: Only use the HostSpec.weight default with a component that populates weight as a preference score. As with highestWeight, the meaning of weight depends on who populated it. For Aurora Limitless routers it is a fitness score (higher = healthier), so weighted-random favours the healthiest routers. For standard Aurora topology, weight is lag*100 + cpu (higher = more loaded), so weighted-random over an Aurora topology sends proportionally more reads to the most loaded reader. Set weightedRandomHostWeightPairs explicitly, or prefer lowestLoad, for Aurora reader load balancing. | N/A | 2.4.0 |
weightedRandomHostWeightPairs | Comma-separated list of database host-weight pairs in the format <host>:<weight>. Weight values must be integers >= 1. Note: must be unset (null) when the Limitless plugin is used, because Limitless populates per-host weights dynamically. | null | ||
lowestLoad | See the following rows for configuration parameters. | The least loaded strategy selects the least-loaded host. Host load is calculated using the host's CPU load and lag. Host load formula: load = lag_ms * lowestLoadLagWeight + cpu_percent * lowestLoadCpuWeight **Note:**CPU and lag metrics may not be available on non-Aurora databases and may not be compatible with the lowest load strategy. | N/A | 4.1.0 |
lowestLoadCpuWeight | The weight of CPU utilization percent in the calculation of a host's load. | 1 | ||
lowestLoadLagWeight | The weight of lag (in milliseconds) in the calculation of a host's load. | 100 | ||
lowestLoadByCpu | See lowestLoad configuration parameters. | A convenience variant of lowestLoad that defaults to CPU-dominant weighting (cpuWeight=100, lagWeight=1). Selects the host with the lowest CPU utilization. The lowestLoadCpuWeight and lowestLoadLagWeight properties can still be set to override these defaults. | N/A | 4.2.0 |
lowestLoadByLag | See lowestLoad configuration parameters. | A convenience variant of lowestLoad that defaults to lag-dominant weighting (cpuWeight=1, lagWeight=100). Equivalent to lowestLoad with default weights, provided for symmetry with lowestLoadByCpu. | N/A | 4.2.0 |
highestLoad | See the following rows for configuration parameters. | The highest loaded strategy selects the highest-loaded host. Host load is calculated using the host's cpu load and lag. Host load formula: load = lag_ms * highestLoadLagWeight + cpu_percent * highestLoadCpuWeight **Note:**CPU and lag metrics may not be available on non-Aurora databases and may not be compatible with the highest load strategy. | N/A | 4.1.0 |
highestLoadCpuWeight | The weight of CPU utilization percent in the calculation of a host's load. | 1 | ||
highestLoadLagWeight | The weight of lag (in milliseconds) in the calculation of a host's load. | 100 | ||
highestLoadByCpu | See highestLoad configuration parameters. | A convenience variant of highestLoad that defaults to CPU-dominant weighting (cpuWeight=100, lagWeight=1). Selects the host with the highest CPU utilization. The highestLoadCpuWeight and highestLoadLagWeight properties can still be set to override these defaults. | N/A | 4.2.0 |
highestLoadByLag | See highestLoad configuration parameters. | A convenience variant of highestLoad that defaults to lag-dominant weighting (cpuWeight=1, lagWeight=100). Equivalent to highestLoad with default weights, provided for symmetry with highestLoadByCpu. | N/A | 4.2.0 |
These strategies are applicable when using the following plugins: