jconsole - a basic guide

13
Learning to use JCONSOLE – a basic Guide ....... INDEX – Click on the link below to navigate to desired section How to use jconsole to track memory usage, cluster info and key distribution for Distributed Rubux. Various Memories in java Finding out the memory usage of various rubix cubes. Finding out the hsqldb database State and Cluster Information. Finding out the key distribution in Distributed Rubix using jconsole.

Upload: deeksha-aneja

Post on 15-Dec-2015

3 views

Category:

Documents


0 download

DESCRIPTION

.

TRANSCRIPT

Page 1: Jconsole - A Basic Guide

Learning to use JCONSOLE – a basic Guide ....... INDEX – Click on the link below to navigate to desired section

How to use jconsole to track memory usage, cluster info and key distribution for Distributed Rubux.

Various Memories in java

Finding out the memory usage of various rubix cubes.

Finding out the hsqldb database State and Cluster Information.

Finding out the key distribution in Distributed Rubix using jconsole.

How to use jconsole to track memory usage, cluster info and key distribution for Distributed Rubux.

Page 2: Jconsole - A Basic Guide

Steps to use attach jconsole to tomcat server so that it can be accessed remotely.

ssh to the UI server which you want to connect via jconsole.

Go to /data/apache-tomcat/apache-tomcat-7.0.27/bin/vi setenv.shadd the following at the end of this file:

-Djava.rmi.server.hostname=192.168.151.19 -Dcom.sun.management.jmxremote.port=8089 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false

Start the tomcat server.

Now, from your desktop run “jconsole”, the following New Connection screen would appear.

Enter Remote process as : <Server ip> : <port number configured in setenv.sh>

Click Connect.

This would open up the console as shown below.

Page 3: Jconsole - A Basic Guide

Various Memories in java

Page 4: Jconsole - A Basic Guide

Before understanding about jconsole, lets first see what all types of memories are there in java

Heap Memory

Class instances and arrays are stored in heap memory. Heap memory is also called as shared memory. As this is the place where multiple threads will share the same data.

Class instances and arrays are stored in heap memory. Heap memory is also called as shared memory. As this is the place where multiple threads will share the same data

Non-heap Memory

It comprises of ‘Method Area’ and other memory required for internal processing. So here the major player is ‘Method Area’.

Memory Generations

HotSpot VM’s garbage collector uses generational garbage collection. It separates the JVM’s memory into and they are called young generation and old generation.

Young Generation

Young generation memory consists of two parts, Eden space and survivor space. Shortlived objects will be available in Eden space. Every object starts its life from Eden space. When GC happens, if an object is still alive and it will be moved to survivor space and other dereferenced objects will be removed.

Old Generation – Tenured and PermGen

Old generation memory has two parts, tenured generation and permanent generation (PermGen). PermGen is a popular term. We used to error like PermGen space not sufficient.

GC moves live objects from survivor space to tenured generation. The permanent generation contains meta data of the virtual machine, class and method objects.

Note: We are basically interested in finding ps_old_gen for tomcat, so run Garbage Collection and note the value of ps_old_gen.

Finding out the memory usage of various rubix cubes.

Page 5: Jconsole - A Basic Guide

Click on Mbeans Button and open com.guavus.rubix.cache RubixCacheMonitorMBeans AttributedStats

Table shown on the right side shows the memory distribution of each of the rubix cubes as well as the cache points that were configured and out of those how many have been filled.

Here is the screenshot of the section.

Below is the sample output of this table, highlighted are the sample stats of an aggregate cube with cache eviction limit set as 233 with cache points as 34 have been filled.

