New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
How to check concurrent connections?
Dear all,
I wanted to find out how many concurrent connections my server is having on port 80. I thought that this should do the trick:
netstat -an | grep 80 | grep ESTA | wc
But the output consists of three numbers instead of one that I would have expected:
45 270 4005
What am I doing wrong, respectively why are there 3 numbers as output?
Thank you very much for any enlightment in advance!
Kind regards
-A
Comments
Replace 'wc' with 'wc -l'
Elaboration: wc stands for word count, but it can count several things - bytes, words, and lines. Judging from your output, it's giving you the output in the format [lines words bytes]. Using the -l switch will tell it to only give you the line count.
If you use 'wc -l' instead of just 'wc' it will return the number of lines only.
Thank you both!
netstat -an | grep 80 | grep -c ESTA
@prometeus: Cool! One command less! :-) Thanks!
If you are using Apache.
pgrep httpd | wc -l
Thank you, but it's nginx!
There's nginx's status module: http://wiki.nginx.org/HttpStubStatusModule
And a little script I wrote to make the output a bit more human-friendly: http://blite.ca/?t=19
That's great! Thank you, sleddog!