Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Active session count per server

 
Abhishek Rath
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • 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
 
Karthik Shiraly
Bartender
Posts: 1208
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • 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: 1208
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • 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: 56
  • Mark post as helpful
  • send pies
  • 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: 56
  • Mark post as helpful
  • send pies
  • 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: 1208
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • 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.

 
Tim Moores
Bartender
Posts: 2839
46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PSI-Probe is awesome for such tasks: http://code.google.com/p/psi-probe/
 
Abhishek Rath
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • 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: 1208
25
Android C++ Java Linux PHP Python
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic