Summarize concurrent HTTP connections
by sudo 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