我们正在运行多个计算数据的脚本。该脚本是用PHP(Laravel)编写的,由cron(每分钟)触发。我注意到的是,当cron触发了300多个这些进程时,mysql崩溃“ Connection Refused”。少于300个进程时不会发生此问题。我已经在my.cnf中将max_connections增加到1000,将back_log t0增加到500,但是问题仍然存在(当然,MySQL服务已重新启动)。我见过有人说back_log也在操作系统级别,但是我找不到任何有关如何调整它的文章。有什么想法吗?
以下是一些配置值:
max_connections = 1000
back_log = 500
connect_timeout = 5
wait_timeout = 600
max_allowed_packet = 64M
thread_cache_size = 256
sort_buffer_size = 128M
bulk_insert_buffer_size = 128M
tmp_table_size = 128M
max_heap_table_size = 1G
myisam_recover_options = BACKUP
key_buffer_size = 128M
#open-files-limit = 2000
table_open_cache = 400
myisam_sort_buffer_size = 512M
concurrent_insert = 2
read_buffer_size = 8M
read_rnd_buffer_size = 4M
innodb_buffer_pool_size = 80G
innodb_log_buffer_size = 256M
innodb_file_per_table = 1
innodb_open_files = 400
innodb_io_capacity = 400
innodb_flush_method = O_DIRECT
答案 0 :(得分:0)
我认为这可能是性能问题,您是否监视mysql服务器cpu使用情况?