r64345 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64344‎ | r64345 | r64346 >
Date:16:08, 29 March 2010
Author:demon
Status:reverted (Comments)
Tags:
Comment:
Don't default to memcached, use APC if available, DB otherwise
Modified paths:
  • /branches/new-installer/phase3/includes/installer/WebInstaller.php (modified) (history)

Diff [purge]

Index: branches/new-installer/phase3/includes/installer/WebInstaller.php
@@ -1339,8 +1339,10 @@
13401340 );
13411341
13421342 $caches = array( 'none', 'anything', 'db' );
 1343+ $selected = 'db';
13431344 if( count( $this->getVar( '_Caches' ) ) ) {
13441345 $caches[] = 'accel';
 1346+ $selected = 'accel';
13451347 }
13461348 $caches[] = 'memcached';
13471349
@@ -1353,6 +1355,7 @@
13541356 'label' => 'config-cache-options',
13551357 'itemLabelPrefix' => 'config-cache-',
13561358 'values' => $caches,
 1359+ 'value' => $selected,
13571360 ) ) .
13581361 $this->parent->getHelpBox( 'config-cache-help' ) .
13591362 $this->parent->getTextBox( array(

Comments

#Comment by Simetrical (talk | contribs)   20:34, 12 April 2010

Using APC for variable caching is unsafe on a setup with multiple application servers, so maybe it's not a good default?

#Comment by Nikerabbit (talk | contribs)   14:23, 13 April 2010

What is unsafe about it?

#Comment by Simetrical (talk | contribs)   16:26, 13 April 2010

Each server will keep its own set of variables, so when one server clears a variable, it will only be cleared for that server and other servers will have an outdated version. You need to use memcached for variable caching if you have multiple app servers, or the DB – something that's shared between all app servers. APC can only safely be used for opcode caching unless you take fancy extra measures to synchronize the servers.

#Comment by Tim Starling (talk | contribs)   00:18, 7 July 2010

Yes, it's a bad idea for that reason. It's also a bad idea because APC is buggy when its cache fills up. My experience is that will often segfault when that happens. Using it as an object cache is a good way to guarantee that it does.

#Comment by 😂 (talk | contribs)   12:30, 7 July 2010

What should we default to then, no caching?

#Comment by Nikerabbit (talk | contribs)   12:33, 7 July 2010

Probably, but we also need to introduce a way for developers to get a "cache" that always works, for situations when they need to store data which is not just a copy of something that can be got elsewhere.

#Comment by Simetrical (talk | contribs)   13:07, 7 July 2010

If the data isn't a copy of something that can be got elsewhere, it shouldn't be put in a cache to begin with – it belongs in the database. Caches can disappear at any moment. A database-based cache might be useful in cases where the data can be reconstructed from other things in the database, but only expensively. Do we have such cases?

#Comment by 😂 (talk | contribs)   12:35, 22 July 2010

We default to no cache as of r69180, so this was effectively reverted.

Status & tagging log