CacheIdentifier =[TuplesCount, inMemoryTimes, maxInMemory, MetaDataSize(MB), isDoubleDataType, Cache(MB)<, DimensionsCardinality]DEVICE_APP_CAT_SEGMENT_DC_SUBSC_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[37, 34, 233, 0.0186, false, 39.0, [12, 1, 4, 1]]DEVICE_URL_CAT_SEGMENT_DC_TS=1_=1_TYPE=0_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[890, 720, 1464, 0.3111, true, 45.0, [12, 14, 6, 1]]DC_RAT_URL_CAT_DEVICE_SINGLE_MEAS_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[1715, 32, 233, 0.7238, true, 4.0, [1, 1, 14, 12, 294, 1]]DC_URL_CAT_SUB_SP_APP_TYPE_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_DimensionListContainsSubscriber=0_SERVICE_SE_BIN=1=[0, 32, 233, 0.0018, true, 0.0, [0, 0, 0, 0, 0]]DC_RAT_URL_CAT_SEGMENT_SP_APP_TYPE_TS=1_=1_TYPE=0_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[524, 48, 1464, 0.2267, true, 1.0, [1,

Page 6: Jconsole - A Basic Guide

1, 14, 4, 151, 1]]DC_RAT_APP_CAT_DEVICE_SINGLE_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[58, 32, 233, 0.0243, true, 0.0, [1, 1, 1, 12, 14]]DC_SUBSCR_APP_CAT_APP_SINGLE_AGG_MEAS=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_DimensionListContainsSubscriber=0_SERVICE_SE_BIN=1=[0, 32, 233, 0.0017, true, 0.0, [0, 0, 0, 0]]DEVICE_URL_CAT_SEGMENT_DC_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[511, 33, 233, 0.1611, true, 1.0, [12, 14, 4, 1]]DC_RAT_URL_CAT_SUBSCR_DEVICE_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_DimensionListContainsSubscriber=0_SERVICE_SE_BIN=1=[0, 32, 233, 0.0018, true, 0.0, [0, 0, 0, 0, 0]]DC_RAT_APP_CAT_DEVICE_SUBSC_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[58, 34, 233, 0.0289, false, 61.0, [1, 1, 1, 12, 14]]DC_DEVICE_SUBSC_ALL_MEAS_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_DimensionListContainsSubscriber=0_SERVICE_SE_BIN=1=[0, 32, 233, 0.0016, true, 0.0, [0, 0]]DC_RAT_APP_CAT_SEGMENT_APP_AGG_SUBSC=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[25, 33, 233, 0.0161, false, 25.0, [1, 1, 1, 4, 8]]DC_RAT_APP_CAT_DEVICE_TS=1_=1_TYPE=0_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[58, 48, 1464, 0.025, true, 0.0, [1, 1, 1, 12, 14]]DC_DEVICE_SUBSC_ALL_MEAS_TS=1_=1_TYPE=0_TIME_GRANULARITY=3600_DimensionListContainsSubscriber=0_SERVICE_SE_BIN=1=[0, 48, 1464, 0.0024, true, 0.0, [0, 0]]DC_RAT_APP_CAT_SUBSCR_DEVICE_TS=1_=1_TYPE=0_TIME_GRANULARITY=3600_Source=1_DimensionListContainsSubscriber=0_SERVICE_SE_BIN=1=[0, 48, 1464, 0.0025, true, 0.0, [0, 0, 0, 0, 0]]DC_REGION_AREA=1_=1_TYPE=1_TIME_GRANULARITY=3600=[1, 32, 233, 0.0021, true, 0.0, [1, 1, 1]]DC_RAT_APP_CAT_SEGMENT_APP_TS=1_=1_TYPE=0_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[25, 48, 1464, 0.0124, true, 0.0, [1, 1, 1, 4, 8]]DC_URL_CAT_AGG_SUBSC=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[14, 33, 233, 0.0098, false, 14.0, [1, 14]]DC_RAT_URL_CAT_SEGMENT_SP_APP_TYPE_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[524, 32, 233, 0.2259, true, 1.0, [1, 1, 14, 4, 151, 1]]SEGMENT_LOCAL=1_=1_TYPE=1_TIME_GRANULARITY=3600=[4, 32, 233, 0.0027, true, 0.0, [4, 2]]DC_LOCAL=1_=1_TYPE=1_TIME_GRANULARITY=3600=[1, 32, 233, 0.0019, true, 0.0, [1, 1]]DC_DEVICE_SEGMENT_ALL_SUBSC=1_=1_TYPE=1_TIME_GRANULARITY=3600=[26, 36, 233, 0.0142, false, 29.0, [1, 12, 4]]SP_LOCAL=1_=1_TYPE=1_TIME_GRANULARITY=3600=[294, 32, 233, 0.0763, true, 0.0, [294, 2]]DC_RAT_APP_CAT_SUBSCR_DEVICE_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_DimensionListContainsSubscriber=0_SERVICE_SE_BIN=1=[0, 32, 233, 0.0018, true, 0.0, [0, 0, 0, 0, 0]]DEVICE_APP_CAT_SEGMENT_DC_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[37, 32, 233, 0.014, true, 0.0, [12, 1, 4, 1]]DEVICE_APP_CAT_SEGMENT_DC_TS=1_=1_TYPE=0_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[37, 48, 1464, 0.0148, true, 0.0, [12, 1, 4, 1]]DC_DEVICE_SEGMENT_CONC_FLOW_MEAS=1_=1_TYPE=0_TIME_GRANULARITY=3600=[26, 48, 48, 0.01, false, 39.0, [1, 12, 4]]

Page 7: Jconsole - A Basic Guide

