繁体   English   中英

高峰时段时MySQL开始断开连接

[英]Mysql start dropping connection when peak hours

我们的数据库在高峰时段开始断开连接。 大约有3%的连接断开,mysql返回消息“ mysqli :: mysqli():(HY000 / 2003):无法连接到'10 .88。***'(99)上的MySQL服务器”。 我已经调整了几个mysql和内核参数,但没有帮助:-/ etc / sysctl.conf:

net.ipv4.tcp_max_tw_buckets = 524288 net.core.somaxconn = 2048 net.ipv4.ip_local_port_range = 1024 65000 net.ipv4.tcp_max_syn_backlog = 30000 net.ipv4.tcp_syncookies = 1 net.ipv4.tcp_synack_retries =

-/ etc / my.cnf:

open_files_limit = 65536 max_connections = 3600
connect_timeout = 60
wait_timeout = 2400
back_log = 4096

-/ etc / security / limits.conf

mysql软nofile 65536 mysql硬nofile 65536 mysql软nproc 65536 mysql硬nproc 65536

我们的数据库通过一台数据库机处理> 40000个查询和每秒> 8000个连接,没有分片和连接池。 我想念什么? 有谁知道导致瓶颈的原因吗? 谢谢。

这是my.cnf中的内容:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock

skip_name_resolve = off
open_files_limit = 65536

max_allowed_packet = 1073741824
expire_logs_days = 2

binlog_format = row
innodb_file_per_table = 1
innodb_flush_method=O_DIRECT

innodb_buffer_pool_instances = 16
innodb_buffer_pool_size = 43G
innodb_thread_concurrency = 0

log-bin=mysql-bin
server-id=1
innodb_flush_log_at_trx_commit=1
slave-skip-errors = 1062,1032

max_connections=3600
connect_timeout=60
wait_timeout=2400

back_log=4096

thread_cache_size=48

symbolic-links=0

user=mysql

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
!includedir /etc/my.cnf.d

所以..尝试将您的max_connections增加到> 8000吗?

在my.cnf中

max_connections = 9000

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM