gpt4 book ai didi

mysql - 如何优化 InnoDB 内存参数以提高性能?

转载 作者:行者123 更新时间:2023-11-28 23:26:31 25 4
gpt4 key购买 nike

我正在使用 Mysql 服务器 5.6。 MySql 文件夹下的 my.ini 文件里设置不太清楚。

在我的 my.ini 文件中,内存池大小设置为 679M。我们正在为 mysql 使用 InnoDB 引擎。我可以更改内存池大小吗?如果是,我必须提供多少内存才能获得更好的性能?在下面我指定了我的 my.ini 文件设置。

Innodb 引擎需要哪些设置?

如果mysql使用的引擎是innodb,请在my.ini文件中注明不需要的设置。

我的 my.ini 文件:

default-storage-engine=INNODB
sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

log-output=FILE
general_log_file="INDIAN-SERVER.log"

slow-query-log=1
slow_query_log_file="INDIAN-SERVER-slow.log"

long_query_time=10
log-error="INDIAN-SERVER.err"
server-id=1

max_connections=151
query_cache_size=0

table_open_cache=2000
tmp_table_size=107M

thread_cache_size=10
myisam_max_sort_file_size=100G
myisam_sort_buffer_size=204M

key_buffer_size=8M
read_buffer_size=64K
read_rnd_buffer_size=256K

sort_buffer_size=256K
innodb_additional_mem_pool_size=15M
innodb_flush_log_at_trx_commit=1

innodb_log_buffer_size=8M
innodb_buffer_pool_size=679M
innodb_log_file_size=48M

innodb_thread_concurrency=9
innodb_autoextend_increment=64
innodb_buffer_pool_instances=8

innodb_concurrency_tickets=5000
innodb_old_blocks_time=1000
innodb_open_files=300

innodb_stats_on_metadata=0
innodb_file_per_table=1
innodb_checksum_algorithm=0

back_log=80
flush_time=0

join_buffer_size=256K
max_allowed_packet=4M
max_connect_errors=100

open_files_limit=4161
query_cache_type=0
sort_buffer_size=256K

table_definition_cache=1400
binlog_row_event_max_size=8K
sync_master_info=10000

sync_relay_log=10000
sync_relay_log_info=10000

最佳答案

参见 memory讨论将其设置为什么。 (这取决于您有多少可用 RAM。)

这些设置需要在配置文件的 [mysqld] 部分。该值看起来是由某些安装脚本生成的;他们可能是合理的。大多数人不需要接触配置,尤其是当安装脚本执行诸如调整 RAM 大小之类的操作时。

要使 my.ini(或 my.cnf)值生效,请停止并重新启动服务器。其详细信息取决于操作系统。

关于mysql - 如何优化 InnoDB 内存参数以提高性能?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39138739/

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