APP_LOCAL=1_=1_TYPE=1_TIME_GRANULARITY=3600=[15, 32, 233, 0.0055, true, 0.0, [15, 2]]DC_RAT_URL_CAT_SEGMENT_SP_APP_TYPE_AGG_SUBSC=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[524, 34, 233, 0.2305, false, 557.0, [1, 1, 14, 4, 151, 1]]DEVICE_LOCAL=1_=1_TYPE=1_TIME_GRANULARITY=3600=[30, 32, 233, 0.0093, true, 0.0, [30, 2]]RAT_LIST=1_=1_TYPE=1_TIME_GRANULARITY=3600=[1, 32, 233, 0.0018, true, 0.0, [1]]DC_RAT_URL_CAT_DEVICE_AGG_SUBSC=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[1715, 32, 233, 0.7281, false, 1717.0, [1, 1, 14, 12, 294, 1]]DC_RAT_APP_CAT_SEGMENT_APP_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[25, 32, 233, 0.0116, true, 0.0, [1, 1, 1, 4, 8]]DC_SEG_APP_CAT_AGG_SUBSC=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[1, 33, 233, 0.0066, false, 1.0, [1, 1, 1]]DC_APP_CAT_AGG_SUBSC=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[1, 34, 233, 0.0065, false, 1.0, [1, 1]]DC_SEG_URL_CAT_AGG_SUBSC=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[3, 34, 233, 0.0073, false, 3.0, [1, 1, 3]]DC_DEVICE_SEGMENT_ALL_AGG_MEAS=1_=1_TYPE=1_TIME_GRANULARITY=3600=[26, 33, 233, 0.0093, true, 0.0, [1, 12, 4]]DC_URL_CAT_SUB_SP_APP_TYPE_ALL_TS=1_=1_TYPE=0_TIME_GRANULARITY=3600_Source=1_DimensionListContainsSubscriber=0_SERVICE_SE_BIN=1=[0, 48, 1464, 0.0025, true, 0.0, [0, 0, 0, 0, 0]]DC_RAT_URL_CAT_SUBSCR_DEVICE_TS=1_=1_TYPE=0_TIME_GRANULARITY=3600_Source=1_DimensionListContainsSubscriber=0_SERVICE_SE_BIN=1=[0, 48, 1464, 0.0025, true, 0.0, [0, 0, 0, 0, 0]]DC_DEVICE_SEGMENT_ALL_TS_MEAS=1_=1_TYPE=0_TIME_GRANULARITY=3600=[26, 48, 1464, 0.01, true, 0.0, [1, 12, 4]]DC_DEV_APP_CAT_AGG_SUBSC=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[12, 35, 233, 0.0095, false, 13.0, [12, 1]]DEVICE_URL_CAT_SEGMENT_DC_SUBSC_AGG=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[504, 34, 233, 0.1636, false, 536.0, [12, 14, 4, 1]]DC_RAT_URL_CAT_DEVICE_SINGLE_TS=1_=1_TYPE=0_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[1715, 48, 1464, 0.7245, true, 5.0, [1, 1, 14, 12, 294, 1]]DC_DEV_URL_CAT_AGG_SUBSC=1_=1_TYPE=1_TIME_GRANULARITY=3600_Source=1_SERVICE_SE_BIN=1=[168, 35, 233, 0.0422, false, 183.0, [12, 14]]DC_SUBSCR_APP_CAT_APP_SINGLE_TS_ALL_MEAS=1_=1_TYPE=0_TIME_GRANULARITY=3600_Source=1_DimensionListContainsSubscriber=0_SERVICE_SE_BIN=1=[0, 48, 1464, 0.0025, true, 0.0, [0, 0, 0, 0]]total=[ , , , 3.9071, 3275.0, ]

Finding out the hsqldb database State and Cluster Information.

Click on Mbeans Button and open net.sf.hajdbc cluster1 tag.

Page 8: Jconsole - A Basic Guide

This section has the information of all the databases that are part of the cluster also out of these these are active/inactive.

Below is a sample screenshot.

Finding out the key distribution in Distributed Rubix using jconsole.

Page 9: Jconsole - A Basic Guide

Click on MBeans and expand com.guavus.rubix.hibernate.mbean HSQLQueryExecutionExecutorMBeans executeSearchTableQuery, this would show up a screen like shown below.

Now, enter the required query in the textbox and click the “executeSearchTableQuery” Button.

Here are some sample queries to find out the key distribution of DC, Device, Service Providers etc. on the current UI node.

select DEVICE_ID from DeviceLocalSearchTable where local =1

Use - To find the keys of Devices stored at the current Node.

select COUNT(*) from DeviceLocalSearchTable where local =1

Use - To find the total number of devices residing at current Node.

These are some more queries for your ref., same query logic mentioned above applies here as well.

select SERV_PROV_ID from SPLocalSearchTable where local=1 select COUNT(*) from SPLocalSearchTable where local=1 select APP_ID from AppLocalSearchTable where local=1 select COUNT(*) from AppLocalSearchTable where local=1 select SEGMENT_ID from SegmentLocalSearchTable where local=1 select DIST_CENTRE_ID from DCLocalSearchTable where local=1

Sampe output screen for queries that was fired for Device_ID

Page 10: Jconsole - A Basic Guide

Sample query output fired to find the number of App IDs present at this Rubix node