리눅스
[Centos6] mysql 및 apache connection 관련 설정
징쟝
2019. 9. 25. 11:23
- mysql 접속후
* Connection 관련 환경변수 값 확인
show variables like '%max_connection%';
show variables like '%wait_timeout%';
show global variables like '%wait_timeout%';
* 현재 Connection 관련된 상태들 보기
show status like '%connect%';
* Connection 관련 변수 설정(즉시 적용됨)
set global max_connections=4000;
set global wait_timeout=300;
- Apache
netstat -nap | grep :80 | grep ESTABLISHED | wc -l
netstat -n|grep -F :80|egrep '(ESTAB|SYN)'|awk '{print $5}'|sed 's/:[0-9]*//'|sort -u|wc -l
netstat -tuanp | grep -i time_wait | wc -l
cat /proc/sys/net/ipv4/tcp_keepalive_time
cat /proc/sys/net/ipv4/tcp_keepalive_intvl
echo 180 > /proc/sys/net/ipv4/tcp_keepalive_time
echo 60 > /proc/sys/net/ipv4/tcp_keepalive_intvl
* 현재 접속자수 보기
ps -ef | grep apache | wc -l