gpt4 book ai didi

使用 mysqltuner.pl 的结果调整 mysql 性能

转载 作者:行者123 更新时间:2023-11-30 22:58:14 25 4
gpt4 key购买 nike

我正在使用具有 1.5GB RAM 和 3GB 突发 RAM 的 VPS。 VPS 托管多个 Joomla 网站。我想对 mysql 进行性能调整。为此,我在我的服务器上运行 mysqltuner,结果如下。请指导为我的 VPS 创建一个最好的 my.cnf 文件。

    >>  MySQLTuner 1.3.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
[OK] Currently running supported MySQL version 5.6.17
[!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in MyISAM tables: 661M (Tables: 6305)
[--] Data in InnoDB tables: 53M (Tables: 964)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 52)
[--] Data in MEMORY tables: 0B (Tables: 104)
[!!] Total fragmented tables: 524

-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 4d 14h 30m 25s (10M q [25.447 qps], 280K conn, TX: 46B, RX: 1B)
[--] Reads / Writes: 92% / 8%
[--] Total buffers: 169.0M global + 1.1M per thread (151 max threads)
[OK] Maximum possible memory usage: 329.4M (10% of installed RAM)
[OK] Slow queries: 0% (137/10M)
[OK] Highest usage of available connections: 40% (61/151)
[OK] Key buffer size / total MyISAM indexes: 8.0M/167.7M
[OK] Key buffer hit rate: 100.0% (843M cached / 275K reads)
[!!] Query cache is disabled
[OK] Sorts requiring temporary tables: 4% (86K temp sorts / 1M sorts)
[!!] Joins performed without indexes: 275614
[OK] Temporary tables created on disk: 21% (430K on disk / 2M total)
[OK] Thread cache hit rate: 99% (1K created / 280K connections)
[!!] Table cache hit rate: 0% (2K open / 244K opened)
[OK] Open file limit used: 68% (3K/5K)
[OK] Table locks acquired immediately: 99% (11M immediate / 11M locks)
[OK] InnoDB buffer pool / data size: 128.0M/53.1M
[OK] InnoDB log waits: 0
-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Adjust your join queries to always utilize indexes
Increase table_open_cache gradually to avoid file descriptor limits
Read this before increasing table_open_cache over 64: http://bit.ly/1mi7c4C
Variables to adjust:
query_cache_type (=1)
join_buffer_size (> 256.0K, or always use indexes with joins)
table_open_cache (> 2000)

最佳答案

你应该使用github上的最新版本。

您的 mysql 似乎已正确配置。

64 位操作系统更好:)

在 2G 限制中增加数据缓存。

关于使用 mysqltuner.pl 的结果调整 mysql 性能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25286471/

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