본문으로 건너뛰기

Mysql 컨넥션 관련


Too many Connection 문제로 좀 찾아봤던거 정리

프로세스 목록

show processlist;

슬립 상태이거나 타임을 보고 장시간 실행중인지 확인
kill id 로 슬립 프로세스를 없앨 수 있다

현재 컨넥션 수 확인

show global variables like 'max_connections';

변경할경우

set global max_connections = 200;

슬립 프로세스 확인

select count(*) from information_schema.processlist where command='Sleep';

대화형 컨넥션 확인(sql툴 등으로 접속해서 실행하는 컨넥션)

show variables like 'interactive%';

컨넥션 확인

show variables like 'wait_timeout';

터미널에서 직접 조정하거나 볼때

# set global interactive_timeout=30;
# set global wait_timeout=60;

show processlist;


> 글로벌 확인
show global variables like '%wait_timeout%';