MySQL配置。需要很多连接

时间:2016-01-07 22:56:55

标签: mysql crash server config ram

对于我的网络,我需要最多2000个连接到我的MySQL服务器。 第一个问题:这可能吗?

接下来的事情:

我的“my.cnf”:

[client]
port        = 3307
socket      = /var/run/mysqld/mysqld.sock

[mysqld_safe]
socket      = /var/run/mysqld/mysqld.sock
nice        = 0

[mysqld]
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /home/MySQL-Server/mysqld/mysqld.sock
port        = 3307
basedir     = /opt/mysql/server-5.6
datadir     = /home/MySQL-Server/mysql
tmpdir      = /tmp
lc-messages-dir = /opt/mysql/server-5.6/share
skip-external-locking

key_buffer      = 26M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 2000
innodb_buffer_pool_size = 10000M
join_buffer_size = 512M

max_heap_table_size= 32M

myisam-recover         = BACKUP
max_connections        = 2000

query_cache_limit   = 50M
query_cache_size        = 70M

log_error = /var/log/mysql/error.log

slow_query_log_file = /var/log/mysql/mysql-slow.log
slow_query_log      = 1
long_query_time = 2

expire_logs_days    = 10
max_binlog_size         = 100M

[mysqldump]
quick
quote-names
max_allowed_packet  = 16M

[isamchk]
key_buffer      = 16M
tmp_table_size= 40M
max_heap_table_size = 40M

“mysqltuner”唯一表示不好的是:

[!!] Maximum possible memory usage: 1011.5G (3215% of installed RAM)

所以,我现在不知道如何获取此警报,因为有时MySQL服务器不会快速响应或崩溃。

1 个答案:

答案 0 :(得分:0)

我建议使用Percona MySQL配置向导。他们会给你理智的选择。

Percona MySQL Configuration Wizard

它将基于您的应用程序的使用情况。如果您的空间不足,请查看每个连接的RAM分配情况。

How MySQL uses ram