X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FReplicated%2FBalancer%2FRandom.pm;h=1fc7b94e7374b107f9ad2c481b9e536a89240759;hb=7cfda9a6b80a051ffd5b180c4d34b66eae0de38d;hp=d3959d0e4bb268b252633d24b66caab5df2cc68e;hpb=f404f53c20c515693dcee08cd6fa7cb69696d67c;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/Random.pm b/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/Random.pm index d3959d0..1fc7b94 100644 --- a/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/Random.pm +++ b/lib/DBIx/Class/Storage/DBI/Replicated/Balancer/Random.pm @@ -13,7 +13,7 @@ DBIx::Class::Storage::DBI::Replicated::Balancer::Random - A 'random' Balancer This class is used internally by L. You shouldn't need to create instances of this class. - + =head1 DESCRIPTION Given a pool (L) of replicated @@ -30,10 +30,16 @@ This class defines the following attributes. =head2 master_read_weight -A number from 0 to 1 that specifies what weight to give the master when choosing -which backend to execute a read query on. A value of 0, which is the default, -does no reads from master, while a value of 1 gives it the same priority as any -single replicant. +A number greater than 0 that specifies what weight to give the master when +choosing which backend to execute a read query on. A value of 0, which is the +default, does no reads from master, while a value of 1 gives it the same +priority as any single replicant. + +For example: if you have 2 replicants, and a L of C<0.5>, +the chance of reading from master will be C<20%>. + +You can set it to a value higher than 1, making master have higher weight than +any single replicant, if for example you have a very powerful master. =cut