Commit 7e308179 authored by Jeremy's avatar Jeremy
Browse files

Bug #1014154: Correct installation instructions; cleanup.

parent ffc86e5c
......@@ -4,8 +4,8 @@
- PHP 5.1 or greater
- Availability of a memcached daemon: http://memcached.org/
- One of the two PECL memcache packages:
- http://pecl.php.net/package/memcache
- http://pecl.php.net/package/memcached (recommended
- http://pecl.php.net/package/memcache (recommended):
- http://pecl.php.net/package/memcached
## INSTALLATION ##
......@@ -24,29 +24,14 @@ http://www.lullabot.com/articles/how_install_memcache_debian_etch
6. Start at least one instance of memcached on your server.
7. Edit settings.php to configure the servers, clusters and bins that memcache
is supposed to use.
8. Edit settings.php to include cache.inc, memcache.inc. For example:
include_once('./includes/cache.inc');
include_once('./sites/all/modules/memcache/memcache.inc');
9. Edit settings.php to make memcache the default caching class:
8. Edit settings.php to mke memcache the default cache class, for example:
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
9. Bring your site back online.
For instructions on 1 and 2 above, please see the INSTALLATION.txt file that
comes with the memcache module download.
http://www.lullabot.com/files/memcache-inc.png
In Drupal 7+, you no longer should set cache_inc in settings.php. Instead, you
will have to manually include 'cache.inc' and 'memcache.inc', then update $conf
to tell Drupal to default to memcache for caching:
// the path to the core cache file
include_once('./includes/cache.inc');
// the path to the memcache cache file
include_once('./sites/all/modules/memcache/memcache.inc');
// make MemCacheDrupal the default cache class
$conf['cache_default_class'] = 'MemCacheDrupal';
## SERVERS ##
If you want the simple version, you can start one default memcache instance on
......@@ -109,8 +94,8 @@ Here is an example configuration that has two clusters, 'default' and
clusters. 'cache_filter' and 'cache_menu' bins goe to 'cluster2'. All other
bins go to 'default'.
include_once('./includes/cache.inc');
include_once('./sites/all/modules/memcache/memcache.inc');
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf = array(
'cache_default_class' = 'MemCacheDrupal',
'memcache_servers' => array('localhost:11211' => 'default',
......@@ -123,6 +108,7 @@ $conf = array(
'cache_filter' => 'cluster2',
'cache_menu' => 'cluster2'),
);
## PREFIXING ##
If you want to have multiple Drupal installations share memcached instances,
......@@ -141,8 +127,8 @@ a session and a users server set up for memcached sessions to work.
NOTE: Session.inc is not yet ported to Drupal 7.
include_once('./includes/cache.inc');
include_once('./sites/all/modules/memcache/memcache.inc');
$conf['cache_backends'][] = 'sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf = array(
'cache_default_class' = 'MemCacheDrupal',
'session_inc' => './sites/all/modules/memcache/memcache-session.inc',
......@@ -183,12 +169,11 @@ See http://drupal.org/node/273824
A module offering a UI for memcache is included. It provides stats, a
way to clear the cache, and an interface to organize servers/bins/clusters.
## Memcached PECL Extension Support
We also now support the Memcached PECL extension. If you install this extension,
it will be used by default. This new extension backends to libmemcached and
allows you to use some of the newer advanced features in memcached 1.4.
We also now support the Memcached PECL extension. This new extension backends
to libmemcached and allows you to use some of the newer advanced features in
memcached 1.4.
NOTE: It is important to realize that the memcache php.ini options do not impact
the memcached extension, this new extension doesn't read in options that way.
......
......@@ -125,6 +125,8 @@ function memcache_admin_stats($cluster = 'default', $type = 'default') {
// Do some custome value tweaks for specific stat page types.
switch ($type) {
case 'default' :
$mem_used = $values['bytes'] / $values['limit_maxbytes'];
$values['uptime'] = format_interval($values['uptime']);
$values['time'] = format_date($values['time']);
$values['bytes'] = format_size($values['bytes']);
......@@ -137,7 +139,6 @@ function memcache_admin_stats($cluster = 'default', $type = 'default') {
? number_format(100.0 * $values['get_hits'] / $values['cmd_get'], 2) . '%'
: '0';
$mem_used = intval($values['bytes']) / (intval($values['limit_maxbytes']) * 1024);
$values['mem_used'] = number_format(100.0 * $mem_used, 2) . '%';
break;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment