So now that I have heard from both sides, what would be the "better"
thing to do here.
Load Balancer With multiple slaves
OR KyleKai way of randomizing what slave host to choose by the
application
-
Mike
On Nov 21, 9:58 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote:
> make sure you set the 'persistent' to false and don't use mysql_pconnect
>
> On Nov 21, 2007 7:07 PM, KyleKai <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > sorry forget say...
> > if you have many slave_database , you can try this.
>
> > On 11月22日, 上午10時05分, KyleKai <[EMAIL PROTECTED]> wrote:
> > > Try
> > > <?php
> > > $slave_db_list = array('xxxx1','xxxx2','xxxx3');
> > > $slave_db_host = $slave_db_list[rand(0,count($slave_db_list))-1];
> > > class DATABASE_CONFIG {
> > > var $default = array(
> > > 'driver' => 'mysql',
> > > 'host' => $slave_db_host,
> > > 'login' => '....',
> > > 'password' => '.....',
> > > 'database' => 'my_db'
> > > );}
>
> > > ?>
> > > On 11月22日, 上午8時40分, Mike Lewis <[EMAIL PROTECTED]> wrote:
>
> > > > So what your saying is put the load balancer IP Address for the
> > > > slave.host.ip ?
>
> > > > var $default = array(
> > > > 'driver' => 'mysql',
> > > > 'host' => 'slave.host.ip',
> > > > 'login' => '....',
> > > > 'password' => '.....',
> > > > 'database' => 'my_db'
> > > > );
>
> > > > -
> > > > Mike
>
> > > > On Nov 21, 3:39 pm, SeanW <[EMAIL PROTECTED]> wrote:> Most of those
> > > > protocols are balanced at layer 4 (IP and port), the
> > > > > load balancer has no knowledge of the underlying protocol. Just
> > > > > balance port 3306 across your slaves, it'll work just fine.
>
> > > > > Sean
>
> > > > > On Nov 21, 12:18 pm, Mike Lewis <[EMAIL PROTECTED]> wrote:
>
> > > > > > I realize that but as far as I know Load Balancers only these
> > > > > > protocols:
>
> > > > > > HTTP
> > > > > > HTTPS
> > > > > > FTP
> > > > > > POP3
> > > > > > SMTP
> > > > > > IMAPv4
> > > > > > DNS
> > > > > > Telnet
> > > > > > LDAP
>
> > > > > > I'm not to sure if connecting to a DB is anywhere in there.
>
> > > > > > So from a application standpoint is there anyway to do some rotation
> > > > > > and/or random act to using multiple slave servers.
>
> > > > > > -
> > > > > > Mike
>
> > > > > > On Nov 21, 9:08 am, SeanW <[EMAIL PROTECTED]> wrote:
>
> > > > > > > For multiple slave servers I'd look at a load balancer, either
> > > > > > > hardware or ipvs + heartbeat. There's more than just "which
> > > > > > > server do
> > > > > > > I send it to?", there's also making sure the server is alive and
> > > > > > > not
> > > > > > > too lagged.
>
> > > > > > > Sean
>
> > > > > > > On Nov 20, 8:24 pm, Mike Lewis <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > I saw a post about setting up one slave server (http://
> > > > > > > > groups.google.com/group/cake-php/browse_thread/thread/58ea010f930fab6c/
> > > > > > > > df64d493b24d5a67?lnk=gst&q=master+slave+mysql&rnum=1), but I'm
> > > > > > > > assuming thats not how you set up multiple slave servers.
> > > > > > > > Quoting fromhttp://www.alertra.com/article446.php:
>
> > > > > > > > "If necessary, set up multiple slave servers all replicating
> > > > > > > > from the
> > > > > > > > same master. Design your application to distribute SELECT
> > > > > > > > queries
> > > > > > > > across all available slaves in some type of rotating or random
> > > > > > > > fashion. Once this basic infrastructure is in place, you can
> > > > > > > > simply
> > > > > > > > add more slaves as query volume increases."
>
> > > > > > > > Is there a simple way of doing this in CakePHP?
>
> --
> (the old fart) the advice is free, the lack of crankiness will cost you
>
> - its a fine line between a real question and an idiot
>
> http://blog.samdevore.com/archives/2007/03/05/when-open-source-bugs-me/
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---