Wiki source code of Monitoring
Version 7.1 by Vincent Massol on 2011/05/06
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | {{box cssClass="floatinginfobox" title="**Contents**"}} | ||
2 | {{toc/}} | ||
3 | {{/box}} | ||
4 | |||
5 | There are 2 solutions you can use to monitor a running XWiki instance: | ||
6 | * [[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 startupscript. | ||
7 | * 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 | ** Monitor the Velocity macro caches | ||
9 | ** Monitor the JBossCache caches XWiki is using to cache Document data, Users & Groups data and more | ||
10 | ** Monitor the JGroups channel and protocols (when the XWiki Cluster feature is turned on) | ||
11 | |||
12 | {{info}} | ||
13 | XWiki also has a [[Monitor Plugin>>platform:AdminGuide.Logging#HActivatingtheXWikimonitoringfeature]] 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. | ||
14 | {{/info}} | ||
15 | |||
16 | = JMX Console = | ||
17 | |||
18 | Since JMX is a standard you can use [[any JMX-compatible monitoring console>>http://stackoverflow.com/questions/1744900/what-is-the-best-or-most-commonly-used-jmx-console-client]] (most application servers provide a web-based JMX console). There's also such a console called [[JConsole>>http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html]] and which is bundled by default in the Java Runtime you're using. To start it, simply execute the ##jconsole## executable. | ||
19 | |||
20 | == Velocity Cache Monitoring == | ||
21 | |||
22 | JConsole examples showing the Velocity Cache monitoring: | ||
23 | |||
24 | image:jconsole1.png | ||
25 | |||
26 | image:jconsole2.png | ||
27 | |||
28 | == JGroups Monitoring == | ||
29 | |||
30 | JConsole example showing the JGroups monitoring: | ||
31 | |||
32 | image:jgroups.png | ||
33 | |||
34 | Interesting things to do on JGroups in the JMX console: | ||
35 | * Change the log level on the protocols to enable logging | ||
36 | * Disconnect a node from the cluster and reconnect it | ||
37 | |||
38 | = Tomcat JMX Proxy Servlet = | ||
39 | |||
40 | 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]]. | ||
41 | |||
42 | Here's some useful URLs to use the JMX Servlet Proxy to list and set JGroups Protocol Levels: | ||
43 | * To display the current log level for the TCPPING protocol: {{{http://localhost:8080/manager/jmxproxy?qry=jgroups:type=protocol,cluster=event,protocol=TCPPING}}} | ||
44 | * 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}}} |