有时mysql断开连接,由于访问量增加了

问题描述 投票:0回答:1

它只断开一秒钟,如果我重新加载其连接的页面。

这是我从mysql的默认配置代码

我应该为mysql增加哪个数字,

哪个可以加载很多

/etc/MySQL/没有.采暖费

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

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

[mysqld]
#bind-address = 123.123.123.8
user=mysql
pid-file=/var/run/mysqld/mysqld.pid
socket=/var/run/mysqld/mysqld.sock
port=3306
basedir=/usr
datadir=/var/lib/mysql
tmpdir=/tmp
lc-messages-dir=/usr/share/mysql
log_error=/var/log/mysql/error.log

symbolic-links=0

skip-external-locking
key_buffer_size = 256M
max_allowed_packet = 64M
table_open_cache = 256
sort_buffer_size = 1M
read_buffer_size = 1M
read_rnd_buffer_size = 4M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size= 16M
thread_concurrency = 8

#innodb_use_native_aio = 0
innodb_file_per_table

max_connections=800
max_user_connections=50
wait_timeout=2000
interactive_timeout=2000
long_query_time=5

!includedir /etc/mysql/conf.d/

/var/log/MySQL/error.log

171217 19:58:58 [Warning] IP address '58.218.200.24' could not be resolved: Name or service not known
171217 21:04:27 [Note] /usr/sbin/mysqld: Normal shutdown

171217 21:04:27 [Note] Event Scheduler: Purging the queue. 0 events
171217 21:04:29 [Warning] /usr/sbin/mysqld: Forcing close of thread 139280  user: 'admin_x'

171217 21:04:29 [Warning] /usr/sbin/mysqld: Forcing close of thread 139279  user: 'admin_x'

操作系统(OS / VERSION):Debian 8.9(x86_64)

控制面板:Vestacp

谢谢大家

mysql performance remote-access
1个回答
0
投票

/etc/mysql/conf.d/目录中创建一个文件, 把它命名为mirta.cnf。 有两行:

[mysqld]
host-cache-size = 600

Reference

© www.soinside.com 2019 - 2024. All rights reserved.