微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