gpt4 book ai didi

MySQL 配置。需要很多连接

转载 作者:行者123 更新时间:2023-11-29 21:39:16 24 4
gpt4 key购买 nike

对于我的网络,我需要最多 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 服务器响应不快或者崩溃。

最佳答案

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

Percona MySQL Configuration Wizard

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

How MySQL uses ram

关于MySQL 配置。需要很多连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34666730/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com