• MySQL매뉴얼
    • MySQL 5.6 매뉴얼
    • MySQL 5.1 매뉴얼
    • MySQL 5.0 매뉴얼
    • MySQL HA 매뉴얼
  • 기술문서
    • Xtrabackup 구성
    • 메모리 사용량 모니터링
  • 라이선스
  • 온라인문의
  • 회사소개
  • → 목 록 (MySQL5.6 한글메뉴얼) [close]
  • 1. MySQL 5.6 새로운 기능
  • 2. MySQL 설치 및 업그레이드
  • 3. MySQL Tutorial
  • 4. MySQL 프로그램
  • 5. MySQL 서버관리
  • 1. MySQL Server
    2. MySQL Server 로그
    3. 하나의 시스템에서 여러 MySQL 인스턴스 실행
    4. DTrace를 사용하여 mysqld 추적
    1. mysqld DTrace 프로브 설명
    1. 연결 프로브
    2. 명령 프로브
    3. 쿼리 프로브
    4. 쿼리 분석 프로브
    5. 쿼리 캐시 프로브
    6. 쿼리 실행 프로브
    7. 행 레벨 프로브
    8. 행 읽기 프로브
    9. 인덱스 프로브
    10. 잠금 프로브
    11. 파일 정렬 프로브
    12. 명령문 프로브
    13. 네트워크 프로브
    14. Keycache 프로브
  • 6. 보안
  • 7. 백업 및 복구
  • 8. 최적화
  • 9. Language Structure(언어구조)
  • 10. Character Sets(Globalization)
  • 11. 데이터형(Data Types)
  • 12. 함수와 연산자
  • 13. SQL 문법
  • 14. InnoDB 스토리지 엔진
  • 15. 기타 스토리지 엔진
  • 16. 고가용성 및 확장성
  • 17. 리플리케이션
  • 18. MySQL Cluster
  • 19. 파티셔닝
  • 20. Stored Programs and Views
  • 21. INFORMATION_SCHEMA
  • 22. PERFORMANCE SCHEMA
  • 23. 컨넥터 및 API
  • 24. MySQL 확장
  • 25. MySQL Enterprise Edition
  • 26. MySQL Workbench
  • 27. 제약 및 제한
  • 28. MySQL 5.7 새로운 기능

5.4.1.10 잠금 프로브

잠금 프로브 테이블의 엔진 유형에 의해 정의되는 테이블의 해당 잠금 메커니즘을 사용하는 테이블에 대한 외부 잠금이 MySQL에 의해 요청 될 때마다 호출됩니다. 잠금은 읽기 잠금, 쓰기 잠금 및 잠금 해제 기능 등 세 가지 유형이 있습니다. 프로브를 사용하여 외부 잠금 루틴 기간 (즉, 다른 잠금이 해제 될 때까지 대기하는 시간도 포함 스토리지 엔진이 잠금을 구현하는 데 걸리는 시간) 및 잠금 및 잠금 해제 프로세스의 총 기간을 조사 할 수 있습니다.

  handler-rdlock-start (database, table)
 handler-rdlock-done (status)

 handler-wrlock-start (database, table)
 handler-wrlock-done (status)

 handler-unlock-start (database, table)
 handler-unlock-done (status) 
  • handler-rdlock-start : 지정된 database 와 table 에 읽기 잠금이 요청 된 때 트리거됩니다.

  • handler-wrlock-start : 지정된 database 와 table 에 쓰기 잠금을 요청한 때 트리거됩니다.

  • handler-unlock-start : 지정된 database 와 table 에 잠금 해제 요청이 실행되었을 때 트리거됩니다.

  • handler-rdlock-done : 읽기 잠금 요청이 완료 될 때 트리거됩니다. status 는 잠금 작업이 정상적인 경우 0에서 실패한 경우 >0 입니다.

  • handler-wrlock-done : 쓰기 잠금 요청이 완료 될 때 트리거됩니다. status 는 잠금 작업이 정상적인 경우 0에서 실패한 경우 >0 입니다.

  • handler-unlock-done : 잠금 해제 요청이 완료 될 때 트리거됩니다. status 잠금 해제 조작에 성공한 경우 0에서 실패한 경우 >0 입니다.

다음 스크립트를 사용하여 개별 테이블의 잠금 및 잠금 해제를 모니터하기위한 배열을 사용하여 테이블 잠금 전체 기간을 계산할 수 있습니다.

  #! / usr / sbin / dtrace -s

 #pragma D option quiet

 mysql * ::: handler-rdlock-start
 {
    self-> rdlockstart = timestamp;
    this-> lockref = strjoin (copyinstr (arg0) strjoin ( "@", copyinstr (arg1)));
    self-> lockmap [this-> lockref] = self-> rdlockstart;
    printf ( "Start : Lock-> Read % s. % s \ n", copyinstr (arg0) copyinstr (arg1));
 }

 mysql * ::: handler-wrlock-start
 {
    self-> wrlockstart = timestamp;
    this-> lockref = strjoin (copyinstr (arg0) strjoin ( "@", copyinstr (arg1)));
    self-> lockmap [this-> lockref] = self-> rdlockstart;
    printf ( "Start : Lock-> Write % s. % s \ n", copyinstr (arg0) copyinstr (arg1));
 }

 mysql * ::: handler-unlock-start
 {
    self-> unlockstart = timestamp;
    this-> lockref = strjoin (copyinstr (arg0) strjoin ( "@", copyinstr (arg1)));
    printf ( "Start : Lock-> Unlock % s. % s (% d ms lock duration) \ n"
           copyinstr (arg0) copyinstr (arg1)
           (timestamp - self-> lockmap [this-> lockref) / 1000000);
 }

 mysql * ::: handler-rdlock-done
 {
    printf ( "End : Lock-> Read % d ms \ n"
           (timestamp - self-> rdlockstart) / 1000000);
 }

 mysql * ::: handler-wrlock-done
 {
    printf ( "End : Lock-> Write % d ms \ n"
           (timestamp - self-> wrlockstart) / 1000000);
 }

 mysql * ::: handler-unlock-done
 {
    printf ( "End : Lock-> Unlock % d ms \ n"
           (timestamp - self-> unlockstart) / 1000000);
 }

이렇게하면 잠금 처리 자체의 기간과 특정 테이블 잠금 기간 모두에 대한 정보를 얻을 수있을 것입니다.

  Start : Lock-> Read test.t2
 End : Lock-> Read 0 ms
 Start : Lock-> Unlock test.t2 (25743 ms lock duration)
 End : Lock-> Unlock 0 ms
 Start : Lock-> Read test.t2
 End : Lock-> Read 0 ms
 Start : Lock-> Unlock test.t2 (1 ms lock duration)
 End : Lock-> Unlock 0 ms
 Start : Lock-> Read test.t2
 End : Lock-> Read 0 ms
 Start : Lock-> Unlock test.t2 (1 ms lock duration)
 End : Lock-> Unlock 0 ms
 Start : Lock-> Read test.t2
 End : Lock-> Read 0 ms


서울시 강남구 영동대로 602 6층
TEL: 02-6061-0006  /  E: csr@mysqlkorea.com
주식회사 이노클러스터  등록번호 : 727-86-02261
Copyright © innocluster Co. ltd. all rights reserved