(r54511) Replace global array with hook
[lhc/web/wiklou.git] / docs / memcached.txt
index a21a7a5..632511f 100644 (file)
@@ -1,15 +1,19 @@
-memcached support for MediaWiki:
-
-From ca August 2003, MediaWiki has optional support for memcached, a
-"high-performance, distributed memory object caching system".
-For general information on it, see: http://www.danga.com/memcached/
+MediaWiki has optional support for memcached, a "high-performance, 
+distributed memory object caching system". For general information 
+on it, see: http://www.danga.com/memcached/
 
 Memcached is likely more trouble than a small site will need, but
 for a larger site with heavy load, like Wikipedia, it should help
 lighten the load on the database servers by caching data and objects
 in memory.
 
-== Requirements ==
+== Installation ==
+
+Packages are available for Fedora, Debian, Ubuntu and probably other
+Linux distributions. If you there's no package available for your 
+distribution, you can compile it from source.
+
+== Compilation ==
 
 * PHP must be compiled with --enable-sockets
 
@@ -35,26 +39,29 @@ server is appropriately firewalled, and that the port(s) used for
 memcached servers are not publicly accessible. Otherwise, anyone on
 the internet can put data into and read data from your cache.
 
-An attacker familiar with MediaWiki internals could use this to give
-themselves developer access and delete all data from the wiki's
-database, as well as getting all users' password hashes and e-mail
-addresses.
+An attacker familiar with MediaWiki internals could use this to steal
+passwords and email addresses, or to make themselves a sysop and 
+install malicious javascript on the site. There may be other types 
+of vulnerability, no audit has been done -- so be safe and keep it 
+behind a firewall.
 ********************* W A R N I N G ! ! ! ! ! ***********************
 
 == Setup ==
 
-If you want to start small, just run one memcached on your web
-server:
+If you installed memcached using a distro, the daemon should be started
+automatically using /etc/init.d/memcached.
 
-  memcached -d -l 127.0.0.1 -p 11000 -m 64
+To start the daemon manually, use something like:
+
+  memcached -d -l 127.0.0.1 -p 11211 -m 64
 
 (to run in daemon mode, accessible only via loopback interface,
-on port 11000, using up to 64MB of memory)
+on port 11211, using up to 64MB of memory)
 
 In your LocalSettings.php file, set:
 
        $wgMainCacheType = CACHE_MEMCACHED;
-       $wgMemCachedServers = array( "127.0.0.1:11000" );
+       $wgMemCachedServers = array( "127.0.0.1:11211" );
 
 The wiki should then use memcached to cache various data. To use
 multiple servers (physically separate boxes or multiple caches
@@ -64,21 +71,16 @@ it has twice the memory of the others and you want to spread
 usage evenly), make its entry a subarray:
 
   $wgMemCachedServers = array(
-    "127.0.0.1:11000", # one gig on this box
-    array("192.168.0.1:11000", 2 ) # two gigs on the other box
+    "127.0.0.1:11211", # one gig on this box
+    array("192.168.0.1:11211", 2 ) # two gigs on the other box
   );
 
 == PHP client for memcached ==
 
-As of this writing, MediaWiki includes version 1.0.10 of the PHP
-memcached client by Ryan Gilfether <hotrodder@rocketmail.com>.
-You'll find some documentation for it in the 'php-memcached'
-subdirectory under the present one.
-
-We intend to track updates, but if you want to check for the lastest
-released version, see http://www.danga.com/memcached/apis.bml
+MediaWiki uses a fork of Ryan T. Dean's pure-PHP memcached client.
+The newer PECL module is not yet supported.
 
-MediaWiki use three object for memcaching:
+MediaWiki uses three object for object caching:
 * $wgMemc, controlled by $wgMainCacheType
 * $parserMemc, controlled by $wgParserCacheType
 * $messageMemc, controlled by $wgMessageCacheType
@@ -93,12 +95,7 @@ this is mentionned below.
 
 == Keys used ==
 
-Ajax Search:
-       key: $wgDBname:ajaxsearch:md5( $search )
-       ex: wikidb:ajaxsearch:9565814d5d564fa898dd6111b94fae0b
-       stores: array with the result of research of a given text
-       cleared by: nothing
-       expiry: 30 minutes
+(incomplete, out of date)
 
 Date Formatter:
        key: $wgDBname:dateformatter
@@ -128,16 +125,6 @@ Lag time of the databases:
        expriy: 5 secondes
        cleared by: nothing
 
-Link Cache:
-       controlled by: $wgLinkCacheMemcached
-       key: $wgDBname:lc:title:$title
-       ex: wikidb:lc:title:Wikipedia:Welcome,_Newcomers!
-       stores: cur_id of page, or 0 if page does not exist
-       set in: LinkCache::addLink()
-       expriry: one day
-       cleared by: LinkCache::clearBadLink()
-               should be cleared on page deletion and rename
-
 Localisation:
        key: $wgDBname:localisation:$lang
        ex: wikidb:localisation:de
@@ -147,7 +134,7 @@ Localisation:
        cleared by: Language::loadLocalisation()
 
 Message Cache:
-       stored in: $parserMemc
+       stored in: $messageMemc
        key: $wgDBname:messages, $wgDBname:messages-hash, $wgDBname:messages-status
        ex: wikidb:messages, wikidb:messages-hash, wikidb:messages-status
        stores: an array where the keys are DB keys and the values are messages
@@ -254,4 +241,4 @@ User:
        set in: User::saveToCache()
        cleared by: User::saveSettings(), User::clearSharedCache()
        
-... more to come ...
\ No newline at end of file
+... more to come ...