Web - Useful commands for web services

Some helpful commands for web services:

List of currently established connections:

netstat -na | grep 'ESTA' | wc -l 

netstat -an | grep :80 | grep -i EST | wc -l

Number of IP connections and IPs connected to port 80:

netstat -plan | grep :80 | awk {'print $5'} | cut -d: -f 1 | sort | uniq -c | sort -nk 1

Most viewed pages

awk '{print $7}' /path/to/log | sort | uniq -c | sort -rn | head -10

Top ten referrers

awk '{print $11}' /path/to/log | sort | uniq -c | sort -rn | head -10

Sort process by used memory

ps aux --sort -rss 

Guillaume Chenuet

Make it simple, but significant.