我们正在运行多个计算数据的脚本。脚本是用PHP(Laravel)编写的,它们是由cron(每分钟)触发的。我注意到的是,当cron触发超过300个这样的进程时,mysql崩溃为“连接被拒绝”。当进程数少于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发布于 2019-02-15 13:50:22
我认为这可能是一个性能问题,您是否监控了mysql服务器的cpu使用情况?
https://stackoverflow.com/questions/54702825
复制相似问题