English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

MySQL에서 락 대기 시간 초과를 넘는 시간을 어떻게 디버깅할 수 있습니까?

어떤 스레드가 있기 때문에, 디버깅 락 대기 시간 초과가 발생했습니다. 어떤 스레드가 오랫동안 특정 레코드를 유지하는 경우, 그 스레드는 시간을 초과한 것입니다.

모든 자세한 정보를 확인하려면 다음 쿼리를 실행하세요-

mysql> SHOW ENGINE INNODB STATUS;

아래는 출력입니다.

+--------+------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Type   | Name | Status                                                 |
+--------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| InnoDB |      |
=====================================
2018-10-23 09:55:05 0x19e8 INNODB 모니터 아웃풋
=====================================
Per second averages calculated from the last 7 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 2 srv_active, 0 srv_shutdown, 17805 srv_idle
srv_master_thread log flush and writes: 0
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 3
OS WAIT ARRAY INFO: signal count 3
RW-shared spins 0, rounds 0, OS waits 0
RW-excl spins 0, rounds 0, OS waits 0
RW-sx spins 0, rounds 0, OS waits 0
Spin rounds per wait: 0.00 RW-shared, 0.00 RW-excl, 0.00 RW-sx
------------
TRANSACTIONS
------------
Trx id counter 21000
Purge done for trx's n:o < 20998 undo n:o < 0 state: running but idle
History list length 3
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 283438498772800, not started
0 lock struct(s), heap size 1136, 0 row lock(s)
--------
FILE I/O
--------
I/O thread 0 state: wait Windows aio (insert buffer thread)
I/O thread 1 state: wait Windows aio (log thread)
I/O thread 2 state: wait Windows aio (read thread)
I/O thread 3 state: wait Windows aio (read thread)
I/O thread 4 state: wait Windows aio (read thread)
I/O thread 5 state: wait Windows aio (read thread)
I/O thread 6 state: wait Windows aio (write thread)
I/O thread 7 state: wait Windows aio (write thread)
I/O thread 8 state: wait Windows aio (write thread)
I/O thread 9 state: wait Windows aio (write thread)
Pending normal aio reads: [0, 0, 0, 0], aio writes: [0, 0, 0, 0],
 ibuf aio 읽기:, 로그 i/o's:, sync i/o's:
대기 중 flush(fsync) 로그: 0; 버퍼 풀: 0
1025 OS 파일 읽기, 545 OS 파일 쓰기, 11 OS fsyncs
0.00 reads/s, 0 평균 바이트/읽기, 0.00 쓰기/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: 크기 1, 자유 목록 길이 0, seg 크기 2, 0 결합
결합 작업:
 insert 0, delete 마크 0, delete 0
버려진 작업:
 insert 0, delete 마크 0, delete 0
해시 테이블 크기 2267, 노드 힙에 0 버퍼
해시 테이블 크기 2267, 노드 힙에 1 버퍼(s)
해시 테이블 크기 2267, 노드 힙에 3 버퍼(s)
해시 테이블 크기 2267, 노드 힙에 1 버퍼(s)
해시 테이블 크기 2267, 노드 힙에 0 버퍼
해시 테이블 크기 2267, 노드 힙에 0 버퍼
해시 테이블 크기 2267, 노드 힙에 0 버퍼
해시 테이블 크기 2267, 노드 힙에 0 버퍼
0.00 hash 검색/s, 0.29 non-hash 검색/s
---
LOG
---
로그 시퀀스 번호          24309079
로그 버퍼 할당까지    24309079
로그 버퍼 완료까지   24309079
쓰인 로그까지            24309079
flush된 로그까지            24309079
DIRTY 페이지 추가까지      24309079
flush된 페이지까지          24309079
마지막 체크포인트 at           24309079
388 log i/o's 완료, 0.00 로그 i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
총 대용량 메모리 할당 8585216
딕셔너리 메모리 할당 361173
버퍼 풀 크기   512
자유 버퍼       251
데이터베이스 페이지     256
오래된 데이터베이스 페이지 0
수정된 데이터베이스 페이지 0
대기 중 읽기 0
대기 중 작성: LRU 0, 쓰기 목록 0, 단일 페이지 0
Pages made young 0, not young 0
0.00 youngs/s, 0.00 non-youngs/s
Pages read 1002, created 132, written 144
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 0 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 256, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
0 read views open inside InnoDB
Process ID = 3260, Main thread ID = 000000000000106C, state = sleeping
Number of rows inserted 0, updated 313, deleted 0, read 4534
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.14 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
                                                                                      |
+--------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
mysql>

위에 스레드와 I / O에 관련된 모든 상세 정보.

추천해드립니다