Mariadb 解决 The total number of locks exceeds the lock table size

进行一个很大数据量的insert 语句,执行了大概10分钟左右报错 The total number of locks exceeds the lock table size ;删除的话也会报错。

InnoDB Buffer Pool

The XtraDB/InnoDB buffer pool is a key component for optimizing MariaDB. It stores data and indexes, and you usually want it as large as possible so as to keep as much of the data and indexes in memory, reducing disk IO, as main bottleneck.
https://mariadb.com/kb/en/innodb-buffer-pool/

innodb_buffer_pool_size

The most important server system variable is innodb_buffer_pool_size, which you can set from 70-80% of the total available memory on a dedicated database server with only or primarily XtraDB/InnoDB tables.
Be aware that the total memory allocated is about 10% more than the specified size as extra space is also reserved for control structures and buffers. The space must also be contiguous. If you're running a Windows system that loads DLL's at specific addresses, this may cause difficulties.
The larger the size, the longer it will take to initialize. On a modern 64-bit server with a 10GB memory pool, this can take five seconds or more.
Make sure that the size is not too large, causing swapping. The benefit of a larger buffer pool size is more than undone if your operating system is regularly swapping.
Since MariaDB 10.2.2, the buffer pool can be set dynamically, and new variables are introduced that may affect the size and performance. See Setting Innodb Buffer Pool Size Dynamically.

由于我得mariadb 版本是10.0 的,所以只能重启修改参数。

[Mariadb]
innodb_buffer_pool_size=8G

posted @ 2020-09-25 11:26  Lannister-leo  阅读(268)  评论(0编辑  收藏  举报