Failover
Read-write splitting
Concepts
PHP Manual

## Load balancing

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.