gpt4 book ai didi

MySQL my.cnf for linux 4核/8线程 64GB内存

转载 作者:行者123 更新时间:2023-11-29 08:00:43 27 4
gpt4 key购买 nike

我刚刚移动了服务器,正在处理 my.cnf 以针对我的电脑进行优化,如果有人可以对其进行评论,因为该网站在初始连接时加载速度非常慢。在 Pingdom 中,它显示为“WAIT”,大约 8 秒后开始加载网站。这是我的 My.cnf

[mysqld]
datadir="/var/lib/mysql"
socket="/var/lib/mysql/mysql.sock"
user=mysql

open_files_limit=26672
innodb_file_per_table=1
symbolic-links=0
default-storage-engine=MyISAM
tmp_table_size = 1G
key_buffer_size = 2G
max_heap_table_size = 2G
query_cache_size = 2G
max_connections = 500
thread_cache_size = 5G
table_definition_cache = 2G
max_allowed_packet=64M
table_cache=2G
max_connect_errors = 10
binlog_cache_size = 2G
read_buffer_size = 2G
read_rnd_buffer_size = 5G
sort_buffer_size = 2G
bulk_insert_buffer_size = 3G
join_buffer_size = 3G
myisam_sort_buffer_size = 4G
thread_cache_size = 2G
myisam_max_sort_file_size = 4G
thread_concurrency = 8

query_cache_size = 1G
query_cache_limit = 10G

innodb_additional_mem_pool_size = 1G
innodb_buffer_pool_size = 2G
innodb_data_file_path = ibdata1:10M:autoextend
innodb_file_io_threads = 4
innodb_thread_concurrency = 16
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 8M
innodb_log_file_size = 1G
innodb_log_files_in_group = 3
innodb_max_dirty_pages_pct = 90
innodb_lock_wait_timeout = 120


myisam_sort_buffer_size=2G

[mysqld_safe]
log="/var/log/mysqld.log"
log-error="/var/log/mysqld.error.log"

[myisamchk]


sort_buffer_size = 5M

read_buffer = 50M

write_buffer = 50M

欢迎所有建议/批评,我是这方面的业余爱好者,并且是通过阅读博客和其他资源来做到这一点的。

最佳答案

我建议您使用 Percona 的 MySQL 配置向导: https://tools.percona.com/wizard

并检查您是否确实需要:

1) MyISAM引擎;2)查询缓存;

关于MySQL my.cnf for linux 4核/8线程 64GB内存,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23897287/

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