Find out the number of connections to tomcat server

后端 未结 3 1587
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-03 10:55

I have a Java/Java EE web application deployed on Tomcat Server 5.5.17. I want to know the number of clients which are connected to the server. How can we find it out?

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-03 11:15

    And if you need to figure to what each connection is doing , use this on linux

    netstat -an | grep :8080 | awk '{print $6}'
    

    If there are three connections , you will see

    LISTEN TIME_WAIT TIME_WAIT

    And if you only want to count connections which are in TIME_WAIT state

    netstat -an | grep :8080 | grep TIME_WAIT | wc -l
    

提交回复
热议问题