mariabd 和 zabbix 性能低下

mariabd 和 zabbix 性能低下

我遇到了性能问题,我为 Zabbix 服务器使用的 mariadb 数据库,MySQLTuner 2.5.3 错误分析器发现以下问题:您能否建议我设置哪些值以及在哪个文件中设置?我非常感谢您提前为我提供的帮助。

 >>  MySQLTuner 2.5.3
     * Jean-Marie Renouard <[email protected]>
     * Major Hayden <[email protected]>
 >>  Bug reports, feature requests, and downloads at http://mysqltuner.pl/
 >>  Run with '--help' for additional options and output filtering

[--] Skipped version check for MySQLTuner script
[OK] Logged in using credentials from Debian maintenance account.
[OK] Operating on 64-bit architecture
 
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE 
[--] Data in Aria tables: 32.0K (Tables: 1)
[--] Data in InnoDB tables: 7.8G (Tables: 173)
[OK] Total fragmented tables: 0
 
[OK] Currently running supported MySQL version 10.6.16-MariaDB-0ubuntu0.22.04.1
 
-------- Log file Recommendations ------------------------------------------------------------------
[!!] Log file  doesn't exist
 
-------- Analysis Performance Metrics --------------------------------------------------------------
[--] innodb_stats_on_metadata: OFF
[OK] No stat updates during querying INFORMATION_SCHEMA.
 
-------- Views Metrics -----------------------------------------------------------------------------
 
-------- Triggers Metrics --------------------------------------------------------------------------
 
-------- Routines Metrics --------------------------------------------------------------------------
 
-------- Security Recommendations ------------------------------------------------------------------
[OK] There are no anonymous accounts for any database users
[OK] All database users have passwords assigned
[!!] There is no basic password file list!
 
-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined
 
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 13d 18h 2m 27s (47M q [40.167 qps], 80K conn, TX: 215G, RX: 7G)
[--] Reads / Writes: 54% / 46%
[--] Binary logging is disabled
[--] Physical Memory     : 31.3G
[--] Max MySQL memory    : 32.5G
[--] Other process memory: 0B
[--] Total buffers: 23.2G global + 3.2M per thread (3000 max threads)
[--] Performance_schema Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 23.3G (74.34% of installed RAM)
[!!] Maximum possible memory usage: 32.5G (103.77% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (10K/47M)
[OK] Highest usage of available connections: 1% (41/3000)
[OK] Aborted connections: 0.00% (0/80484)
[!!] Name resolution is active: a reverse name resolution is made for each new connection which can reduce performance
[OK] Query cache is disabled by default due to mutex contention on multiprocessor machines.
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 1M sorts)
[!!] Joins performed without indexes: 98131
[OK] Temporary tables created on disk: 3% (21K on disk / 595K total)
[OK] Thread cache hit rate: 99% (136 created / 80K connections)
[OK] Table cache hit rate: 99% (22M hits / 22M requests)
[!!] table_definition_cache (400) is less than number of tables (465) 
[OK] Open file limit used: 0% (59/19K)
[OK] Table locks acquired immediately: 100% (532 immediate / 532 locks)
 
-------- Performance schema ------------------------------------------------------------------------
[!!] Performance_schema should be activated.
[--] Sys schema is installed.
 
-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is disabled.
 
-------- MyISAM Metrics ----------------------------------------------------------------------------
[--] General MyIsam metrics:
[--]  +-- Total MyISAM Tables  : 0
[--]  +-- Total MyISAM indexes : 0B
[--]  +-- KB Size :1.0G
[--]  +-- KB Used Size :186.7M
[--]  +-- KB used :18.2%
[--]  +-- Read KB hit rate: 0% (0 cached / 0 reads)
[--]  +-- Write KB hit rate: 0% (0 cached / 0 writes)
[--] No MyISAM table(s) detected ....
 
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[OK] InnoDB File per table is activated
[OK] InnoDB Buffer Pool size ( 22.0G ) under limit for 64 bits architecture: (17179869184.0G )
[OK] InnoDB buffer pool / data size: 22.0G / 7.8G
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (0.426136363636364%): 96.0M * 1 / 22.0G should be equal to 25%
[--] Number of InnoDB Buffer Pool Chunk: 176 for 1 Buffer Pool Instance(s)
[OK] Innodb_buffer_pool_size aligned with Innodb_buffer_pool_chunk_size & Innodb_buffer_pool_instances
[OK] InnoDB Read buffer efficiency: 100.00% (6801776809 hits / 6801918019 total)
[!!] InnoDB Write Log efficiency: 53.07% (4351494 hits / 8200043 total)
[OK] InnoDB log waits: 0.00% (0 waits / 3848549 writes)
 
-------- Aria Metrics ------------------------------------------------------------------------------
[--] Aria Storage Engine is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/352.0K
[!!] Aria pagecache hit rate: 90.8% (79K cached / 7K reads)
 
-------- TokuDB Metrics ----------------------------------------------------------------------------
[--] TokuDB is disabled.
 
-------- XtraDB Metrics ----------------------------------------------------------------------------
[--] XtraDB is disabled.
 
-------- Galera Metrics ----------------------------------------------------------------------------
[--] Galera is disabled.
 
-------- Replication Metrics -----------------------------------------------------------------------
[--] Galera Synchronous replication: NO
[--] No replication slave(s) for this server.
[--] Binlog format: MIXED
[--] XA support enabled: ON
[--] Semi synchronous replication Master: OFF
[--] Semi synchronous replication Slave: OFF
[--] This is a standalone server
 
-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
    Reduce your overall MySQL memory footprint for system stability
    Dedicate this server to your database for highest performance.
    Configure your accounts with ip or subnets only, then update your configuration with skip-name-resolve=ON
    We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found.
             See https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_join_buffer_size
    Performance schema should be activated for better diagnostics
    Be careful, increasing innodb_log_file_size / innodb_log_files_in_group means higher crash recovery mean time
Variables to adjust:
  *** MySQL's maximum memory usage is dangerously high ***
  *** Add RAM before increasing MySQL buffer variables ***
    skip-name-resolve=ON
    join_buffer_size (> 512.0K, or always use indexes with JOINs)
    table_definition_cache (400) > 465 or -1 (autosizing if supported)
    performance_schema=ON
    innodb_log_file_size should be (=5G) if possible, so InnoDB total log file size equals 25% of buffer pool size.
    innodb_log_buffer_size (> 16M)

答案1

我会让 atop 以一定的间隔运行,以全面了解服务器的性能。Atop 可以捕获内存、CPU、磁盘和进程等计算资源的性能快照

由于它可能是特定于 zabbix 的,因此在 zabbix 论坛上创建一个主题也可能是一个好主意

https://www.zabbix.com/forum/zabbix-troubleshooting-and-problems

相关内容