Mar 18 2009

how to count connections on windows command line

Published by jfrank at 3:20 pm under Uncategorized

At work I am troubleshooting apache/tomcat/coldfusion/magnolia stack on windows. It is the most fun thing you can imagine. I was messing with apache’s configuration on mod_proxy_balancer and I needed to a way to test if my settings were having the desired effect.

I ran into a *nix shell script that did this, but not one for windows. This is super simple way to count connections against your localhost’s port 80, web server. It shows established and waiting connections.

Save this as a  .bat file and it will output them. It could be optimized in a number of ways, but who cares!

echo port 80:
netstat -a -n | find "TCP " | find /C "ESTAB"
netstat -a -n | find "TCP " | find /C "TIME_WAIT"

No responses yet

Trackback URI | Comments RSS

Leave a Reply