Wednesday 20 January 2016

how to check number of connections mysql , apache etc in linux

Q) How To check numbers of connections created in linux server for TCP/ip port ?

Ans. open terminal and type command .

#netstat -pn | grep -i  :3306 | wc -l 


The above command will give you information that how many sql connection created  for mysql server . Mysql server by defaults used port 3306 .


#netstat -pn | grep :80 | wc -l





The above command will give you information that how many http connection created  for Apache server . Apache server by defaults used port 80 .



 Similarly you can  check list of ip connections and protocol information

#netstat -pn | grep :80


#netstat -pn | grep -i :3306