새소식

Database

MySQL 데이터베이스 상태 모니터링 쿼리

  • -


1) 현재 process의 snapshot이며, 현재 걸려 있는 쿼리 확인 가능.

 

2). slow query가 있는 경우 processlist (information_schema DB) 로 확인 가능.

명령어 예제).

mysql> show processlist;


3). 현재 process의 snapshot 을 접속된 세션 확인 가능.

 

명령어 예제).

mysql> select user,LEFT(host, instr(host,':')-1) IP , count(*) from PROCESSLIST where user not in ('admin','repl','agent','system user') group by LEFT(host, instr(host,':')-1);


4). show global status로 com_select, com_update, com_delete ... 이 값을 1분 단위로 추출해서... "증가값 / 60" -> 초당 처리량(qps) 확인 가능.


5). slow_query 상태 모니터링 확인 가능

 

명령어 예제).

mysql> show global status;






Contents

포스팅 주소를 복사했습니다

이 글이 도움이 되었다면 공감 부탁드립니다.