Oracle 5.0 Reference Manual page 2611

Table of Contents

Advertisement

Mysqlnd replication and load balancing plugin (mysqlnd_ms)
The
filter implements the 'random' and 'random once' load balancing policies. The 'round robin'
random
load balancing can be configured through the
server selection is possible with the
capable of delivering a certain service, for example, read-your-writes or, not lagging more seconds
behind the master than allowed.
Filters can accept parameters to change their behaviour. The
parameter. If set to true, the filter changes load balancing from random to random once.
sticky
Random picks a random server every time a statement is to be executed. Random once picks a
random server when the first statement is to be executed and uses the same server for the rest of the
PHP request.
One of the biggest strength of the filter concept is the possibility to chain filters. This strength does
not become immediately visible because tje random,
output no more than one server. If a filter reduces the list of candidates for running a statement to only
one server, it makes little sense to use that one server as input for another filter for further reduction of
the list of candidates.
An example filter sequence that will fail:
• Statement to be executed:
• All configured nodes are passed as input to the first filter. Master nodes: master_0. Slave
nodes:slave_0,
slave_1
• Filter: random, argument sticky=1. Picks a random slave once to be used for the rest of the PHP
request. Output: slave_0.
• Output of
and the statement to be executed is passed as input to the next filter. Here:
slave_0
roundrobin, server list passed to filter is: slave_0.
• Filter: roundrobin. Server list consists of one server only, round robin will always return the same
server.
If trying to use such a filter sequence, the plugin may emit a warning like
while creating filter '%s' . Non-multi filter '%s' already created. Stopping
%d. Furthermore, an appropriate error on the connection handle may be set.
in %s on line
A second type of filter exists: multi filter. A multi filter emits zero, one or multiple servers after
processing. The
quality_of_service
upper limit for the slave lag and more than one slave is lagging behind less than the allowed number of
seconds, the filter returns more than one cluster node. A multi filter must be followed by other to further
reduce the list of candidates for statement execution until a candidate is found.
A filter sequence with the
• Statement to be executed:
to all filters.
• All configured nodes are passed as input to the first filter. Master nodes: master_0. Slave nodes:
slave_0, slave_1, slave_2,
• Filter: quality_of_service, rule set: session_consistency (read-your-writes) Output:
• Output of
master_0
roundrobin.
• Filter: roundrobin. Server list consists of one server. Round robin selects master_0.
A filter sequence must not end with a multi filter. If trying to use a filter sequence which ends with a
multi filter the plugin may emit a warning like
roundrobin
filter. The
user
SELECT 1 FROM
filter is an example. If the service quality requested sets an
quality_of_service
SELECT sum(price) FROM orders WHERE order_id =
slave_3
and the statement to be executed is passed as input to the next filter, which is
(mysqlnd_ms) Error in configuration. Last
2591
filter. Setting a 'user defined callback' for
quality_of_service
filter accepts an optional
random
and
roundrobin
DUAL. Passed to all filters.
multi filter followed by a load balancing filter.
filter finds cluster nodes
filters are supposed to
user
(mysqlnd_ms) Error
1. Passed
master_0

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents