gpt4 book ai didi

mysql - 即使增加缓冲池大小后,锁总数仍超过锁表大小

转载 作者:行者123 更新时间:2023-11-30 00:46:18 25 4
gpt4 key购买 nike

我正在尝试对一个包含 2 亿条记录的表进行分区。当锁总数超过锁表大小时,它会抛出异常。我在网上阅读了一些建议并更改了 my.cnf 文件。以下是配置:

# PER CLIENT SETTINGS #
# bit high but I got tons of ram here #
sort_buffer_size = 2M
read_buffer_size = 2M
binlog_cache_size = 1M
wait_timeout = 31536000
interactive_timeout = 300
max_allowed_packet = 12M
thread_stack = 128K
table_cache = 1024
myisam_sort_buffer_size = 1M
tmp_table_size = 12M
max_heap_table_size = 12M


# LOGGING #
log_queries_not_using_indexes = 1
slow_query_log = 1
slow_query_log_file = /var/lib/mysql/slowquery.log

# MyISAM #
key_buffer_size = 32M
myisam_recover = FORCE,BACKUP

# SAFETY #
max_allowed_packet = 16M
max_connect_errors = 1000000


# BINARY LOGGING #
log_bin = /var/lib/mysql/mysql-bin
expire_logs_days = 14
sync_binlog = 1

# CACHES AND LIMITS #
tmp-table-size = 32M
max-heap-table-size = 32M
query-cache-type = 0
query-cache-size = 0
max-connections = 500
thread-cache-size = 50
open-files-limit = 65535
table-definition-cache = 1024
table-open-cache = 2048

# INNODB #
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 512M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 40G

进行这些更改后,我重新启动了 mysql。它仍然抛出异常。我的服务器有 12 个核心和 48GB RAM,我可以暂时将这台服务器专门用于此分区过程。有什么建议可以绕过此异常(超出锁定总数)吗?

最佳答案

如果您可以将此服务器专用于分区,则在分区之前使用LOCK TABLES锁定整个表。另请参阅https://stackoverflow.com/a/7066272/3182500

关于mysql - 即使增加缓冲池大小后,锁总数仍超过锁表大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21337566/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com