Hi all,
Where can I find out best strategy for using the following Caches
1. $wgMainCacheType * 2. $wgParserCacheType * 3. $wgMessageCacheType * // found no documentation 4. $wgUseFileCache (http://www.mediawiki.org/wiki/Category:Cache_variables)
I have some 800.000 pages (MW1.15) on a single CPU Linux/Ubuntu with 2 Gb RAM, DB on the same machine, currently using MyISAM tables.
Although reading about the cache variables I'm still not sure of what exact difference there is between them.
== Question 1 ==
For example, should one use BOTH the (#1) $wgMainCacheType and the (#2) $wgParserCacheType, and possibly also server-side caching static pages (#4) $wgUseFileCache ?
== Question 2 ==
What are the benefits and draw backs with using either of the two options below, after excluding the other options? * CACHE_DB * CACHE_ACCEL - (eAccelerator in my case)
Which one seems to be preferred on my setup? Perhaps there's an overview page about cache strategy (for my kind of server setup) which I have missed?
Regards,
// Rolf Lampa
* * CACHE_DB - * CACHE_MEMCACHED - memcached, * CACHE_ACCEL - eAccelerator, mmTurck or APC, whichever is available * CACHE_DBA - ... DBM-style database
Rolf Lampa [RIL] wrote:
- $wgParserCacheType *
Cache for the result of rendering a page. Rendering the wikitext is very intensive, thus it should be cached.
- $wgMessageCacheType * // found no documentation
It refers to the interface messages. They are used all the time. It's a good idea to cache them.
== Question 2 ==
What are the benefits and draw backs with using either of the two options below, after excluding the other options?
- CACHE_DB
- CACHE_ACCEL - (eAccelerator in my case)
CACHE_DB uses the database, and thus performs worse than a specific cache accelerator. It may also produce db deadlocks.
CACHE_ACCEL seems a good solution for your case. If you had several servers, they would have independent caches, that's why memcached is preferred, but since it's on a single box, seems ok.
Very useful answers, thank you very much for answering!
These useful hints could (should) be addded to the relevant variable pages on mediawiki.org, I think. Mind if I add them?
// Rolf Lampa
Platonides wrote:
Rolf Lampa [RIL] wrote:
- $wgParserCacheType *
Cache for the result of rendering a page. Rendering the wikitext is very intensive, thus it should be cached.
- $wgMessageCacheType * // found no documentation
It refers to the interface messages. They are used all the time. It's a good idea to cache them.
== Question 2 ==
What are the benefits and draw backs with using either of the two options below, after excluding the other options?
- CACHE_DB
- CACHE_ACCEL - (eAccelerator in my case)
CACHE_DB uses the database, and thus performs worse than a specific cache accelerator. It may also produce db deadlocks.
CACHE_ACCEL seems a good solution for your case. If you had several servers, they would have independent caches, that's why memcached is preferred, but since it's on a single box, seems ok.
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
On Tue, Jun 16, 2009 at 1:55 PM, Rolf Lampa [RIL] rolf.lampa@rilnet.comwrote:
- $wgUseFileCache
File caching is definitely worth it as long as you have disk space; I just did some unscientific, unsophisticated testing, and fetching a page stored in the file cache was about 5 times faster than Memcached/eAccelerator. Of course, I'm sure there's also some overhead for writing the cached file when there's a file cache miss; the average benefit probably depends on whether the hits to your site are focused on a few articles (good) or roughly evenly distributed over all 800k pages (bad).
In any event, you still need the other cache types, since the file cache only works for anonymous users.
Which one seems to be preferred on my setup? Perhaps there's an overview
page about cache strategy (for my kind of server setup) which I have missed?
Just to be sure, did you look at http://www.mediawiki.org/wiki/Manual:Cache ?
Benjamin Lees wrote:
File caching is definitely worth it ... fetching a page stored in the file cache was about 5 times faster than Memcached/eAccelerator. <...> In any event, you still need the other cache types, since the file cache only works for anonymous users. <...> Just to be sure, did you look at http://www.mediawiki.org/wiki/Manual:Cache ?
Thank you for answering, it was helpful to realize how all the cache types cooperate.
( I also had missed the above link! <looking blushed> )
// Rolf Lampa
On Wed, Jun 17, 2009 at 10:06 PM, Rolf Lampa [RIL] rolf.lampa@rilnet.comwrote:
Benjamin Lees wrote:
File caching is definitely worth it ... fetching a page stored in the file cache was about 5 times faster than Memcached/eAccelerator. <...> In any event, you still need the other cache types, since the file cache only works for anonymous users. <...> Just to be sure, did you look at http://www.mediawiki.org/wiki/Manual:Cache ?
Thank you for answering, it was helpful to realize how all the cache types cooperate.
( I also had missed the above link! <looking blushed> )
I can see why you missed it. I've added some links to make it easier to find.
Benjamin Lees skrev:
On Wed, Jun 17, 2009 at 10:06 PM, Rolf Lampa [RIL] rolf.lampa@rilnet.comwrote:
Benjamin Lees wrote:
File caching is definitely worth it ... fetching a page stored in the file cache was about 5 times faster than Memcached/eAccelerator. <...> In any event, you still need the other cache types, since the file cache only works for anonymous users. <...> Just to be sure, did you look at http://www.mediawiki.org/wiki/Manual:Cache ?
Thank you for answering, it was helpful to realize how all the cache types cooperate.
( I also had missed the above link! <looking blushed> )
I can see why you missed it. I've added some links to make it easier to find.
I suggested some more additions to the article text on the discussion page, based on your an Plaitonides comments. Please check if I got it right, and if not, correct. And add whatever essentials missing.
http://www.mediawiki.org/wiki/Manual_talk:$wgParserCacheType
The other closely related variables could (should) be commented as well (file cache seems to be commented here: http://www.mediawiki.org/wiki/Manual:File_cache ).
// Rolf Lampa http://www.mediawiki.org/wiki/Manual:$wgParserCacheType
mediawiki-l@lists.wikimedia.org