r103973 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103972‎ | r103973 | r103974 >
Date:22:56, 22 November 2011
Author:demon
Status:ok
Tags:
Comment:
(bug 29747) eAccelerator shared memory caching has been removed since it is now disabled by default and is buggy. APC, XCache and WinCache are not affected.

As Brion points out in <https://bugzilla.wikimedia.org/show_bug.cgi?id=29747#c7&gt;, the shared memory functions are very buggy. In fact, eAccelerator has disabled the shared memory functions by default for awhile now. I didn't touch APC, XCache or WinCache, but I imagine they suffer from the same problems.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES-1.19 (modified) (history)
  • /trunk/phase3/includes/AutoLoader.php (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Defines.php (modified) (history)
  • /trunk/phase3/includes/LocalisationCache.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)
  • /trunk/phase3/includes/objectcache/ObjectCache.php (modified) (history)
  • /trunk/phase3/includes/objectcache/eAccelBagOStuff.php (deleted) (history)

Diff [purge]

Index: trunk/phase3/RELEASE-NOTES-1.19
@@ -153,6 +153,8 @@
154154 was specified.
155155 * (bug 30368) Special:Newpages now shows the new page name for moved pages
156156 * (bug 1697) The way to search blocked usernames in block log should be clearer
 157+* (bug 29747) eAccelerator shared memory caching has been removed since it is
 158+ now disabled by default and is buggy. APC, XCache and WinCache are not affected.
157159
158160 === API changes in 1.19 ===
159161 * (bug 19838) siprop=interwikimap can now use the interwiki cache.
Index: trunk/phase3/includes/Defines.php
@@ -92,7 +92,7 @@
9393 define( 'CACHE_NONE', 0 ); // Do not cache
9494 define( 'CACHE_DB', 1 ); // Store cache objects in the DB
9595 define( 'CACHE_MEMCACHED', 2 ); // MemCached, must specify servers in $wgMemCacheServers
96 -define( 'CACHE_ACCEL', 3 ); // eAccelerator
 96+define( 'CACHE_ACCEL', 3 ); // APC, XCache or WinCache
