迁移到新服务器后,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
有什么方法可以优化更多。
答案 0 :(得分:0)
您的my.cnf [mysqld]部分的建议
删除以下内容以使MySQL DEFAULTS可以为您工作,并避免过度提供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,并与我联系。