Hi,
In our application clojure is used as front end with MySQL 5.0 (Innodb) as backend.
After calling various interfaces the result would be stored in the database. It is straight forward insert query and no select queries are executed. For primary key auto increment is used.
During performance testing 200 messages triggered per second means 200 insert queries per second but it throws deadlock exception.
Table details : 55 columns 11 indexes
Innodb status output is as follows:
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 113804, signal count 108110
Mutex spin waits 0, rounds 1314850, OS waits 22809
RW-shared spins 185982, OS waits 88228; RW-excl spins 810, OS waits 513
------------------------
LATEST DETECTED DEADLOCK
------------------------
140314 8:40:24
*** (1) TRANSACTION:
TRANSACTION 0 62602063, ACTIVE 3 sec, process no 13763, OS thread id 47208791374144 setting auto-inc lock
mysql tables in use 1, locked 1
LOCK WAIT 1 lock struct(s), heap size 368
MySQL thread id 462339, query id 4596200
Insert query
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
TABLE LOCK table `pre_prod/test` trx id 0 62602063 lock mode AUTO-INC waiting
*** (2) TRANSACTION:
TRANSACTION 0 62602062, ACTIVE 3 sec, process no 13763, OS thread id 47208873892160 inserting, thread declared inside InnoDB 500
mysql tables in use 1, locked 1
2 lock struct(s), heap size 368, undo log entries 1
MySQL thread id 462338, query id 4596195 preprod update
insert query
*** (2) HOLDS THE LOCK(S):
TABLE LOCK table `pre_prod/test` trx id 0 62602062 lock mode AUTO-INC
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
TABLE LOCK table `pre_prod/test` trx id 0 62602295 lock mode AUTO-INC waiting
TOO DEEP OR LONG SEARCH IN THE LOCK TABLE WAITS-FOR GRAPH
*** WE ROLL BACK TRANSACTION (2)
------------
TRANSACTIONS
------------
Trx id counter 0 62661565
Purge done for trx's n:o < 0 62658716 undo n:o < 0 0
History list length 3
Total number of lock structs in row lock hash table 0
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0 0, not started, process no 13763, OS thread id 47209179601216
MySQL thread id 549618, query id 5379724 localhost ico
show engine innodb status
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (write thread)
Pending normal aio reads: 0, aio writes: 0,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
84450 OS file reads, 636660 OS file writes, 462733 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 1.25 writes/s, 0.33 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 18644, seg size 18646,
18176 inserts, 18176 merged recs, 2033 merges
Hash table size 4425293, used cells 2049, node heap has 4 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 62 1944510893
Log flushed up to 62 1944510893
Last checkpoint at 62 1944510893
0 pending log writes, 0 pending chkp writes
432607 log i/o's done, 0.08 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 2419478656; in additional pool allocated 945664
Buffer pool size 131072
Free buffers 0
Database pages 131068
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages read 4489965, created 25147, written 440930
0.00 reads/s, 0.00 creates/s, 1.08 writes/s
Buffer pool hit rate 1000 / 1000
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread process no. 13763, id 47208754145600, state: waiting for server activity
Number of rows inserted 496827, updated 0, deleted 236, read 114201906
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
Could you please help me on this.
Thanks & Regards,
P.Prasanna
In our application clojure is used as front end with MySQL 5.0 (Innodb) as backend.
After calling various interfaces the result would be stored in the database. It is straight forward insert query and no select queries are executed. For primary key auto increment is used.
During performance testing 200 messages triggered per second means 200 insert queries per second but it throws deadlock exception.
Table details : 55 columns 11 indexes
Innodb status output is as follows:
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 113804, signal count 108110
Mutex spin waits 0, rounds 1314850, OS waits 22809
RW-shared spins 185982, OS waits 88228; RW-excl spins 810, OS waits 513
------------------------
LATEST DETECTED DEADLOCK
------------------------
140314 8:40:24
*** (1) TRANSACTION:
TRANSACTION 0 62602063, ACTIVE 3 sec, process no 13763, OS thread id 47208791374144 setting auto-inc lock
mysql tables in use 1, locked 1
LOCK WAIT 1 lock struct(s), heap size 368
MySQL thread id 462339, query id 4596200
Insert query
*** (1) WAITING FOR THIS LOCK TO BE GRANTED:
TABLE LOCK table `pre_prod/test` trx id 0 62602063 lock mode AUTO-INC waiting
*** (2) TRANSACTION:
TRANSACTION 0 62602062, ACTIVE 3 sec, process no 13763, OS thread id 47208873892160 inserting, thread declared inside InnoDB 500
mysql tables in use 1, locked 1
2 lock struct(s), heap size 368, undo log entries 1
MySQL thread id 462338, query id 4596195 preprod update
insert query
*** (2) HOLDS THE LOCK(S):
TABLE LOCK table `pre_prod/test` trx id 0 62602062 lock mode AUTO-INC
*** (2) WAITING FOR THIS LOCK TO BE GRANTED:
TABLE LOCK table `pre_prod/test` trx id 0 62602295 lock mode AUTO-INC waiting
TOO DEEP OR LONG SEARCH IN THE LOCK TABLE WAITS-FOR GRAPH
*** WE ROLL BACK TRANSACTION (2)
------------
TRANSACTIONS
------------
Trx id counter 0 62661565
Purge done for trx's n:o < 0 62658716 undo n:o < 0 0
History list length 3
Total number of lock structs in row lock hash table 0
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0 0, not started, process no 13763, OS thread id 47209179601216
MySQL thread id 549618, query id 5379724 localhost ico
show engine innodb status
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (write thread)
Pending normal aio reads: 0, aio writes: 0,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
84450 OS file reads, 636660 OS file writes, 462733 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 1.25 writes/s, 0.33 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 18644, seg size 18646,
18176 inserts, 18176 merged recs, 2033 merges
Hash table size 4425293, used cells 2049, node heap has 4 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 62 1944510893
Log flushed up to 62 1944510893
Last checkpoint at 62 1944510893
0 pending log writes, 0 pending chkp writes
432607 log i/o's done, 0.08 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 2419478656; in additional pool allocated 945664
Buffer pool size 131072
Free buffers 0
Database pages 131068
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages read 4489965, created 25147, written 440930
0.00 reads/s, 0.00 creates/s, 1.08 writes/s
Buffer pool hit rate 1000 / 1000
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
1 read views open inside InnoDB
Main thread process no. 13763, id 47208754145600, state: waiting for server activity
Number of rows inserted 496827, updated 0, deleted 236, read 114201906
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================
Could you please help me on this.
Thanks & Regards,
P.Prasanna