Masoud Kalali has a software engineering degree and has been working on software development projects since 1998. He has experience with a variety of technologies (.NET, J2EE, CORBA, and COM+) on diverse platforms (Solaris, Linux, and Windows). His experience is in software architecture, design, and server-side development. Masoud has published several articles at Java.net and Dzone. He has authored multiple refcards, published by Dzone, including but not limited to Using XML in Java, Java EE Security and GlassFish v3 refcardz. He is one of the founder members of NetBeans Dream Team and a GlassFish community spotlighted developer. Recently Masoud's new book, GlassFish Security has been published which covers GlassFish v3 security and Java EE 6 security. Masoud's main area of research and interest includes service-oriented architecture and large scale systems' development and deployment and in his leisure time he enjoys photography, mountaineering and camping. Masoud's can be followed at his Twitter account. Masoud has posted 82 posts at DZone. You can read more from them at their website. View Full User Profile

Monitoring GlassFish Application Server's HTTP Service Using VisualVM

03.24.2009
| 20834 views |
  • submit to reddit
The GlassFish application server has some monitoring features which are exposed through its administration channels including Administration Console and asadmin utility. I disucssed some of these features here and in this we will see how we can use visualvm and its plugin as a desktop application to monitor GlassFish HTTP service.

VisualVM is JDK tool based on NetBeans platform, NetBeans profiler, and a handful of plug-ins which let us profile any Java application running in JDK 6 or 7. VisualVM does not works with older JDK or any JRE either 6 or 7. Starting from JDK 6 update 7 visualVM is included in the Sun JDK distribution.

Downloading and installing latest version of visualVM is straight forward, just point to Download Page grab the zip file, extract the zip file content and you are ready to go. Follow the installation instruction (4 very easy steps) here

Now, to monitor GlassFish HTTP service we need to install a visualVM plugin that can interact with GlassFish application server through its JMX/ AMX API to gather the statistics and let us view them live in our desktop application. Run visualVM using the provided script in the bin directory, Open Tools>Plugins menu item and from the available plug-ins section select VisualVM-GlassFish and press install button to install the plug-in. Restart VisualVM and now we are ready to connect to a GlassFish instance.


A_figure01.jpeg

Now we have two options, we can either monitor a local Glassfish instance or we can select to monitor a remote Glassfish instance. All local JVM are listed under the local node and in order to create a remote connection we need to register the host under the Remote node by right clicking on the node and adding the remote host, in my case I add 192.168.1.100. Now on the remote host we may have several JXM enabled applications running, each application on its own port. Default JMX port for GlassFish application server is 8686, therefore to add a GlassFish application server running on 192.168.1.100 we can right click on its node under the Remote node and select add JMX connection, a window will open which asks you to provide the connection information including port number and credentials. default administration credentials for GlassFish are admin/ adminadmin as username/ password. A_figure02.jpeg

Now that The remote GlassFish is registered the right side panel should be similar to the fillowing figure

A_figure03.jpeg

In my case I have a remote and a local GlassFish instances, When you double click on an instance a window will open that shows all monitoring information which VisialVM can gather about the running application in different panels, something similar to the following figure

A_figure04.jpeg

This page shows general information about the JVM which we are going to monitor and some of the plug-in specific configuration which we may need to change. Make sure that you turn the HTTP Service monitoring level and WebContainer Monitoring Level to High or LOW which will result in GlassFish gathering monitoring statistics about the HTTP Service.

A_figure05.jpeg

Now let your application server get some hit from the clients and then switch to HTTP Service Tab in order to get a general overview of your Server HTTP Service performance. Failed, Incoming, Average connections, Keep Alive, and File Cache performance can be monitored here. Following Figure shows HTTP Service Tab

A_figure06.jpeg

Now the funny part begins, Assuming that we have a dozen of application hosted in the same GlassFish instance we expect to be able to monitor each application separately to see how HTTP service is performing for that particular application. It is easy and do-able in no more than 3 steps. Under the GlassFish node you can see Model and under the Model you can see different web applications that you have hosted in your server, double clicking on any of those applications result in viewing the HTTP Service statistics for that particular application. For example If I double click on the admingui I will get a result page similar to the next figure.

A_figure07.jpeg

The fun part continues further I tell you that you can monitor different servlets used in your application separately. for example I can expand the admingui node and double click on ThemeServlet to get an statistical view similar to the next figure.

A_figure08.jpeg

All statistical information which are shown includes two major factors, processing time and error/ request count. in addition to average processing time, maximum processing time, and so on.

 

From http://weblogs.java.net/blog/kalali/


 

Published at DZone with permission of its author, Masoud Kalali.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

petro peter replied on Mon, 2009/04/06 - 9:53am

I am not able to view Profiler tab, when I added remote glassfish domain. jstatd is running on remote server. Am I missing something? Thanks for your help. Petro

jame jack replied on Wed, 2009/06/17 - 7:46pm

تحميل برامج برامج جوالات العاب بنات تكنولوجيا كتب تعليم UltraSurf Internet Download Manager ProgDVB برامج مجانية أفضل المواقع العربية مشاهدة محطات مشفرة Online TV Player 3.0.0.940 Internet Download Manager 5.17 Build 4 رقص شرقي anyTV Pro 4.32 OnLineLive 7.1.1 هزي يانواعم ProgDVB 6.06.2 SopCast 3.0.3 Falco Image Studio 3.6 لعبة تزلج على الجليد UltraSurf 9.4 كاثرين هيغل Katherine Heigl محطة غنوة FreeZ Online TV 1.0 Free Video to Mp3 Converter 3.1.3.51 Advanced MP3 Converter 2.10 Xilisoft Video to Audio Converter 5.1.23.0515 Blaze Media Pro 8.02 AKRAM Media Creator 1.11 DVD Audio Extractor 4.5.4 Free WMA to MP3 Converter 1.16 لعبة نينجا المتقدم لعبة قذف كرة لعبة دراجات البهلوانية لعبة اعداء الغابة تحميل برامج Download DivX Subtitles 2.0 BullGuard 8.5 Google Chrome 2.0.181.1 Dev Dell Studio XPS Desktop 435T Intel Matrix Storage Manager A00 Gigabyte GA-EP45-UD3P Bios F9 Ambush HDConvertToX 1.1.229.1764 MSI Wind Nettop CS 120 Realtek Audio Driver 5.10.0.5618 Biostar T41-A7 6.x Realtek On-Board Audio Driver 5.10.0.5735 for 2000/2003/XP TweakNow RegCleaner 4.1.1 SpeedItup Free 4.97 برامج العاب - Internet Download Manager - برامج جوالات - العاب - محطة غنوة - قنوات فضائية - بنات - تكنولوجيا - كتب تعليم - UltraSurf -

dfdf dfd replied on Thu, 2009/06/25 - 1:18am

I like the ed hardy clothing. ed hardy is one of the most popular brands. ed hardy sale displays the brilliant work of Don ed hardy uk. He is a gifted painter, printmaker and tattoo artist. cheap ed hardy offerings include ed hardy tank, Ed Hardy Kids T-shirts, ed hardy on sale, ed hardy handbags, ed hardy discount etc. ed hardy swimwear is just 4 years old and was launched by Audigier in 2004. There were many Hollywood stars who wear his ed hardy sunglasses. Some of the famous celebrities include Ed Hardy Belts, Jessica Alba, Mariah Carey, Paris Hilton etc.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.