define( 'WPCACHEHOME', '/srv/www/www.ichilton.co.uk/html/blog/wp-content/plugins/wp-super-cache/' ); //Added by WP-Cache Manager December, 2009 | Ian Chilton

Archive

Archive for December, 2009

See a list of current connections to your web server

December 2nd, 2009 No comments

If you have a high load on your web server, it’s useful to be able to see a list of the current connections on port 80 as sometimes high load can be caused by someone abusing the site – for example scraping it or some kind of denial of service attack.

This code will show a list of the ip’s currently connected to your server on port 80 with a count of the number of connections to the left of it. It’s ordered by the number of connections – highest first:

netstat -ntulpa | grep :80 | awk '{print $5}' | cut -d: -f1 | sort -n | uniq -c | sort -n -r

Categories: UNIX Tags: , , ,