Memcache and CakePHP

2007-12-30 Thread Mike Lewis

So I installed memcache + added the code to core.php:

Cache::config('default', array('engine' = 'Memcache',
 'duration' = 3600, //[optional]
 'probability' = 100, //[optional]
 'servers' = array(
   'memcache.ip.address'
 ), //[optional]
   'compress' = true,
   )
   );


CakePHP said it detected memcache -- so whats next?

Does it just run on its own, or do I have to add some more code to the
actual application. If so, what is it?

Thanks,
Mike

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Memcache and CakePHP

2007-12-30 Thread Mike Lewis

Is there anyway to check if something is being cached or not?

Thanks for the reply btw,

Mike

On Dec 30, 4:04 pm, Chris Hartjes [EMAIL PROTECTED] wrote:
 On Dec 30, 2007 2:02 PM, Mike Lewis [EMAIL PROTECTED] wrote:





  So I installed memcache + added the code to core.php:

  Cache::config('default', array('engine' = 'Memcache',
   'duration' = 3600, //[optional]
   'probability' = 100, //[optional]
   'servers' = array(
 'memcache.ip.address'
   ), //[optional]
 'compress' = true,
 )
 );

  CakePHP said it detected memcache -- so whats next?

  Does it just run on its own, or do I have to add some more code to the
  actual application. If so, what is it?

 As far as I know, your app *should* start using memcache for all the
 caching.  Nothing else for you to do.

 --
 Chris Hartjes

 My motto for 2007:  Just build it, damnit!

 @TheKeyboard -http://www.littlehart.net/atthekeyboard

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Multiple Slave Servers?

2007-11-21 Thread Mike Lewis

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=gstq=master+slave+mysqlrnum=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?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Multiple Slave Servers?

2007-11-21 Thread Mike Lewis

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=gstq=master+slave+mysqlrnum=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?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Re: Multiple Slave Servers?

2007-11-21 Thread Mike Lewis

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('1','2','3');
   $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=gstq=master+slave+mysqlrnum=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 cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---



Multiple Slave Servers?

2007-11-20 Thread Mike Lewis

I saw a post about setting up one slave server (http://
groups.google.com/group/cake-php/browse_thread/thread/58ea010f930fab6c/
df64d493b24d5a67?lnk=gstq=master+slave+mysqlrnum=1), but I'm
assuming thats not how you set up multiple slave servers. Quoting from
http://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?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake 
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---