• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Active session count per server

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

We have a distributed Web application deployed in Tomact server.We are trying to find out the no of active session per server for a given period of time.
Could you please let me know if we can find it out by using some tool or by programatically..

Regards
Abhishek Rath
 
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Option 1: Using JMX
- Start Tomcat with its JMX agent enabled
- Use jconsole to connect to Tomcat over JMX. The "Catalina/Manager" JMX object will give you active sessions for each webapp.
- If you want it programmatically, write a JMX client

Option 2: Write a custom HttpSessionListener and implement your own session count logging.

In my opinion, option 1 is better for you because you can use the same client to query all your servers and aggregate the data.

 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Update: Just struck me that if you're already running a production cluster, then it's likely you're already using a system monitoring tool like collectd / nagios / ganglia, etc.
If so, they will very likely have plugins to get JMX data and graph it (I know for sure that collectd does...google says ganglia and nagios can too).
 
Abhishek Rath
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Karthik

Thanks a lot for the info.I have another query.In our case many web applications are deployed in each server.So does JMX+Jconsole provide the count per server or per web apps?


Regards
Abhishek Rath
 
Abhishek Rath
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Karthik

I will get the information about the monitoring tools being used in prod.I know App Dynamics is being used in the production.

Regards
Abhishek Rath

 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Abhishek Rath wrote:In our case many web applications are deployed in each server.So does JMX+Jconsole provide the count per server or per web apps


Each tomcat has 1 JMX agent running, which provides session counts for every individual webapp running in that tomcat instance.
Try out with jconsole - you'll understand easily. It'll show a node under Manager for each webapp, and each node reports an 'activeSession' variable.

 
Saloon Keeper
Posts: 7585
176
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
PSI-Probe is awesome for such tasks: http://code.google.com/p/psi-probe/
 
Abhishek Rath
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Karthik Shiraly

I checked the J Console UI and please see the attached screen shot for the active session.Could you please check and let me know If I am referring to the correct path or not.

Regards
Abhishek Rath
active_session_Jconsole.JPG
[Thumbnail for active_session_Jconsole.JPG]
 
Karthik Shiraly
Bartender
Posts: 1210
25
Android Python PHP C++ Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, that's the one. Your screenshot is showing for /manager webapp; similarly, every other webapp will have its own activesession counter.
 
reply
    Bookmark Topic Watch Topic
  • New Topic