We want to check the number of active connections without the module HttpStubStatusModule being installed.

What would be the equivalent Linux command?

As a base line, we test on a machine with HttpStubStatusModule installed first, e.g.

Active connections: 6146 <-- from HttpStubStatusModule

# netstat -an | grep :80 | wc -l

# netstat -an | grep :443 | wc -l

It seems to me that none of the above netstat give me the correct figure.

Any idea?

  • Did you consider checking only for established connections? e.g. $ sudo netstat -antp | grep ESTABLISHED | grep nginx – kei1aeh5quahQu4U Jul 16 '13 at 19:49

Try excluding TIME_WAIT or grepping ESTABLISHED only

netstat -an | grep :443 | grep -v TIME_WAIT | wc -l


netstat -an | grep :443 | grep ESTABLISHED | wc -l
  • The two commands give very different results. The first reports 3380 connections but the second - just 9. Why is that so? We use WebSockets. Can this be the reason? – Martin Dimitrov Sep 24 '19 at 8:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.