works great. I even have some code for session memcached (mostly written by darix), data memcached , menu memcached, even a patch against taxonomy to cache some expensive functions. NowPublic uses it extensively. Since the v2.0 of PECL client appeared we have not problems, previously we used some PHP client, was not real good.
--
Read my developer blog on Drupal4hu. | The news is Now Public
/* Add these functions to bootstrap.inc and replace the original include_once './includes/session.inc'; with a call to drupal_memcache_init. $conf['memcache_use'] and $conf['memcache_session'] are switching memcache usage. $conf['memcache_session_server'] is an array of host:port strings. */
function _drupal_memcache_init($m) { foreach (variable_get($m .'_server', array('localhost:11211')) as $server) { list($server, $port) = explode(':', $server); if (!isset($GLOBALS[$m])) { $GLOBALS[$m] = new Memcache; $GLOBALS[$m]->pconnect($server, $port); } else { $GLOBALS[$m]->addserver($server, $port, TRUE); } } }
function drupal_memcache_init() { if (variable_get('memcache_use', 0)) { _drupal_memcache_init('memcache_session'); _drupal_memcache_init('memcache_cache'); _drupal_memcache_init('memcache_menu'); } if (variable_get('memcache_use', 0) && variable_get('memcache_session', 0)) { include_once './includes/session-memcache.inc'; } else { include_once './includes/session.inc'; }; }
I was also hoping chx could provide with additional information, and maybe code?
yes
works great. I even have some code for session memcached (mostly written by darix), data memcached , menu memcached, even a patch against taxonomy to cache some expensive functions. NowPublic uses it extensively. Since the v2.0 of PECL client appeared we have not problems, previously we used some PHP client, was not real good.
--
Read my developer blog on Drupal4hu. | The news is Now Public
Any chance on sharing those
Any chance on sharing those memcache patches?
----------------
Dominic Ryan
www.it-hq.org
code..
Url: http://pecl.php.net/package/memcache
/*
Add these functions to bootstrap.inc and replace the original include_once './includes/session.inc'; with a call to
drupal_memcache_init. $conf['memcache_use'] and $conf['memcache_session'] are switching memcache usage.
$conf['memcache_session_server'] is an array of host:port strings.
*/
function _drupal_memcache_init($m) {
foreach (variable_get($m .'_server', array('localhost:11211')) as $server) {
list($server, $port) = explode(':', $server);
if (!isset($GLOBALS[$m])) {
$GLOBALS[$m] = new Memcache;
$GLOBALS[$m]->pconnect($server, $port);
}
else {
$GLOBALS[$m]->addserver($server, $port, TRUE);
}
}
}
function drupal_memcache_init() {
if (variable_get('memcache_use', 0)) {
_drupal_memcache_init('memcache_session');
_drupal_memcache_init('memcache_cache');
_drupal_memcache_init('memcache_menu');
}
if (variable_get('memcache_use', 0) && variable_get('memcache_session', 0)) {
include_once './includes/session-memcache.inc';
}
else {
include_once './includes/session.inc';
};
}
I was also hoping chx could provide with additional information, and maybe code?
morphir.com
That's a good start!
That's a good start! Hopefully chx (or someone with Drupal/memcached know how) will see this thread to fill in the blanks...
----------------
Dominic Ryan
www.it-hq.org
Any updates on using
Any updates on using Memcache and Drupal?
I did find: http://www.tenpoundsound.com/blog/2005/11/drupal/memcache-drupal-impleme...
Any help appreciated.
Dead link
The link is dead. This is is a very interesting topic, it would be great to see it evolve.
Civicrm is supporting memcached
http://civicrm.org/node/126
I don't have any personal experience with it but looks promising.
As does
As does this;
http://drupal.org/project/memcache
----------------
Dominic Ryan
www.iis-aid.com