javaspringspring-boottomcat

See number of users connected to a Spring Boot and Tomcat application


Is it possible to get the number of users connected to an application with an off-board Tomcat?

I tried to use netstat -ano to see the process.

Also I tried ps -ef | grep java but it gave me info that I'm not sure is correct.


Solution

  • Several options:

    1. Check the number of active sessions in Tomcat Manager:


    2. Use netstat

    netstat -an | grep 8080 | grep ESTABLISHED | wc -l


    You could also try to see it in java code - see here