Updated readwritesplit default values

The combination of only one slave being used and the slave_selection_criteria
being LEAST_CURRENT_OPERATIONS can possibly cause a connection pileup on one
slave server. This would skew the query distribution heavily towards the first
available slave even if multiple slave were being used.

Having the maximum number of slave servers to be equal to the total amount of
available slaves allows for a more even and responsive distribution of the
query traffic.
This commit is contained in:
Markus Makela 2015-11-19 18:28:29 +02:00
parent 6164b7f301
commit 422d6f5ab2
2 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,7 @@ passwd=<password>
### `max_slave_connections`
**`max_slave_connections`** sets the maximum number of slaves a router session uses at any moment. Default value is `1`.
**`max_slave_connections`** sets the maximum number of slaves a router session uses at any moment. The default is to use all available slaves.
max_slave_connections=<max. number, or % of available slaves>

View File

@ -698,12 +698,12 @@ createInstance(SERVICE *service, char **options)
router->rwsplit_config.rw_max_sescmd_history_size = 0;
}
/**
* Set default value for max_slave_connections and for slave selection
* criteria. If parameter is set in config file max_slave_connections
* will be overwritten.
/**
* Set default value for max_slave_connections as 100%. This way
* LEAST_CURRENT_OPERATIONS allows us to balance evenly across all the
* configured slaves.
*/
router->rwsplit_config.rw_max_slave_conn_count = CONFIG_MAX_SLAVE_CONN;
router->rwsplit_config.rw_max_slave_conn_count = nservers;
if (router->rwsplit_config.rw_slave_select_criteria == UNDEFINED_CRITERIA)
{