Wednesday, November 25, 2020

Apache get concurrent connection

Reference: https://www.cloudtechtiq.com/blog/check-apache-concurrent-connections-using-netstat-command


To Count Apache concurrent connection's, use any of the below commands.

netstat -nt | grep :80 | wc -l    
netstat -plan|grep :80 | wc -l    
netstat -an | grep 'EST' | wc -l    
netstat -ant | grep ESTABLISHED | grep :80 | wc -l    
ps -A | grep httpd | wc -l    
ps -ef | grep http | wc -l    
ps aux | grep httpd | wc -l    
ps aux | grep http | grep -v "\(root\|grep\)" | wc -l

To print the active Internet connections to the server at port 80 and sort the results, use the below commands.

netstat -an | grep :80 | sort 
netstat -plan | grep :80 
netstat -anp | grep :80

To calculate and count, number of connection currently established from each IP address with server.

netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

To calculate and count, number of connection currently established from each IP address through TCP or UDP protocol with server.

netstat -anp |grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -n

To Print ESTABLISHED connections instead of all connections, and displays the connections count for each IP

netstat -ntu | grep ESTAB | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr

To print the list of IP address and its connection count, that connect to port 80 on the server.

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

To print all the apache httpd actual processes in Linux, use the below commands.

ps -aux | grep httpd  or  ps -ef | grep httpd

Centos 7 reset root/ any user lost password / lockout due to cant remember password

1. Need to be in front of the terminal. (Physically if not vm). 2. Reboot the server 3. Press 'e' in the GRUB2 boot screen. 3. bunch...