【发布时间】:2018-06-12 06:47:49
【问题描述】:
我们使用安装了 Magento 的 MariaDB 10.2.14 运行 CentOS DirectAdmin 安装。
目前,当一个进程运行时,我们的数据库经常锁定,所以所有其他进程都在等待,直到当前进程完成。这是一个很大的问题,因为例如,在这种情况下,添加到购物车的过程也在等待,人们无法订购。
我们如何防止数据库被锁定这么长时间并解决这个问题?
服务器:
6x Intel Xeon
32GB RAM
500GB SSD
我的.cnf:
[mysqld]
bind-address = 127.0.0.1
local-infile=0
innodb_file_per_table=1
innodb_file_format=barracuda
slow_query_log = 1
slow_query_log_file=/var/log/mysql-log-slow-queries.log
key_buffer = 250M
key_buffer_size = 250M
max_allowed_packet = 128M
table_cache = 512
sort_buffer_size = 7M
read_buffer_size = 7M
read_rnd_buffer_size = 7M
myisam_sort_buffer_size = 64M
tmp_table_size = 190M
query_cache_type = 1
query_cache_size = 220M
query_cache_limit = 512M
thread_cache_size = 150
max_connections = 225
wait_timeout = 300
innodb_buffer_pool_size = 7G
max_heap_table_size =180M
innodb_log_buffer_size = 36M
join_buffer_size = 32M
innodb_buffer_pool_instances = 7
long_query_time = 15
table_definition_cache = 4K
open_files_limit = 60K
table_open_cache = 50767
innodb_log_file_size= 128M
innodb_lock_wait_timeout = 700
【问题讨论】:
标签: mysql database locking mariadb