~$ sudo apt-get

Summarize concurrent HTTP connections

by on Apr.01, 2009, under Apache, Linux

This will display how many different IPs are connected to the server via port 80.

netstat -plant | grep "insertIPhere:80" | awk '{ print $5 }' | cut -d ":" -f 1 | sort | uniq | wc -l

Modifying the previous slightly allows us to display, in descending order, all the IPs connecting on port 80 and how many active connections they have.

netstat -plant | grep "-insertIPhere:80" | awk '{ print $5 }' | cut -d ":" -f 1 | sort | uniq -c | sort -rn

Leave a Reply

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...