Hide last authors
H.-Dirk Schmitt 22.1 1 {{box cssClass="floatinginfobox" title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
Silvia Macovei 20.1 4
Niels Mayer 17.1 5 Here are some tips to increase XWiki's performance.
Vincent Massol 10.1 6
Vincent Massol 49.1 7 = Clustering =
8
Vincent Massol 89.1 9 If you need high availability or if the load on your XWiki instance is too high you can [[configure XWiki in a cluster>>Documentation.AdminGuide.Clustering.WebHome]] to spread the load.
Vincent Massol 49.1 10
Vincent Massol 48.1 11 = Standalone Solr =
12
Patrik Mattsson 110.2 13 By default XWiki use an embedded instance of Solr for ease of use, but if you struggle with very slow searches, you should try a external Solr instance.
14 You can use ##debug=true## in the URL of the search to see how much time is spent inside Solr to verify if Solr is taking a long time, or the issue is somewhere else, for example the XWiki UI.
Guillaume Delhumeau 50.1 15
Thomas Mortagne 65.1 16 See [[Performance Guide in Solr module documentation>>extensions:Extension.Solr Search API#HPerformances]].
Thomas Mortagne 64.1 17
Thomas Mortagne 42.1 18 = Slow random number generation on UNIX =
19
Thomas Mortagne 67.1 20 The library used for random number generation in Oracle's JVM relies on ##/dev/random## by default for UNIX platforms.
Thomas Mortagne 42.1 21
Vincent Massol 48.3 22 Although ##/dev/random## is more secure, it's possible to use ##/dev/urandom## if the default JVM configuration instead.
Thomas Mortagne 42.1 23
24 To determine if your operating system exhibits this behavior, try displaying a portion of the file from a shell prompt:
25
Thomas Mortagne 45.1 26 {{code language="bash"}}
Thomas Mortagne 42.1 27 head -n 1 /dev/random
Thomas Mortagne 45.1 28 {{/code}}
Thomas Mortagne 42.1 29
Thomas Mortagne 79.1 30 If the command returns immediately, you can use ##/dev/random## as the default generator for Oracle's JVM. If the command does not return immediately, use on of the following solutions to use ##/dev/urandom##:
Thomas Mortagne 42.1 31
Thomas Mortagne 79.1 32 == JVM setup ==
33
Thomas Mortagne 44.1 34 1. Open the ##$JAVA_HOME/jre/lib/security/java.security## file in a text editor.
35 1. Change the line:
Guillaume Delhumeau 50.1 36 {{code language="properties"}} securerandom.source=file:/dev/random{{/code}}
Thomas Mortagne 42.1 37 to read:
Guillaume Delhumeau 50.1 38 {{code language="properties"}} securerandom.source=file:/dev/urandom{{/code}}
Thomas Mortagne 44.1 39 1. Save your change and exit the text editor.
Thomas Mortagne 42.1 40
Thomas Mortagne 79.1 41 == Command line parameter ==
42
Thomas Mortagne 109.1 43 The same effect can be obtained using ##-Djava.security.egd=file:/dev/./urandom## in the Java command line (usually in the application server configuration).
Thomas Mortagne 79.1 44
Silvia Macovei 20.2 45 = Gzip compression and caching of static pages =
Vincent Massol 14.1 46
Thomas Mortagne 92.1 47 HTTP compression is a capability that can be built into web servers and web clients to improve transfer speed and bandwidth utilization. HTTP data is compressed before it is sent from the server: compliant browsers will announce what methods are supported to the server before downloading the correct format; browsers that do not support compliant compression method will download uncompressed data.
Vincent Massol 14.1 48
Thomas Mortagne 94.1 49 Many application servers (Tomcat, etc.) and HTTP proxies (Apache HTTPd, Nginx, etc.) support it.
Thomas Mortagne 92.1 50
Thomas Mortagne 93.1 51 == In Apache HTTP Server ==
Thomas Mortagne 92.1 52
53 The recommended solution is to set up an Apache Web Server in front of your servlet container and install/configure the following modules:
54
Silvia Macovei 20.1 55 * [[mod-deflate>>http://httpd.apache.org/docs/2.0/mod/mod_deflate.html]]
Pascal Bastien 81.1 56 * [[mod-expires>>http://httpd.apache.org/docs/2.0/mod/mod_expires.html]]
Silvia Macovei 20.1 57 * [[mod-proxy-ajp>>http://httpd.apache.org/docs/2.2/mod/mod_proxy_ajp.html]] (note that this depends on [[mod-proxy>>http://httpd.apache.org/docs/2.2/mod/mod_proxy.html]] that you also need to install)
58
Vincent Massol 14.1 59 Modify your Apache configuration file to load the different modules:
60
Silvia Macovei 20.1 61 {{code language="none"}}
Vincent Massol 14.1 62 LoadModule expires_module /usr/lib/apache2/modules/mod_expires.so
63 LoadModule deflate_module /usr/lib/apache2/modules/mod_deflate.so
64 LoadModule proxy_module /usr/lib/apache2/modules/mod_proxy.so
65 # Depends: proxy
66 LoadModule proxy_ajp_module /usr/lib/apache2/modules/mod_proxy_ajp.so
Silvia Macovei 20.1 67 {{/code}}
Vincent Massol 14.1 68
Kai Sen 37.1 69 //Alternatively you can run the following commands as root (sudo)//
70
71 {{code language="bash"}}
72 a2enmod deflate
73 a2enmod proxy_ajp
74 a2enmod expires
75 {{/code}}
76
Manuel Smeria 32.2 77 and configure your different modules as described below:
Vincent Massol 14.1 78
Thomas Mortagne 92.1 79 === Mod Deflate Configuration ===
Vincent Massol 14.1 80
Silvia Macovei 20.1 81 {{code language="none"}}
Vincent Massol 14.1 82 vwwwpro-1:~# cat /etc/apache2/conf.d/deflate
Eduard Moraru 111.3 83 <Location />
Vincent Massol 14.1 84 # Insert filter
85 SetOutputFilter DEFLATE
86
87 # Netscape 4.x has some problems...
88 BrowserMatch ^Mozilla/4 gzip-only-text/html
89
90 # Netscape 4.06-4.08 have some more problems
Silvia Macovei 20.1 91 BrowserMatch ^Mozilla/4.0[678] no-gzip
Vincent Massol 14.1 92
93 # MSIE masquerades as Netscape, but it is fine
Silvia Macovei 20.1 94 # BrowserMatch bMSIE !no-gzip !gzip-only-text/html
Vincent Massol 14.1 95
96 # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
97 # the above regex won't work. You can use the following
98 # workaround to get the desired effect:
Silvia Macovei 20.1 99 BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html
Vincent Massol 14.1 100
101 # Don't compress images
Silvia Macovei 20.1 102 SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
Vincent Massol 14.1 103
104 # Make sure proxies don't deliver the wrong content
105 #Header append Vary User-Agent env=!dont-vary
106 </Location>
Silvia Macovei 20.1 107 {{/code}}
Vincent Massol 14.1 108
Kai Sen 37.1 109 //On debian apache2 the config file for deflate is located under /etc/apache2/mods-enabled/deflate.conf//
110
Thomas Mortagne 92.1 111 === Mod Expire Configuration ===
Vincent Massol 14.1 112
Silvia Macovei 20.1 113 {{code language="none"}}
Vincent Massol 14.1 114 vwwwpro-1:~# cat /etc/apache2/conf.d/expires
Eduard Moraru 111.3 115 <Location /xwiki/skins/>
Vincent Massol 14.1 116 ExpiresActive on
117 ExpiresDefault "access plus 1 day"
118 </Location>
119
Eduard Moraru 111.3 120 <Location /xwiki/bin/skin/>
Vincent Massol 14.1 121 ExpiresActive on
122 ExpiresDefault "access plus 1 day"
123 </Location>
Silvia Macovei 20.1 124 {{/code}}
Vincent Massol 14.1 125
Thomas Mortagne 92.1 126 === Mod Proxy AJP Configuration ===
Vincent Massol 14.1 127
Silvia Macovei 20.1 128 {{code language="none"}}
129 ProxyRequests Off
Vincent Massol 14.1 130 <Proxy *>
131 Order deny,allow
132 Allow from all
133 </Proxy>
134 ProxyPreserveHost On
135 ProxyPass /xwiki ajp://192.168.1.181:8009/xwiki
Silvia Macovei 20.1 136 {{/code}}
Vincent Massol 14.1 137
Silvia Macovei 20.1 138 where ##ajp:~/~/192.168.1.181:8009/xwiki## is the internal address of your Servlet container where XWiki is running.
Vincent Massol 14.1 139
Kai Sen 37.1 140 If you use Tomcat(7) you need to enable the ajp connector in the /etc/tomcat7/server.xml. Comment out the following line with adding {{code}}<!-- -->{{/code}}. //Maybe give a comment why you did it.//
141
142 {{code}}
143 <!-- disable to use ajp connector instead
144 <Connector port="8080" protocol="HTTP/1.1"
145 connectionTimeout="20000"
146 URIEncoding="UTF-8"
Eduard Moraru 111.3 147 redirectPort="8443" />
Kai Sen 37.1 148 -->
149 {{/code}}
150
Thomas Mortagne 39.1 151 Uncomment the following line by removing the {{code}}<!-- -->{{/code}} and add {{code}}URIEncoding="UTF-8"{{/code}} to it.Maybe give a comment too.
Kai Sen 37.1 152
153 {{code}}
154 <!-- Activate ajp connector for apache proxy_ajp -->
Eduard Moraru 111.3 155 <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"/>
Kai Sen 37.1 156 {{/code}}
157
Silvia Macovei 20.2 158 = Memory =
Vincent Massol 9.1 159
Vincent Massol 34.1 160 You need to configure your Servlet container so that XWiki has enough memory. You'll need to tune the value to your need. You should check the logs and see if there are any "out of memory" errors. Here are some good default values:
Marc Lijour 36.1 161
Thomas Mortagne 112.1 162 * Small and medium installs: A minimum of 1024MB (##-Xmx1024m)##
163 * Large installs: 2048MB or beyond (##-Xmx2048m).##
Vincent Massol 9.1 164
Vincent Massol 53.3 165 {{info}}
Vincent Massol 53.1 166 You should not increase the memory beyond what you need because increasing it means that there's more Objects in memory at any time and the automatic JVM Garbage Collector has to work harder to clean itself, which can results in performance degradation in XWiki (since a full GC will pause the application for a longer time).
Vincent Massol 53.3 167 {{/info}}
Vincent Massol 53.1 168
Vincent Massol 34.1 169 {{warning}}
Ecaterina Moraru (Valica) 88.5 170 If you use HSQLDB as the wiki database, be aware that the full content of the database is stored in memory and thus the memory requirements are higher. See [[HSQLDB installation page>>Documentation.AdminGuide.Installation.InstallationWAR.InstallationHSQL.WebHome]] for more details.
Vincent Massol 76.1 171 {{/warning}}
172
Vincent Massol 35.1 173 For your information here are the values used for the xwiki.org site:
174
175 {{code}}
Vincent Massol 106.3 176 CATALINA_OPTS="-server -Xms800m -Xmx1600m -Dfile.encoding=utf-8 -Djava.awt.headless=true -XX:+UseParallelGC -XX:MaxGCPauseMillis=100"
Vincent Massol 35.1 177 {{/code}}
178
Vincent Massol 105.1 179 = Sizing =
180
Vincent Massol 105.2 181 To give you an idea about what you need to run XWiki on, [[XWiki SAS>>https://xwiki.com]] has the following configuration for its cloud instances:
Vincent Massol 105.1 182
Vincent Massol 106.4 183 * 2GB of RAM (See [[XWiki memory needs>>#HMemory]]),
Vincent Massol 106.1 184 * 2 cores(((
185 {{code language="none"}}
186 AMD Opteron(tm) Processor 6386 SE
187 cpu MHz : 2800.000
188 cache size : 2048 KB
Vincent Massol 106.2 189 {{/code}}
Vincent Massol 106.1 190 )))
Vincent Massol 105.1 191 * 16GB disk size by default
192
Silvia Macovei 20.2 193 = Database Indexes =
Vincent Massol 1.1 194
Vincent Massol 90.1 195 Make sure you've set [[Database indexes>>Documentation.AdminGuide.Performances.Database Administration.WebHome]]. This is especially important when you start having lots of documents.
Vincent Massol 1.1 196
Vincent Massol 74.1 197 = Large number of users =
198
199 When you have large number of users it's recommended to turn on implicit All Group, i.e. to consider that all users are members of XWiki.XWikiAllGroup by default in the configuration. This is achieved by editing the ##xwiki.cfg## file and setting:
200
201 {{code language="none"}}
202 xwiki.authentication.group.allgroupimplicit=1
203 {{/code}}
204
Vincent Massol 75.1 205 Then you should remove all the XObjects from the XWikiAllGroup page but you should keep the page since otherwise you won't be able to set permissions for this group. This will prevent XWiki from having to load all that page's XObjects representing the users (thousands of them if you have thousands of users).
Vincent Massol 74.1 206
Vincent Massol 75.2 207 Also make sure that the ##XWikiAllGroup## is listed in the ##xwiki.users.initialGroups## property (it's there by default if you haven't touched that property):
208
209 {{code language="none"}}
210 #-# List of groups that a new user should be added to by default after registering. Comma-separated list of group
211 #-# document names.
212 # xwiki.users.initialGroups=XWiki.XWikiAllGroup
213 {{/code}}
214
Silvia Macovei 20.2 215 = Robots.txt =
Vincent Massol 15.1 216
Vincent Massol 86.6 217 If your wiki is open on the Internet, it'll be crawled by search robots (like GoogleBot, etc). They will call all the URLs and especially the ones that are resource hungry like exports (PDF/RTF). You need to protect against this. To do so configure a ##robots.txt## file and put it in your webserver configuration.
Vincent Massol 15.1 218
Vincent Massol 85.1 219 Some example:
220
Silvia Macovei 20.1 221 {{code language="none"}}
Vincent Massol 15.1 222 User-agent: *
Vincent Massol 86.7 223 # Prevent bots from executing all actions except "view" since:
Vincent Massol 86.1 224 # 1) we don't want bots to execute stuff in the wiki!
Vincent Massol 86.2 225 # 2) we don't want bots to consume CPU and memory
Vincent Massol 86.7 226 # (for example to perform exports)
227 # Note: You may want to allow /download/ if you wish to have
228 # attachments indexed.
Eduard Moraru 111.1 229 # Note2: Using * instead of /bin/ to also match path-based
230 # subwikis like "/xwiki/wiki/wikialias/view/Space/Page"
231 Disallow: /xwiki/*/viewattachrev/
232 Disallow: /xwiki/*/viewrev/
233 Disallow: /xwiki/*/pdf/
234 Disallow: /xwiki/*/tex/
235 Disallow: /xwiki/*/edit/
236 Disallow: /xwiki/*/create/
237 Disallow: /xwiki/*/inline/
238 Disallow: /xwiki/*/preview/
239 Disallow: /xwiki/*/save/
240 Disallow: /xwiki/*/saveandcontinue/
241 Disallow: /xwiki/*/rollback/
242 Disallow: /xwiki/*/deleteversions/
243 Disallow: /xwiki/*/cancel/
244 Disallow: /xwiki/*/delete/
245 Disallow: /xwiki/*/deletespace/
246 Disallow: /xwiki/*/undelete/
247 Disallow: /xwiki/*/reset/
248 Disallow: /xwiki/*/register/
249 Disallow: /xwiki/*/propupdate/
250 Disallow: /xwiki/*/propadd/
251 Disallow: /xwiki/*/propdisable/
252 Disallow: /xwiki/*/propenable/
253 Disallow: /xwiki/*/propdelete/
254 Disallow: /xwiki/*/objectadd/
255 Disallow: /xwiki/*/commentadd/
256 Disallow: /xwiki/*/commentsave/
257 Disallow: /xwiki/*/objectsync/
258 Disallow: /xwiki/*/objectremove/
259 Disallow: /xwiki/*/attach/
260 Disallow: /xwiki/*/upload/
261 Disallow: /xwiki/*/download/
262 Disallow: /xwiki/*/temp/
263 Disallow: /xwiki/*/downloadrev/
264 Disallow: /xwiki/*/dot/
265 Disallow: /xwiki/*/svg/
266 Disallow: /xwiki/*/delattachment/
267 Disallow: /xwiki/*/skin/
268 Disallow: /xwiki/*/jsx/
269 Disallow: /xwiki/*/ssx/
270 Disallow: /xwiki/*/login/
271 Disallow: /xwiki/*/loginsubmit/
272 Disallow: /xwiki/*/loginerror/
273 Disallow: /xwiki/*/logout/
274 Disallow: /xwiki/*/charting/
275 Disallow: /xwiki/*/lock/
276 Disallow: /xwiki/*/redirect/
277 Disallow: /xwiki/*/admin/
278 Disallow: /xwiki/*/export/
279 Disallow: /xwiki/*/import/
280 Disallow: /xwiki/*/get/
281 Disallow: /xwiki/*/distribution/
282 Disallow: /xwiki/*/imagecaptcha/
283 Disallow: /xwiki/*/unknown/
Eduard Moraru 111.4 284 # Note: In addition, this matches both old /xwiki/bin/webjars/
285 # and new /xwiki/webjars paths.
Eduard Moraru 111.1 286 Disallow: /xwiki/*/webjars/
Eduard Moraru 111.4 287 # Don't index additional UI-related resources.
288 Disallow: /xwiki/resources/
Vincent Massol 86.2 289 # Don't index sandbox content since it's sample content
Eduard Moraru 111.1 290 Disallow: /xwiki/*/view/Sandbox/
Vincent Massol 86.2 291 # Don't index Admin space since it contains Admin stuff.
292 # Note that the Admin space is protected by permissions
293 # anyway but this acts as a safety net to not have private
294 # info leaked on the internet ;)
Eduard Moraru 111.1 295 Disallow: /xwiki/*/view/Admin/
Vincent Massol 86.2 296 # Don't index Stats data (just because it's not useful and
297 # those pages are a bit CPU intensive)
Eduard Moraru 111.1 298 Disallow: /xwiki/*/view/Stats/
Vincent Massol 86.2 299 # Don't index Panels data (because we don't want it
300 # indexed on the internet)
Eduard Moraru 111.1 301 Disallow: /xwiki/*/view/Panels/
302 # Don't index the search page.
303 Disallow: /xwiki/*/Main/Search
304 # Don't index the REST API.
305 Disallow: /xwiki/rest/
306 # These are just UI elements which can cause infinite loops in
307 # web crawlers. See https://jira.xwiki.org/browse/XWIKI-16915
308 Disallow: /xwiki/*?*xpage=*
Vincent Massol 86.1 309 {{/code}}
310
311 Other example:
312
313 {{code}}
314 [...]
Vincent Massol 85.1 315 # It could be also useful to block certain spaces from crawling,
H.-Dirk Schmitt 22.1 316 # especially if this spaces doesn't provide new content
317 Disallow: /xwiki/bin/view/Main/
318 Disallow: /xwiki/bin/view/XWiki/
Vincent Massol 85.1 319 # On the other hand you would like to have your recent (public) changes included
H.-Dirk Schmitt 22.1 320 Allow: /xwiki/bin/view/Main/Dashboard
Silvia Macovei 20.1 321 {{/code}}
Vincent Massol 15.1 322
Manuel Smeria 32.2 323 **Note:**
kayasaman 32.1 324
Manuel Smeria 32.2 325 For Tomcat6 the placement of the ##robots.txt## file should be within the //$TOMCAT/webapps/ROOT// folder and should have permission 644 applied.
kayasaman 32.1 326
327 {{code}}
328 -rw-r--r-- 1 root www 1478 Jan 8 15:52 robots.txt
329 {{/code}}
330
Manuel Smeria 32.2 331 In order to test if the ##robots.txt## file is either accessable or working as desired use this [[checker>>http://www.frobee.com/robots-txt-check]].
kayasaman 32.1 332
Silvia Macovei 20.2 333 = Statistics =
Vincent Massol 1.1 334
Silvia Macovei 20.1 335 {{info}}
336 This is no longer true starting with XE 1.4M2 since statistics are now put on a queue and written in a different thread in the database in one go, thus reducing the overhead to a maximum.
337 {{/info}}
Vincent Massol 15.1 338
Manuel Smeria 32.2 339 The statistics module is off by default since it's quite database intensive. If you don't need it you should turn it off.
Eduard Moraru 110.4 340 The current recommendation is to use the [[Matomo extension>>extensions:Extension.Piwiki Integration]] for statistics instead.
Vincent Massol 1.2 341
Vincent Massol 52.3 342 = Document Cache =
Vincent Massol 1.2 343
Vincent Massol 114.2 344 You can tune the Document cache in the ##xwiki.cfg## configuration file. The value depends on how much memory you have. The higher the better (but of course it's not very useful to allocate more than the total number of documents you have).
Vincent Massol 2.1 345
Silvia Macovei 20.1 346 {{code language="none"}}
kuchumovn 19.1 347 xwiki.store.cache.capacity=1000
Silvia Macovei 20.1 348 {{/code}}
Vincent Massol 8.1 349
Vincent Massol 25.1 350 = Cache Macro =
351
Vincent Massol 26.1 352 It's possible to perform selective content caching by using the [[Cache Macro>>extensions:Extension.Cache Macro]].
Vincent Massol 25.1 353
Guillaume Delhumeau 77.1 354 = LESS CSS Performances =
Guillaume Delhumeau 51.1 355
Guillaume Delhumeau 77.1 356 [[LESS>>extensions:Extension.LESS Module]] is a preprocessor used to generate CSS files for skins and skin extensions. See the [[Performances section>>extensions:Extension.LESS Module#HPerformances]] of the LESS module documentation to learn more about how to optimize its cache for performances, and to set the appropriate number of simultaneous compilations your server can handle.
Guillaume Delhumeau 51.1 357
Silvia Macovei 20.2 358 = Rendering cache =
Vincent Massol 2.1 359
Thomas Mortagne 30.1 360 Some pages are complex to render (they may aggregate outside data for example or do complex and slow queries). For theses pages you can use rendering cache.
361
Thomas Mortagne 29.1 362 == Configuration based ==
Vincent Massol 25.1 363
Manuel Smeria 32.2 364 Pages can be cached (i.e. their rendered content cached) to speed up displaying. The configuration is done in ##xwiki.properties## with the following configuration options:
Vincent Massol 25.1 365
366 {{code language="none"}}
367 #-# [Since 2.4M1]
368 #-# Indicate if the rendering cache is enabled.
369 #-# Default value is false.
370 # core.renderingcache.enabled=true
371
372 #-# [Since 2.4M1]
373 #-# A list of Java regex patterns matching full documents reference.
374 # core.renderingcache.documents=wiki:Space\.Page
375 # core.renderingcache.documents=wiki:Space\..*
376
377 #-# [Since 2.4M1]
378 #-# The time (in seconds) after which data should be removed from the cache when not used.
379 #-# Default value is 300 (5 min).
380 # core.renderingcache.duration=300
381
382 #-# [Since 2.4M1]
383 #-# The size of the rendering cache. Not that it's not the number of cached documents but the number of cached results.
384 #-# (For a single document several cache entries are created, because each action, language and request query string
385 #-# produces a unique rendering result)
386 #-# Default value is 100.
387 # core.renderingcache.size=100
388 {{/code}}
389
Thomas Mortagne 31.1 390 You can force a page to refresh using ##refresh=1## in the URL.
Thomas Mortagne 30.1 391
Thomas Mortagne 41.1 392 Since 6.2 it's also possible to programmatically refresh any document cache using ##com.xpn.xwiki.internal.cache.rendering.RenderingCache## component:
Thomas Mortagne 39.1 393
394 {{code language="java"}}
395 @Inject
396 private RenderingCache renderingCache;
397
398 ...
399
400 renderingCache.flushWholeCache();
401 renderingCache.flushCache(new DocumentReference("xwiki", "MySpace", "MyCachedDocument"));
402 {{/code}}
403
Vincent Massol 25.1 404
Silvia Macovei 20.2 405 = Merge the CSS files =
Vincent Massol 11.1 406
Eduard Moraru 110.5 407 In order to reduce the number of requests and files that are downloaded from the browser or client, it could help to merge all XWiki CSS files into a single one. See the [[Merge CSS Script>>snippets:Extension.Merge CSS]].
Vincent Massol 11.1 408
Silvia Macovei 20.2 409 = Set up NginX =
kuchumovn 19.2 410
Manuel Smeria 32.2 411 If you experience //__heavy loads__// on your wiki, you could try using NginX.
kuchumovn 19.3 412
Marc Lijour 36.1 413 NginX is used to fetch static content: images, javascript, styles, etc, but it can also be used as a reverse-proxy to pass requests down to the web container (e.g. Tomcat on port 8080).
kuchumovn 19.2 414
Manuel Smeria 32.2 415 Unlike Apache, which instantiates a new process per every static file, NginX uses the same process to fetch all the static data, and thus gives you extra perfomance "for free".
kuchumovn 19.2 416
Vincent Massol 91.1 417 For more info on setting up NginX check [[this guide>>Documentation.AdminGuide.Installation.NginX.WebHome]].
kuchumovn 19.2 418
Simon Urli 107.1 419 = Local resource access =
420
Vincent Massol 108.1 421 [[See URL API>>extensions:Extension.URL API#HResourcemodificationdate]].
Simon Urli 107.1 422
Silvia Macovei 20.2 423 = Backlinks =
Sergiu Dumitriu 4.1 424
Silvia Macovei 20.1 425 While a pretty neat feature, keeping track of the backlinks has a medium impact on the document saving time and a minor impact on the document loading time. If you feel that your wiki does not need backlinks, you can safely disable them with the following line in ##xwiki.cfg##:
426
427 {{code language="none"}}
kuchumovn 19.1 428 xwiki.backlinks=0
Silvia Macovei 20.1 429 {{/code}}
Sergiu Dumitriu 5.1 430
Silvia Macovei 20.2 431 = Versioning =
Sergiu Dumitriu 5.1 432
Manuel Smeria 32.2 433 One of the key features of any wiki system, versioning greatly affects the database size and the document update time. If you are sure your wiki does not need to keep track of all the changes and you will never need to revert documents to a previous version, then you can add the following line in ##xwiki.cfg##:
Silvia Macovei 20.1 434
435 {{code language="none"}}
kuchumovn 19.1 436 xwiki.store.versioning=0
Silvia Macovei 20.1 437 {{/code}}
Sergiu Dumitriu 6.1 438
Vincent Massol 21.1 439 = Custom Mapping =
Sergiu Dumitriu 6.1 440
Manuel Smeria 32.2 441 In some cases you may not want to rely on XWiki's generic database schema for storing XClass data and instead you'd like to provide your own optimized table. For these use cases you can use [[Custom Mapping>>platform:DevGuide.CustomMapping]].
Vincent Massol 21.1 442
Thomas Mortagne 73.1 443 = LDAP =
444
445 == Disable LDAP sub groups search ==
446
Thomas Mortagne 114.1 447 By default when loading a LDAP group, each member is searched and loaded to figure out if it's a group or not (and then load the sub group members, etc). If you know there is no sub group in your LDAP groups you can disable it and speed up quite a lot big groups handling using ##xwiki.authentication.ldap.group_sync_resolve_subgroups## property in ##xwiki.cfg## configuration file.
Thomas Mortagne 73.1 448
Thomas Mortagne 56.1 449 = Performance tree =
450
Thomas Mortagne 57.1 451 Since 7.1 it's possible to directly get a tree of time spent in each step of the request by using [[debug mode>>dev:Community.Debugging#HDebugmode]].
Thomas Mortagne 68.1 452
Vincent Massol 98.2 453 = Navigation Tree =
Vincent Massol 98.1 454
455 The Navigation Panel and other navigation trees can have some small performance issues under very high volumes. Here ares some base measures we did on some developer laptops to give you some ideas of the performance you should expect:
456
457 Measure set 1:
458
Eduard Moraru 111.1 459 (% class="table-bordered" style="width:100%" %)
Vincent Massol 101.2 460 |=(% width="20%" %)DB|=(% width="10%" %)Levels|=(% width="10%" %)Spaces|=(% width="10%" %)Pages|=(% width="15%" %)Requests|=Time
Ecaterina Moraru (Valica) 100.1 461 |MySQL|5|6887|4049|31|180ms
462 |HSQLDB|5|6762|4063|27|138ms
463 |MySQL|1|2514|4962|27|331ms
464 |HSQLDB|1|2377|4718|21|**3.15s**
Vincent Massol 98.1 465
466 Measure set 2:
467
Eduard Moraru 111.1 468 (% class="table-bordered" style="width:100%" %)
Vincent Massol 101.2 469 |=(% width="20%" %)DB|=(% width="10%" %)Levels|=(% width="10%" %)Spaces|=(% width="10%" %)Pages|=(% width="15%" %)Requests|=Time
Ecaterina Moraru (Valica) 100.1 470 |Oracle|5|6943|4106|20|119ms
471 |Oracle|1|2493|4982|20|153ms
Vincent Massol 98.1 472
473 Measure set 3:
474
Eduard Moraru 111.1 475 (% class="table-bordered" style="width:100%" %)
Vincent Massol 101.2 476 |=(% width="20%" %)DB|=(% width="10%" %)Levels|=(% width="10%" %)Spaces|=(% width="10%" %)Pages|=(% width="15%" %)Requests|=Time
Ecaterina Moraru (Valica) 101.1 477 |Oracle|1|2485|4991|20|151ms
478 |PostgreSQL|1|2494|4991|20|125ms
Vincent Massol 98.1 479
Ilie Andriuta 103.1 480 Measure set 4 (XWiki 10.5, Intel i7 CPU, SSD Storage):
Ilie Andriuta 102.1 481
Eduard Moraru 111.1 482 (% class="table-bordered" style="width:100%" %)
Ilie Andriuta 102.1 483 |=(% width="20%" %)DB|=(% width="10%" %)Levels|=(% width="10%" %)Spaces|=(% width="10%" %)Pages|=(% width="15%" %)Requests|=Time
Ilie Andriuta 104.1 484 |PostgreSQL 10|5|6847|4052|25|74ms
Ilie Andriuta 102.1 485
Thomas Mortagne 68.1 486 = Legacy =
487
Thomas Mortagne 71.1 488 == Monitor plugin ==
Thomas Mortagne 70.1 489
490 More a developer-oriented feature, XWiki can monitor its own code, reporting the time spent for each sub-component activated during a request. While the monitoring code isn't time consuming, it increases the memory consumption a bit, and the create/start/stop/log/destroy calls are spread all around the code, so you will save a lot of method calls by disabling this. You can do that by setting the following line in ##xwiki.cfg##:
491
492 {{code language="properties"}}
493 xwiki.monitor=0
494 {{/code}}
495
Thomas Mortagne 68.1 496 == 1.0 rendering cache using velocity in document content itself ==
497
498 You can add the following to their content to cache them after they are rendered. Note that the document is refreshed whenever the content of the document changes, and the cache takes into account the URL, so it is pretty safe to add a long cache duration for all documents that don't contain scripts gathering data from the wiki. For example to cache the rendered content for 60 seconds you would add:
499
500 {{code language="none"}}
501 $context.setCacheDuration(60)
502 {{/code}}
503
504 Since 1.5M2, you can set the default rendering cache duration for all pages in ##xwiki.cfg##:
505
506 {{code language="none"}}
507 ## cache all rendered documents for one hour
508 xwiki.rendering.defaultCacheDuration=3600
509 {{/code}}
510
511 Setting the default cache duration to a large value, and manually disabling the cache in dynamic pages would really speed up the wiki, since the rendering is one of the most time consuming processes.
Thomas Mortagne 69.1 512
Thomas Mortagne 72.1 513 == Wiki syntax features for XWiki Syntax 1.0 ==
Thomas Mortagne 69.1 514
515 If you're using XWiki Syntax 1.0 and if you don't plan to use all of the markup features, like the strikethrough filter, the automatic http links filter, the SVG, Laszlo or style macros, you can disable them in ##xwiki-core-*.jar/META-INF/services/com.xpn.xwiki.render.*##. The wiki rendering is the most costly operation in the rendering process, so any disabled feature counts.
516
517 Now this will have no effect if you're using another syntax, like XWiki Syntax 2.x.

Get Connected