Mysqlnd replication and load balancing plugin (
mysqlnd_ms
)
2589
Please note, since version 1.5.0 automatic failover is disabled for the duration of a transaction if
transaction stickiness is enabled and transaction boundaries have been detected. The plugin will
not switch connections for the duration of a transaction. It will also not perform automatic and silent
failover. Instead an error will be thrown. It is then left to the user to handle the failure of the transaction.
Please check, the
trx_stickiness
documentation how to do this.
A basic manual failover example is provided within the
error handling
section.
Standby servers
Using
weighted load balancing
, introduced in PECL/mysqlnd 1.4.0, it is possible to configure standby
servers that are sparsely used during normal operations. A standby server that is primarily used as
a worst-case standby failover target can be assigned a very low weight/priority in relation to all other
servers. As long as all servers are up and running the majority of the workload is assigned to the
servers which have hight weight values. Few requests will be directed to the standby system which has
a very low weight value.
Upon failure of the servers with a high priority, you can still failover to the standby, which has been
given a low load balancing priority by assigning a low weight to it. Failover can be some manually or
automatically. If done automatically, you may want to combine it with the
remember_failed
option.
At this point, it is not possible to instruct the load balancer to direct no requests at all to a standby.
This may not be much of a limitation given that the highest weight you can assign to a server is 65535.
Given two slaves, of which one shall act as a standby and has been assigned a weight of 1, the
standby will have to handle far less than one percent of the overall workload.
Failover and primary copy
Please note, if using a primary copy cluster, such as MySQL Replication, it is difficult to do connection
failover in case of a master failure. At any time there is only one master in the cluster for a given
dataset. The master is a single point of failure. If the master fails, clients have no target to fail over write
requests. In case of a master outage the database administrator must take care of the situation and
update the client configurations, if need be.
20.7.6.5.6. Load balancing
Copyright 1997-2012 the PHP Documentation Group. [2230]
Four load balancing strategies are supported to distribute statements over the configured MySQL slave
servers:
random
Chooses a random server whenever a statement is executed.
random once (default)
Chooses a random server after the first statement is executed, and
uses the decision for the rest of the PHP request.
It is the default, and the lowest impact on the connection state.
round robin
Iterates over the list of configured servers.
user-defined via callback
Is used to implement any other strategy.
The load balancing policy is configured in the plugins configuration file using the
random
,
roundrobin
,
and
user
filters
.
Servers can be prioritized assigning a weight. A server that has been given a weight of two will get
twice as many requests as a server that has been given the default weight of one. Prioritization can
be handy in heterogenous environments. For example, you may want to assign more requests to a
powerful machine than to a less powerful. Or, you may have configured servers that are close or far
from the client, thus expose different latencies.
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...