From 55aa04cff2695193f9add5ab37a165f4de7f32ff Mon Sep 17 00:00:00 2001 From: Ulf Wendel Date: Tue, 27 Sep 2011 14:21:00 +0000 Subject: [PATCH] 1.1.0 update: a few more words on load balancing, nothing really new. Additional minor updates. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@317396 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/mysqlnd_ms/concepts.xml | 59 +++++++++++++++++-------------- 1 file changed, 33 insertions(+), 26 deletions(-) diff --git a/reference/mysqlnd_ms/concepts.xml b/reference/mysqlnd_ms/concepts.xml index 2b062af214..c77216d223 100755 --- a/reference/mysqlnd_ms/concepts.xml +++ b/reference/mysqlnd_ms/concepts.xml @@ -7,13 +7,13 @@ The concept section explains the overall architecture and important concepts of the plugin. The materials aim to help you understanding the impact of MySQL replication and using the plugin for your development tasks. - Any application using MySQL Replication must take care of certain tasks that + Any application using MySQL replication must take care of certain tasks that arise from using a database cluster. It is strongly recommended to work through the materials in order to be able to use the plugin with success. This is particulary true, if you are - new to using MySQL Replication. + new to using MySQL replication.
Architecture @@ -277,7 +277,7 @@ remember all settings to apply them on connections opened in the future. This is important to remember, if using - lazy connections. + lazy connections. Lazy connections are connections which are not opened before the client sends the first connection. Use of lazy connections is the default plugin action. @@ -424,7 +424,7 @@ The failover policy is configured in the plugins configuration file by help of the - failover + failover configuration directive.
@@ -433,19 +433,27 @@ Load balancing Four load balancing strategies are supported to distribute read-only - statements over the configured MySQL slave servers: - random, random_once (default), - roundrobin, user. + statements over the configured MySQL slave servers: random, random once, + round robin and user defined via callback. Random picks a random + server whenever a statement is to be executed. Random once picks a + random server once when the first statement is executed and uses + the decision for the rest of the PHP request. Random once is the default, + if nothing else is configured because random once has the lowest impact + on the connection state. Round robin iterates over the list of + configured servers. A user defined callback can be used to implement + any other strategy. The load balancing policy is configured in the plugins configuration file using the - pick[] - configuration directive. + random, + roundrobin + and user + filter. Please, see below to learn more about + filter. -
Read-write splitting @@ -487,15 +495,14 @@
-
+
Filter - - - - The below description applies to PECL/mysqlnd_ms >= 1.1.0-beta. - It is not valid for earlier versions. - - + + + The below description applies to PECL/mysqlnd_ms >= 1.1.0-beta. + It is not valid for earlier versions. + + PECL/mysqlnd 1.1.0-beta introduces the concept of filters. @@ -503,8 +510,8 @@ a group of servers in the cluster which could execute a given statement before the statement is executed on one of the candidates. In other words: a given list of servers has to be filtered until one server is left. - - + + The process of filtering may include the use one or more filters. Filters can be chained. They are executed in the order of their appearance in the plugins configuration file. The concept of chained filters can be compared to using @@ -528,10 +535,10 @@ Selection filter: user. - + - - + + The random and roundrobin filters replace the pick[] @@ -548,7 +555,7 @@ Filters can accept parameters to change their behaviour. The random filter accepts an optional sticky parameter. If set to true, the filter chnages - load balancing from random to random once. Random picks a random server + load balancing from random to random once. 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. @@ -607,7 +614,7 @@ In future versions there may be filters which return more than one candidate for statement execution. For example, there may be a table - filter to support MySQL Replication filtering. MySQL replication filter allow + filter to support MySQL replication filtering. MySQL replication filter allow you to define rules which database or table is to be replicated to which node of a replication cluster. Assume your replication cluster consists of four slaves (slave_0, slave_1, @@ -622,7 +629,7 @@ A hypothetical filter sequence, assuming the existance of a table - filter to support MySQL Replication filtering (client-side partitioning). + filter to support MySQL replication filtering (client-side partitioning).