Dear colleagues,
I've created an application that uses multi-threading for parallel processing
of data located in an InnoDB table. Each thread makes SELECT FOR UPDATE, UPDATE and DELETE queries. Sometimes I get deadlocks, but more often I receive errors about exceeding lock wait timeout.
For example, 150 threads may run without any issues, but may get blocked because of waiting too much in query queue, or exceeding the lock wait timeout
(50 seconds by default for InnoDB).
I need to understand what exactly causes these issues.
First idea was parallel INSERT queries, that are performed as well on the table.
But after enabling global query log and analyzing it I came to conclusion that inserts are not guilty. In fact during these locks no heavy queries are running on the table, so, what else can it be?
I've created an application that uses multi-threading for parallel processing
of data located in an InnoDB table. Each thread makes SELECT FOR UPDATE, UPDATE and DELETE queries. Sometimes I get deadlocks, but more often I receive errors about exceeding lock wait timeout.
For example, 150 threads may run without any issues, but may get blocked because of waiting too much in query queue, or exceeding the lock wait timeout
(50 seconds by default for InnoDB).
I need to understand what exactly causes these issues.
First idea was parallel INSERT queries, that are performed as well on the table.
But after enabling global query log and analyzing it I came to conclusion that inserts are not guilty. In fact during these locks no heavy queries are running on the table, so, what else can it be?
. So I put it to 128M and will compare performance to previous one. In fact the main InnoDB table (other tables are not under high-load) has ~500 MB. May be I should use this value?
) .

Comment