MySQL/Class

기초공부 - (15) 부하 모니터링

평생초보 2024. 5. 15. 20:02
반응형

- 개인적으로 부하테스트 또는 성능 모니터링을 할 경우 확인하는 부분들을 정리해보았습니다.

 

(1) sar

$ sar -p -d 1 | grep xvd # await, wkB/s, rkB/s, tps, idle 확인

 

(2) top

$ top | grep mysqld # %cpu, %mem

 

(3) qps확인

mysql> select now();
mysql> show global status where variable_name in ('questions','uptime','com_select','com_insert','com_delete','com_update');

 

(4) connect

# Aborted_connects, threads_connected, max_used_connections, connections
mysql> show global status where variable_name like '%connect%';

 

(5) innodb_buffer_pool

# pages_total, pages_data, bytes_data
mysql> show global status where variable_name like '%innodb_buffer_pool%';

 

(6) processlist

$ /mysql/bin/mysqladmin -u root -p1234 -S /tmp/mysql.sock processlist -i1 >> /home/mysql/processlist_1.txt &

 

 

이외 slow 쿼리 로그 및 자빅스를 통한 CPU 및 memory  사용량도 함께 확인합니다.

반응형