Nginx – Check nginx active connection without HttpStubStatusModule

linux-networkingnetstatnetworkingnginx

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
1266

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

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

Any idea?

Best Answer

Try excluding TIME_WAIT or grepping ESTABLISHED only

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

or

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