Speeding up Semantic MediaWiki
Here are some tips on speeding up a wiki that uses Semantic MediaWiki.
Contents |
[edit] Speeding up Semantic MediaWiki
On very large or high traffic sites, further restriction of SMW features might be desirable for performance reasons. Besides setting up the usual external caches and distributed DB-servers, you can also modify some SMW options to increase speed (while switching off features). Try some or all of the below in LocalSettings.php:
- Set
$smwgQEqualitySupporttoSMW_EQ_NONE. Drastic improvements for searches with several subqueries. This will not affect search results unless an annotation's object points to a redirected page. - Set
$smwgQEnabledtofalse. most radical -- no more semantic queries, just browsing/display features - Set
$smwgQSubcategoryDepthto0. disable subcategory reasoning in queries - Set
$smwgQDisjunctionSupporttofalse. completely disable disjunctions in queries - Set
$smwgQMaxSizeto5. allow only queries of 5 or fewer conditions (default 12) - Set
$smwgQMaxDepthto2. allow only queries of depth 2 or smaller (default 4) - Set
$smwgQMaxLimitto100. never ever return more than 100 results to a query (default 10000) - Set
$smwgQDefaultLimitto10. only return 10 query results by default - Set
$smwgRSSWithPagestofalse. do not include pages into RSS feeds, speeds up feed generation - Set
$smwgRSSEnabledtofalse. switch off RSS feeds completely, so as not to atttract too many queries
These settings have different effects, and their effectiveness depends very much on the usage and content structure of your wiki. You may wich to try out conservative settings first and relax these step by step when things work reliably. If you have continued performance issues on your *large* wiki, please do not hesitate to contact the SMW developers for support.
[edit] Speeding up other extensions
[edit] Semantic Drilldown
Semantic Drilldown can harm performance if used extensively, because the Special:BrowseData page has to run a separate query for each filter value it displays, in order to show the number of pages that match that value. You can speed up its performance significantly by setting the input type to "combo box" for filters that have many values - for the "combo box" input, the number of matching pages is not shown.
[edit] Semantic Forms
In Semantic Forms, pointing red links to forms can slow down performance, since every red link needs to be checked to see if it has a matching form. The following setting can help:
-
$sfgRedLinksCheckOnlyLocalProps = true;
This checks for matching forms for each red-linked page only on the page on which the link exists, not across the wiki; which could significantly reduce the number of database queries required
[edit] Speeding up MediaWiki
Often, problems in performance for Semantic MediaWiki-based wikis do not arise from Semantic MediaWiki at all, but rather are due to normal MediaWiki operation. Often, these can be fixed by PHP caching, database caching and the like. See here for a list of tips.
[edit] Documents
- Markus Krötzsch: Saving C02: Top SMW Performance Issues and How to Address Them, SMWCon Fall 2011, September 21, 2011 [PDF; 525 KB] - Video of the presentation on YouTube