From version < 25.1 >
edited by Pascal Bastien
on 2016/11/04
To version < 26.1 >
edited by Ecaterina Moraru (Valica)
on 2017/09/04
< >
Change comment: There is no comment for this version

Summary

Details

Page properties
Author
... ... @@ -1,1 +1,1 @@
1 -XWiki.pbas
1 +XWiki.evalica
Content
... ... @@ -3,9 +3,10 @@
3 3  {{/box}}
4 4  
5 5  There are various solutions you can use to monitor a running XWiki instance:
6 +
6 6  * Install and configure [[JavaMelody>>https://github.com/javamelody/javamelody/wiki]]
7 -* [[Use a Profiler>>http://dev.xwiki.org/xwiki/bin/view/Community/Profiling]]. This has the advantage of providing advanced information, but has the drawback of being resource intensive and thus slowing the XWiki instance. It also requires a special startup script.
8 -* Starting with XWiki Enterprise 2.4M2 we're now using the [[JMX Technology>>http://en.wikipedia.org/wiki/Java_Management_Extensions]] to provide runtime monitoring of XWiki instances. The following features are currently available:
8 +* [[Use a Profiler>>dev:Community.Profiling]]. This has the advantage of providing advanced information, but has the drawback of being resource intensive and thus slowing the XWiki instance. It also requires a special startup script.
9 +* Starting with XWiki 2.4M2 we're now using the [[JMX Technology>>http://en.wikipedia.org/wiki/Java_Management_Extensions]] to provide runtime monitoring of XWiki instances. The following features are currently available:
9 9  ** Monitor the Velocity macro caches
10 10  ** Monitor the JBossCache caches XWiki is using to cache Document data, Users & Groups data and more
11 11  ** (starting with XE 3.1) Monitor the JGroups channel and protocols (when the XWiki Cluster feature is turned on)
... ... @@ -20,6 +20,7 @@
20 20  [[[[image:https://raw.githubusercontent.com/wiki/javamelody/javamelody/resources/screenshots/graphs.png||width="50%"]]>>https://github.com/javamelody/javamelody/wiki/Screenshots#charts||style="width:50%"]]
21 21  
22 22  To install JavaMelody for XWiki follow these steps (see the [[JavaMelody user guide>>https://github.com/javamelody/javamelody/wiki/UserGuide]] for more details):
24 +
23 23  * Download the latest [[javamelody.jar>>https://github.com/javamelody/javamelody/releases]] and [[jrobin-x.jar>>https://github.com/javamelody/javamelody/releases/download/javamelody-core-1.49.0/jrobin-1.5.9.jar]] and put them in the ##WEB-INF/lib## folder
24 24  * Edit ##web.xml## and add the following information:(((
25 25  {{code}}
... ... @@ -58,7 +58,7 @@
58 58  {{/code}}
59 59  )))
60 60  
61 -Then restart XWiki and access JavaMelody at ##http:~//localhost:8080/xwiki/monitoring##.
63 +Then restart XWiki and access JavaMelody at ##http:~/~/localhost:8080/xwiki/monitoring##.
62 62  
63 63  = JMX Console =
64 64  
... ... @@ -81,7 +81,7 @@
81 81  Since JBoss Infinispan natively supports JMX we benefit from this feature directly (JBoss documentation available [[here>>https://docs.jboss.org/author/display/ISPN/Management+Tooling]]).
82 82  
83 83  {{info}}
84 -Prior to XWiki Enterprise 3.5 the JMX support was not enabled by default. To enable it, edit ##WEB-INF/cache/infinispan/config.xml## and uncomment the two places where the "jmx" string is mentioned
86 +Prior to XWiki 3.5 the JMX support was not enabled by default. To enable it, edit ##WEB-INF/cache/infinispan/config.xml## and uncomment the two places where the "jmx" string is mentioned
85 85  {{/info}}
86 86  
87 87  Example showing the cache list and some statistic for a given cache:
... ... @@ -121,6 +121,7 @@
121 121  {{image reference="jgroups.png"/}}
122 122  
123 123  Interesting things to do on JGroups in the JMX console:
126 +
124 124  * Change the log level on the protocols to enable logging
125 125  * Disconnect a node from the cluster and reconnect it
126 126  
... ... @@ -135,6 +135,7 @@
135 135  Tomcat has a JMX Proxy Servlet bundled in their ##manager## webapp (see [[here>>http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html]] and [[here>>http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html]] for more details on Tomcat and JMX]].
136 136  
137 137  Here's some useful URLs to use the JMX Servlet Proxy to list and set JGroups Protocol Levels:
141 +
138 138  * To display the current log level for the TCPPING protocol: {{{http://localhost:8080/manager/jmxproxy?qry=jgroups:type=protocol,cluster=event,protocol=TCPPING}}}
139 139  * To set the log level to ##info## for the TCPPING protocol: {{{http://localhost:8080/manager/jmxproxy?set=jgroups:type=protocol,cluster=event,protocol=TCPPING&att=Level&val=info}}}
140 140  

There are various solutions you can use to monitor a running XWiki instance:

  • Install and configure JavaMelody
  • Use a Profiler. This has the advantage of providing advanced information, but has the drawback of being resource intensive and thus slowing the XWiki instance. It also requires a special startup script.
  • Use a Profiler. This has the advantage of providing advanced information, but has the drawback of being resource intensive and thus slowing the XWiki instance. It also requires a special startup script.
  • Starting with XWiki Enterprise 2.4M2 we're now using the JMX Technology to provide runtime monitoring of XWiki instances. The following features are currently available:
    • Monitor the Velocity macro caches
    • Monitor the JBossCache caches XWiki is using to cache Document data, Users & Groups data and more
    • (starting with XE 3.1) Monitor the JGroups channel and protocols (when the XWiki Cluster feature is turned on)
    • (starting with XE 3.1) Monitor the Logback Logging configuration and change it
  • Starting with XWiki 2.4M2 we're now using the JMX Technology to provide runtime monitoring of XWiki instances. The following features are currently available:
    • Monitor the Velocity macro caches
    • Monitor the JBossCache caches XWiki is using to cache Document data, Users & Groups data and more
    • (starting with XE 3.1) Monitor the JGroups channel and protocols (when the XWiki Cluster feature is turned on)
    • (starting with XE 3.1) Monitor the Logback Logging configuration and change it

XWiki also has a Monitor Plugin that you can use to monitor execution times. However this plugin is going to be deprecated in the future and replaced by the JMX technology.

JavaMelody

https://raw.githubusercontent.com/wiki/javamelody/javamelody/resources/screenshots/graphs.png

To install JavaMelody for XWiki follow these steps (see the JavaMelody user guide for more details):

  • Download the latest javamelody.jar and jrobin-x.jar and put them in the WEB-INF/lib folder
  • Edit web.xml and add the following information:
    ...
    <filter>
     <filter-name>monitoringfilter-name>
     <filter-class>net.bull.javamelody.MonitoringFilterfilter-class>
    filter>

    ... other <filter>s from the default web.xml here ...

    <filter-mapping>
     <filter-name>monitoringfilter-name>
     <url-pattern>/*url-pattern>
    filter-mapping>
    ... other <filter-mapping>s from the default web.xml here ...

    <listener>
     <listener-class>net.bull.javamelody.SessionListenerlistener-class>
    listener>
    ... other <listener>s from the default web.xml here ...
    ...
  • Edit hibernate.cfg.xml and add:
    name="jdbc.factory_class">net.bull.javamelody.HibernateBatcherFactory

Then restart XWiki and access JavaMelody at http://localhost:8080/xwiki/monitoring.

JMX Console

Since JMX is a standard you can use any JMX-compatible monitoring console (most application servers provide a web-based JMX console). There's also a console called JConsole which is bundled by default in the Java Runtime you're using. To start it, simply execute the jconsole executable.

Note that starting with XWiki 6.3, if you're using the Standalone Distribution (which bundles Jetty) you can now use start_xwiki.sh -j (or start_xwiki.sh --jmx) to monitor/manage the Jetty instance itself (it adds Jetty-specific MBeans):

jettymbeans.png

XWiki Caches Monitoring

XWiki can use different cache implementations. The JBoss Cache and JBoss Infinispan implementations have nice JMX features available as shown below.

Starting with XWiki 3.3 the default implementation is JBoss Infinispan.

With JBoss Infinispan

Since JBoss Infinispan natively supports JMX we benefit from this feature directly (JBoss documentation available here).

Prior to XWiki Enterprise 3.5 the JMX support was not enabled by default. To enable it, edit WEB-INF/cache/infinispan/config.xml and uncomment the two places where the "jmx" string is mentioned

Prior to XWiki 3.5 the JMX support was not enabled by default. To enable it, edit WEB-INF/cache/infinispan/config.xml and uncomment the two places where the "jmx" string is mentioned

Example showing the cache list and some statistic for a given cache:

infinispancache.png

Example showing how to clear a given cache from all its entries:

infinispancacheclearing.png

With JBoss Cache

Since JBoss Cache natively supports JMX we benefit from this feature directly (JBoss documentation available here).

Example showing all JBoss Caches in memory in a running instance, showing all the elements in the cache (example on the document cache):

jbosscache.png

Example showing Cache stats (for the document cache):

jbosscache-stats.png

Velocity Cache Monitoring

Velocity caches Velocity macros. XWiki offers a JMX view of the content of the Velocity caches.

JConsole examples showing the Velocity Cache monitoring:

jconsole1.png

jconsole2.png

JGroups Monitoring

JConsole example showing the JGroups monitoring:

jgroups.png

Interesting things to do on JGroups in the JMX console:

  • Change the log level on the protocols to enable logging
  • Disconnect a node from the cluster and reconnect it

Logback Monitoring

JConsole example showing how to modify the logging level for a category:

jmx-logging.png

Tomcat JMX Proxy Servlet

Tomcat has a JMX Proxy Servlet bundled in their manager webapp (see here and here for more details on Tomcat and JMX]].

Here's some useful URLs to use the JMX Servlet Proxy to list and set JGroups Protocol Levels:

  • To display the current log level for the TCPPING protocol: http://localhost:8080/manager/jmxproxy?qry=jgroups:type=protocol,cluster=event,protocol=TCPPING
  • To set the log level to info for the TCPPING protocol: http://localhost:8080/manager/jmxproxy?set=jgroups:type=protocol,cluster=event,protocol=TCPPING&att=Level&val=info

Others

Get Connected