微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Mariadb MySQL Tuner报告令人困惑

我想请你澄清mysqltuner关于MariaDB数据库的报告.使用–nogood标志调用MysqLtuner!

 >>  MysqLTuner 1.7.1 - Major Hayden <major@mhtx.net>
 >>  Bug reports, feature requests, and downloads at http://MysqLtuner.com/
 >>  Run with '--help' for additional options and output filtering

[--] Skipped version check for MysqLTuner script
[!!] Currently running unsupported MysqL version 10.0.29-MariaDB-0ubuntu0.16.04.1

-------- Log file Recommendations ------------------------------------------------------------------
[--] Log file: (0B)
[!!] Log file  doesn't exist
[!!] Log file  isn't readable.

-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +ARCHIVE +Aria +BLACKHOLE +CSV +FEDERATED +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA 
[--] Data in InnoDB tables: 380M (Tables: 417)

-------- Security Recommendations ------------------------------------------------------------------
[--] There are 605 basic passwords in the list.

-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined

-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 15s (812 q [54.133 qps], 275 conn, TX: 258K, RX: 108K)
[--] Reads / Writes: 100% / 0%
[--] Binary logging is disabled
[--] Physical Memory     : 31.3G
[--] Max MysqL memory    : 10.0G
[--] Other process memory: 1.2G
[--] Total buffers: 8.4G global + 10.7M per thread (150 max threads)
[--] P_S Max memory usage: 34M
[--] galera GCache Max memory usage: 0B
[!!] Slow queries: 27% (221/812)
[!!] Query cache may be disabled by default due to mutex contention.
[!!] Query cache efficiency: 0.0% (0 cached / 521 selects)

-------- Performance schema ------------------------------------------------------------------------
[--] Memory used by P_S: 35.0M
[--] Sys schema isn't installed.

-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is enabled.
[--] Thread Pool Size: 8 thread(s).
[--] Using default value is good enough for your version (10.0.29-MariaDB-0ubuntu0.16.04.1)

-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.2% (24M used / 134M cache)
[!!] Read Key buffer hit rate: 80.0% (10 cached / 2 reads)

-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (12.5 %): 512.0M * 2/8.0G should be equal 25%
[--] InnoDB Buffer Pool Chunk Size not used or defined in your version
[!!] InnoDB Write Log efficiency: 0% (2 hits/ 0 total)

-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is enabled.

-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.

-------- XTradB Metrics ----------------------------------------------------------------------------
[--] XTradB is disabled.

-------- RocksDB Metrics ---------------------------------------------------------------------------
[--] RocksDB is disabled.

-------- Spider Metrics ----------------------------------------------------------------------------
[--] Spider is disabled.

-------- Connect Metrics ---------------------------------------------------------------------------
[--] Connect is disabled.

-------- galera Metrics ----------------------------------------------------------------------------
[--] galera is disabled.

-------- Replication Metrics -----------------------------------------------------------------------
[--] galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] This is a standalone server.

-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
    MysqL started within last 24 hours - recommendations may be inaccurate
    Consider installing Sys schema from https://github.com/MysqL/MysqL-sys
Variables to adjust:
    query_cache_type (=0)
    query_cache_limit (> 256K, or use smaller result sets)
    innodb_log_file_size * innodb_log_files_in_group should be equals to 1/4 of buffer pool size (=4G) if possible.

令我困惑的是“日志文件建议”部分.我真的不知道该怎么做.然后这行:

[!!] Query cache may be disabled by default due to mutex contention.

我也很好奇为什么它会建议我将query_cache_type更改为0并增加query_cache_limit?

我知道它至少24小时没有运行,因为我已经调整了配置并重新启动了我的数据库.我根据我对MariaDB的了解做了调整,但是对于这几件事我感到很困惑.

解决方法:

我可以解释这一行

[!!] Query cache may be disabled by default due to mutex contention.

InnoDB存储引擎和查询缓存处于持续的战争状态(请参阅我的1.5岁的Why query_cache_type is disabled by default start from MySQL 5.6?后)

MysqLtuner建议将query_cache_type设置为0,以便显式禁用查询缓存.请不要忘记将query_cache_size设置为0.否则,无论如何都会被动地发生静音行为.

正如我在my old post中所说,如果您合理地知道最常见结果集的大小,则不一定要禁用查询缓存.如果可以计算出该大小,则可以将query_cache_limitquery_cache_min_res_unit作为结果集大小的上限和下限.只有这样才能将query_cache_type设置为1.

至于您的日志文件建议

[--] Log file: (0B)
[!!] Log file  doesn't exist
[!!] Log file  isn't readable.

也许这可以解释它

[!!] Currently running unsupported MysqL version 10.0.29-MariaDB-0ubuntu0.16.04.1

有可能MysqLtuner无法与此版本的MariaDB中的日志文件相关联,就像支持的版本一样.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