Skip to main content

How to monitor GF Http sessions using JMX

13 replies [Last post]
bitec
Offline
Joined: 2008-12-26
Points: 0

Hi.

Would like to know the name of mbeans, which can provide interesting information about current sessions/requests in GF:

  1. number of sessions/destroyed sessions
  2. number of http requests
  3. some actual information about each sessions (attributes, objects in the sessions)

Actually, any interesting experience using JMX beans from GF 3.1 is interesting. Currently I have troubles with memory in production server, would like to use the fastest method of analysing the situation -JMX. Cannot use GF Monitoring from admin console as using the open Gf distribution. So even don't know some base information about what is happening on the server now :(

Thanks

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
tmueller
Offline
Joined: 2005-10-31
Points: 0

To see the monitoring mbeans, monitoring must be enabled first. Use:

asadmin enable-monitoring --modules web-container,http-service

Then connect to the GlassFish server using jconsole. If running jconsole
on the same host as you server, enter "localhost:8686" for the remote
host name. After connecting, click on the MBeans tab. The GlassFish
mbeans are all under the "amx" node in the tree. To see sessions, look
for the session-mon bean. To see requests, look for the web-request-mon
bean.

Another way to monitor the server is to connect to is using jvisualvm.
This will show memory, threads, etc.

Tom

jc129909
Offline
Joined: 2005-03-30
Points: 0
  1. The open source edition does have monitoring available in the Admin Console.

    Enable web container monitoring:
    Configurations > xxx-config > Monitoring > set the Monitoring Level to HIGH for Web Container.

    server (Admin Server) > Monitor
    Clusters > cluster_name > Instances > select instance in the table > Monitoring

    You will see monitoring for session and request statistics.

  2. For the mbean names, run jconsole. Connect remotely using the jmx connector port. By default it is #8686. Then go to MBeans > open amx folder > session-mon will show the session statistics. For example, the name will be like: amx:pp=/mon/server-mon[server],type=session-mon,name=hello/server. Under web-request-mon folder, you will see the request statistics. The name will be like amx:pp=/mon/server-mon[server],type=session-mon,name=hello/server.
  3. You may also use REST. You can point the browser at http://localhost:4848/monitoring/domain and click thru to the stats you want, like http://localhost:4848/monitoring/domain/server/applications/hello/server. There more info here http://blogs.steeplesoft.com/2011/02/restful-glassfish-monitoring/.
bitec
Offline
Joined: 2008-12-26
Points: 0

Can anyone explain me, why activesessionscurrent is negative? Yesterday evening it was about 83, this morning it is -5. And the lowwatermark : -18

Unfortunately I cannot rely on such statistics, will have to make my own statistics based on session listeners... Very pity again.

amyroh
Offline
Joined: 2004-05-06
Points: 0

Which GF version are you using?

On 9/20/11 11:23 PM, forums@java.net wrote:
> Can anyone explain me, why activesessionscurrent is negative? Yesterday
> evening it was about 83, this morning it is -5. And the lowwatermark :
> -18
>
> Unfortunately I cannot rely on such statistics, will have to make my own
> statistics based on session listeners... Very pity again.
>
>
> --
>
> [Message sent by forum member 'bitec']
>
> View Post: http://forums.java.net/node/844876
>
>

bitec
Offline
Joined: 2008-12-26
Points: 0

GF Open Source Edition 3.1 (build 43).

amyroh
Offline
Joined: 2004-05-06
Points: 0

Actually, can you try with 3.1.1 and file an issue if it exists? We
can't do much with 3.1 workspace.

On 9/21/11 1:29 PM, forums@java.net wrote:
> GF *Open Source Edition 3.1 (build 43).*
>
>
> --
>
> [Message sent by forum member 'bitec']
>
> View Post: http://forums.java.net/node/844876
>
>

bitec
Offline
Joined: 2008-12-26
Points: 0

I don't know, when will migrate to new version of GF on production. So far using 3.1. I missed the data after server restart, now all numbers are positive though not sure, that this is a real number of sessions for the application.

I will create the issue if this happens again for the new version of GF.

amyroh
Offline
Joined: 2004-05-06
Points: 0

We have some tests for monitoring session numbers and they are passing.

Please do file an issue with your environment\webapp detail if you
experience the issue again.

Thanks,
Amy

On 9/22/11 1:01 AM, forums@java.net wrote:
> I don't know, when will migrate to new version of GF on production.
> So far
> using 3.1. I missed the data after server restart, now all numbers are
> positive though not sure, that this is a real number of sessions for the
> application.
>
> I will create the issue if this happens again for the new version of GF.
>
>
> --
>
> [Message sent by forum member 'bitec']
>
> View Post: http://forums.java.net/node/844876
>
>

amyroh
Offline
Joined: 2004-05-06
Points: 0

Can you file an issue please? We'll take a look at it.

http://java.net/jira

On 9/21/11 1:29 PM, forums@java.net wrote:
> GF *Open Source Edition 3.1 (build 43).*
>
>
> --
>
> [Message sent by forum member 'bitec']
>
> View Post: http://forums.java.net/node/844876
>
>

jc129909
Offline
Joined: 2005-03-30
Points: 0

It could be related to http://java.net/jira/browse/GLASSFISH-16843. You may want to add a comment to the issue.

yhjhoo1986
Offline
Joined: 2011-07-09
Points: 0

In the monitor, the session created time is not human readable. And it does not show the expire time.

It should also privide a function like tomcat to distroy the session.

bitec
Offline
Joined: 2008-12-26
Points: 0

jc129909, great post, many thanks!! I haven't ever known about such features of GF, it has always been too untransparent for me... Now I can see almost all statistics I need :) Now will include Jamon to see pages hits statistics and that's all for now ))

Do you know about some possibility to research user sessions through jmx: object counts for example. That's not a good way for html/rest statistics, but good candidate for JMX.

Thanks again!

pauldavies
Offline
Joined: 2007-01-03
Points: 0

Hi,

The Oracle GlassFish Server product documentation explains in some
detail how to use REST interfaces to administer GlassFish Server
.
This information is also provided in the Administration Guide in theZIP
archive of PDF guides

for GlassFish Server open-source edition.

-Paul

On 9/20/2011 8:08 AM, forums@java.net wrote:
> jc129909, great post, many thanks!! I haven't ever known about such
> features of GF, it has always been too untransparent for me... Now I
> can see
> almost all statistics I need :) Now will include Jamon to see pages hits
> statistics and that's all for now ))
>
> Do you know about some possibility to research user sessions through jmx:
> object counts for example. That's not a good way for html/rest
> statistics,
> but good candidate for JMX.
>
>
>
> Thanks again!
>
>
> --
>
> [Message sent by forum member 'bitec']
>
> View Post: http://forums.java.net/node/844876
>
>