9797 define( 'CACHE_DBA', 4 ); // Use PHP's DBA extension to store in a DBM-style database
9898 /**@}*/
9999
Index: trunk/phase3/includes/objectcache/eAccelBagOStuff.php
@@ -1,46 +0,0 @@
2 -<?php
3 -
4 -/**
5 - * This is a wrapper for eAccelerator's shared memory functions.
6 - *
7 - * This is basically identical to the deceased Turck MMCache version,
8 - * mostly because eAccelerator is based on Turck MMCache.
9 - *
10 - * @ingroup Cache
11 - */
12 -class eAccelBagOStuff extends BagOStuff {
13 - public function get( $key ) {
14 - $val = eaccelerator_get( $key );
15 -
16 - if ( is_string( $val ) ) {
17 - $val = unserialize( $val );
18 - }
19 -
20 - return $val;
21 - }
22 -
23 - public function set( $key, $value, $exptime = 0 ) {
24 - eaccelerator_put( $key, serialize( $value ), $exptime );
25 -
26 - return true;
27 - }
28 -
29 - public function delete( $key, $time = 0 ) {
30 - eaccelerator_rm( $key );
31 -
32 - return true;
33 - }
34 -
35 - public function lock( $key, $waitTimeout = 0 ) {
36 - eaccelerator_lock( $key );
37 -
38 - return true;
39 - }
40 -
41 - public function unlock( $key ) {
42 - eaccelerator_unlock( $key );
43 -
44 - return true;
45 - }
46 -}
47 -
Index: trunk/phase3/includes/objectcache/ObjectCache.php
@@ -89,9 +89,7 @@
9090 * @return ObjectCache
9191 */
9292 static function newAccelerator( $params ) {
93 - if ( function_exists( 'eaccelerator_get' ) ) {
94 - $id = 'eaccelerator';
95 - } elseif ( function_exists( 'apc_fetch') ) {
 93+ if ( function_exists( 'apc_fetch') ) {
9694 $id = 'apc';
9795 } elseif( function_exists( 'xcache_get' ) && wfIniGetBool( 'xcache.var_size' ) ) {
9896 $id = 'xcache';
Index: trunk/phase3/includes/LocalisationCache.php
@@ -842,7 +842,7 @@
843843
844844 /**
845845 * LCStore implementation which uses PHP accelerator to store data.
846 - * This will work if one of XCache, eAccelerator, or APC cacher is configured.
 846+ * This will work if one of XCache, WinCache or APC cacher is configured.
847847 * (See ObjectCache.php)
848848 */
849849 class LCStore_Accel implements LCStore {
Index: trunk/phase3/includes/installer/Installer.php
@@ -205,7 +205,6 @@
206206 protected $objectCaches = array(
207207 'xcache' => 'xcache_get',
208208 'apc' => 'apc_fetch',
209 - 'eaccel' => 'eaccelerator_get',
210209 'wincache' => 'wincache_ucache_get'
211210 );
212211
Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -134,9 +134,8 @@
135135 The installation may fail!",
136136 'config-xcache' => '[http://xcache.lighttpd.net/ XCache] is installed',
137137 'config-apc' => '[http://www.php.net/apc APC] is installed',
138 - 'config-eaccel' => '[http://eaccelerator.sourceforge.net/ eAccelerator] is installed',
139138 'config-wincache' => '[http://www.iis.net/download/WinCacheForPhp WinCache] is installed',
140 - 'config-no-cache' => "'''Warning:''' Could not find [http://eaccelerator.sourceforge.net eAccelerator], [http://www.php.net/apc APC], [http://xcache.lighttpd.net/ XCache] or [http://www.iis.net/download/WinCacheForPhp WinCache].
 139+ 'config-no-cache' => "'''Warning:''' Could not find [http://www.php.net/apc APC], [http://xcache.lighttpd.net/ XCache] or [http://www.iis.net/download/WinCacheForPhp WinCache].
141140 Object caching is not enabled.",
142141 'config-mod-security' => "'''Warning''': your web server has [http://modsecurity.org/ mod_security] enabled. If misconfigured, it can cause problems for MediaWiki or other software that allows users to post arbitrary content.
143142 Refer to [http://modsecurity.org/documentation/ mod_security documentation] or contact your host's support if you encounter random errors.",
@@ -472,7 +471,7 @@
473472 'config-cache-help' => 'Object caching is used to improve the speed of MediaWiki by caching frequently used data.
474473 Medium to large sites are highly encouraged to enable this, and small sites will see benefits as well.',
475474 'config-cache-none' => 'No caching (no functionality is removed, but speed may be impacted on larger wiki sites)',
476 - 'config-cache-accel' => 'PHP object caching (APC, eAccelerator, XCache or WinCache)',
 475+ 'config-cache-accel' => 'PHP object caching (APC, XCache or WinCache)',
477476 'config-cache-memcached' => 'Use Memcached (requires additional setup and configuration)',
478477 'config-memcached-servers' => 'Memcached servers:',
479478 'config-memcached-help' => 'List of IP addresses to use for Memcached.
@@ -606,7 +605,6 @@
607606 * $1 is the configured <code>memory_limit</code>.',
608607 'config-xcache' => 'Message indicates if this program is available',
609608 'config-apc' => 'Message indicates if this program is available',
610 - 'config-eaccel' => 'Message indicates if this program is available',
611609 'config-wincache' => 'Message indicates if this program is available',
612610 'config-imagemagick' => '$1 is ImageMagick\'s <code>convert</code> executable file name.
613611
Index: trunk/phase3/includes/AutoLoader.php
@@ -598,7 +598,6 @@
599599 'APCBagOStuff' => 'includes/objectcache/APCBagOStuff.php',
600600 'BagOStuff' => 'includes/objectcache/BagOStuff.php',
601601 'DBABagOStuff' => 'includes/objectcache/DBABagOStuff.php',
602 - 'eAccelBagOStuff' => 'includes/objectcache/eAccelBagOStuff.php',
603602 'EhcacheBagOStuff' => 'includes/objectcache/EhcacheBagOStuff.php',
604603 'EmptyBagOStuff' => 'includes/objectcache/EmptyBagOStuff.php',
605604 'FakeMemCachedClient' => 'includes/objectcache/EmptyBagOStuff.php',
Index: trunk/phase3/includes/DefaultSettings.php
@@ -1492,7 +1492,7 @@
14931493 * - CACHE_NONE: Do not cache
14941494 * - CACHE_DB: Store cache objects in the DB
14951495 * - CACHE_MEMCACHED: MemCached, must specify servers in $wgMemCachedServers
1496 - * - CACHE_ACCEL: eAccelerator, APC, XCache or WinCache
 1496+ * - CACHE_ACCEL: APC, XCache or WinCache
14971497 * - CACHE_DBA: Use PHP's DBA extension to store in a DBM-style
14981498 * database. This is slow, and is not recommended for
14991499 * anything other than debugging.
@@ -1542,7 +1542,6 @@
15431543 CACHE_ACCEL => array( 'factory' => 'ObjectCache::newAccelerator' ),
15441544 CACHE_MEMCACHED => array( 'factory' => 'ObjectCache::newMemcached' ),
15451545
1546 - 'eaccelerator' => array( 'class' => 'eAccelBagOStuff' ),
15471546 'apc' => array( 'class' => 'APCBagOStuff' ),
15481547 'xcache' => array( 'class' => 'XCacheBagOStuff' ),
15491548 'wincache' => array( 'class' => 'WinCacheBagOStuff' ),

Status & tagging log