1

迁移到新服务器后,Mysql 存储过程花费了太多时间。存储过程花费太多时间来返回结果。我的cnf文件如下

[mysqld_safe]
socket      = /var/run/mysqld/mysqld.sock
nice        = 0
[mysqld]
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
bind-address        = 0.0.0.0
key_buffer_size     = 384M
max_allowed_packet  = 16M
table_open_cache    = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_stack        = 192K
thread_cache_size       = 38
myisam-recover-options  = BACKUP
query_cache_limit   = 1M
query_cache_size        = 185M
max_binlog_size   = 100M
query_cache_size = 185M 
tmp_table_size = 66M
thread_cache_size = 38
innodb_log_buffer_size=6M
innodb_buffer_pool_size=557M
innodb_log_file_size=256M
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M    

有什么办法可以优化更多。

4

1 回答 1

0

对您的 my.cnf [mysqld] 部分的建议

删除以下内容以允许 MySQL DEFAULTS 为您工作并避免 OVERPROVISIONING RAM 要求。

有多个

sort_buffer_size
read_buffer_size
read_rnd_buffer_size

删除一个

thread_cache_size
query_cache_size

添加

max_heap_table_size=66M  

因为它应该始终与 tmp_table_size 相同

请查看我的个人资料,网络个人资料以获取包括我的 Skype ID 在内的联系信息,并与我联系。

于 2018-10-06T17:56:47.127 回答