How do I check how many HTTP connections are open currently?

There are about a zillion ways to do this but:

netstat | grep http | wc -l

Keep it mind that http is a stateless protocol. Each line can represent one client opening multiple sockets to grab different files (css, images, etc) that will hang out for awhile in a timewait state.


Below are some commands of netstat using which you can check the number of connections a server has.

To display all active Internet connections to the servers, only established connections are included.

netstat -na

To display only active Internet connections to the server at port 80 and sort the results, allow to recognize many connections coming from one IP

netstat -an | grep :80 | sort

To display the list of the all IP addresses involved instead of just count.

netstat -n -p | grep SYN_REC | sort -u

If your webserver is apache, you can also use the server-status page (after enabled it).