Management of the resources of a platform is critical for production usage. The eXo Platform product is exposed as a manageable set of resources that can be inspected at runtime to monitor and manage servers.
When it comes to Java, the Java Management Extension (also known as JMX) is the de-facto standard to expose managed resources externally.
This chapter explains the various resources provided by the eXo Platform server, the management actions that can be performed, and how to obtain relevant metrics.
Resource management is exposed via the JMX layer. eXo Platform registers a set of MBean entities in an MBeanServer.
At runtime, the MBeans are registered by the eXo Kernel in the MBeanServer, which the application server creates, and the MBeans are directly viewable in the JMX console. However, we do advocate using a better JMX client such as the JVisualVM, available since Java 6.
In order to enable JMX monitoring in Tomcat, you need to pass the following system property to the VM : -Dcom.sun.management.jmxremote
The built-in REST Managment Provider of GateIn makes some of the MBeans operations accessible as REST endpoints. Administrators could handle the system simply with a browser; no complex configuration needs to be performed.
Only members of the platform/administrators group are given permission to work on REST management. The authentication requires login/password of the user's account.
The base URL to access the REST endpoints is http://localhost:8080/rest/managment, with the last one followed by the parameter parsed in the managed resource's @RESTEndpoint annotation, leading slash then targeted operation. Consider the SkinService, which is annotated @RESTEndpoint("skinservice"); the full URL to access JMX 'getSkinList' method through REST request is http://localhost:8080/rest/management/skinservice/getSkinList
PortalContainer manages all objects and configurations for a given portal. The JMX name is exo:container=portal,name="portal"
configurationXML: provides the effective runtime configuration calculated by the loading mechanism. URLs used to load parts are indicated to help.
registeredComponentNames: provides the list of all components registered.
Cache is essential for improving the performance of a server infrastructure.
Each cache is exposed and provides statistics and management operations. The JMX name of each cache MBean uses the template exo:service=cache,name=CacheName where CacheName is the name of the cache.
| Attribute | Description |
|---|---|
Capacity
| the maximum capacity of the cache |
HitCount
| the number of times the cache was successfully queried |
MissCount
| the number of times the cache was queried without success |
Size
| gives the number of entries in the cache |
TimeToLive
| attribute gives the maximum lifetime that an entry is considered valid. A value of 1 means that the entries will never become stale |
| Operation | Description |
|---|---|
clearCache()
| evicts all the entries from the cache. It can be used to force a programmatic flush of the cache |
The cache service manages the different caches. The JMX name is exo:service=cachemanager.
| Operation | Description |
|---|---|
clearCaches()
| force a programmatic flush of all the registered caches |
Picketink is the default implementation for the organization model. It uses its own cache JMX management interface under the name exo:portal="portal",service=PicketLinkIDMCacheService,name=plidmcache. invalidateAll(): invalidate all caches invalidate(namespace): invalidates a specific cache namespace
WCM provides a management view for:
The WCM Composer is responsible for assembling the pages, and is key for serving pages efficiently. The JMX name is exo:portal="portal",service=composer,view=portal,type=content
Cached: whether the cache is used or not
CachedEntries: how many nodes are in the cache
cleanTemplates(): cleans all templates in the cache
setCached(cached): enables/disables caching in the composer
Portlet containers do provide a management view that consists mainly of statistic exposure. The JMX name of a portlet container follows this template: exo:application="Application",portlet="Portlet" where Application is the name of web application and Portlet is the portlet name in the web application.
Each portlet container has a corresponding managed resource that exposes statistics as attributes. The Portlet lifecycle has several phases (named action, event, render and resource). These are particular operations that a portlet can execute, and each is monitored.
| Attribute | Description |
|---|---|
ActionCount, EventCount, RenderCount and ResourceCount
| the number of executions of a particular portlet phase |
MeanActionTime, MeanEventTime, MeanRenderCount and MeanResourceCount
| the average time spent during the execution of a particular portlet phase |
MaxActionTime, MaxventTime, MaxRenderCount and MaxResourceCount
| the maximum time spent during the execution of a particular portlet phase |
MinActionTime, MinEventTime, MinRenderCount and MinResourceCount
| the minimum time spent during the execution of a particular portlet phase |
The portal management exposes the portal resources either for management or for obtaining statistics.
The template management exposes the various templates used by the portal and its components to render markup. Various statistics are available for individual templates, as well as aggregated statistics, such as the list of the slowest templates. Most of the management operations are performed on a single template; those operations take the template identifier as an argument. The JMX name of the template statistics MBean follows the template: exo:view=portal,service=statistic,type=template.
| Attribute | Description |
|---|---|
TemplateList
| the list of the templates loaded |
SlowestTemplates
| the list of the 10 slowest templates |
MostExecutedTemplates
| list of the 10 most used templates |
FastestTemplates
| list of the 10 fastest templates |
| Operation | Description |
|---|---|
getAverageTime(templateId)
| returns the average time spent in the specified template |
getExecutionCount(templateId)
| returns the number of times the specified template has been executed |
getMinTime(templateId)
| returns the minimum time spent in the specified template |
getMaxTime(templateId)
| returns the maximum time spent in the specified template |
Template management provides the capability to force the reload of a specified template. The JMX name of the template management MBean follows the template exo:view=portal,service=management,type=template.
| Operation | Description |
|---|---|
reload(templateId)
| reloads a specified template. The reload() operation reloads all the templates |
| Attribute | Description |
|---|---|
SkinList
| the list of the loaded skins by the skin service |
| Operation | Description |
|---|---|
reloadAll(skinId)
| forces a reload of the specified skin and the operation reloadSkins() forces a reload of the loaded skins |
GateIn uses several stores for tokens :
Memory Token Store : exo:portal="portal",service=TokenStore,name="memory-token"
JCR Token Store : exo:portal="portal",service=TokenStore,name="jcr-token"
Gadget Token Store : exo:portal="portal",service=TokenStore,name="gadget-token"
| Attribute | Description |
|---|---|
Name
| name of the store |
PeriodTime
| |
ValidityTime
|
| Operation | Description |
|---|---|
cleanExpiredTokens()
| purge tokens that have expired |
size()
| gthe number of tokens in the store |
The JMX name of the portal statistics MBean follows the template exo:view=portal,service=statistic,type=portal.
| Attribute | Description |
|---|---|
PortalList
| returns the list of the loaded portals |
| Operation | Description |
|---|---|
getThroughput(portalId)
| returns the number of request per second for the specified portal |
getAverageTime(portalId)
| returns the average time spent in a specified portal |
getExecutionCount(portalId)
| returns the number of times a specified portal has been executed |
getMinTime(portalId)
| returns the minimum time spent in the specified portal |
getMaxTime(portalId)
| returns the maximum time spent in the specified portal |
Various applications are exposed to provide relevant statistics. The JMX name of the application statistics MBean follows the template: exo:view=portal,service=statistics,type=application.
| Attribute | Description |
|---|---|
ApplicationList
| returns the list of the loaded applications |
SlowestApplications
| returns the list of the 10 slowest applications |
MostExecutedApplications
| returns the list of the 10 most executed applications |
FastestApplications
| returns the list of the 10 fastest applications |
| Operation | Description |
|---|---|
getAverageTime(applicationId)
| returns the average time spent in the specified application |
getExecutionCount(applicationId)
| returns the number of times the specified application has been executed |
getMinTime(applicationId)
| returns the minimum time spent in the specified application |
getMaxTime(applicationId)
| returns the maximum time spent in the specified application |