MariaDB 5.5 on Zabbix

it is a pleasure for me joining your community. I read a lot of posts trying to figure how to solve some problems. I’m facing with some performance issues about MariaDB on zabbix.

First of all, the hardware is based on NetApp HCI full SSD. The VM got 80GB 12core of virtual resources. The Database is about 500GB and actually it is parametrized as follow:

MariaDB on Oracle enterprise Linux 7

[mariadb-5.5]

max_connections = 110

slow_query_log=1

innodb_buffer_pool_size=32G

innodb_flush_method=O_DIRECT

innodb_file_per_table = ON

innodb_log_file_size = 1G

innodb_buffer_pool_instances = 32

innodb_stats_on_metadata = OFF

thread_cache_size = 512

query_cache_size = 0

query_cache_type = 0

join_buffer_size = 512M

max_allowed_packet = 16M

tmp_table_size = 32M

max_heap_table_size = 32M

innodb_io_capacity=2000

open_files_limit=65535

table_open_cache=10240

Zabbix is under slow performances with the "Configuration syncer" and "History syncer" services

i get a lot of slow queries like:

Time: 210730 18:01:28 User@Host: zabbixfe[zabbixfe] @ app-p-zabbix-fe02 [1.1.1.2] Thread_id: 1225328 Schema: zabbix QC_hit: No Query_time: 187.665202 Lock_time: 0.000123 Rows_sent: 80 Rows_examined: 99314556 SET timestamp=1627660888; SELECT g.groupid,g.name FROM hstgrp g WHERE EXISTS (SELECT NULL FROM rights r WHERE g.groupid=r.id AND r.groupid IN (13,15) GROUP BY r.id HAVING MIN(r.permission)>0 AND MAX(r.permission)>=’2′) AND EXISTS (SELECT NULL FROM hosts h,items i,graphs_items gi,graphs gr,hosts_groups hg WHERE hg.hostid=h.hostid AND h.status IN (0,1) AND hg.hostid=i.hostid AND i.itemid=gi.itemid AND gi.graphid=gr.graphid AND gr.flags IN (0,4) AND g.groupid=hg.groupid) AND EXISTS (SELECT NULL FROM hosts h,hosts_groups hg WHERE hg.hostid=h.hostid AND h.status IN (0,1) AND g.groupid=hg.groupid);

Time: 210730 18:02:24 User@Host: zabbixfe[zabbixfe] @ app-p-zabbix-fe02 [1.1.1.2] Thread_id: 1225960 Schema: zabbix QC_hit: No Query_time: 162.196613 Lock_time: 0.000100 Rows_sent: 83 Rows_examined: 107770132 SET timestamp=1627660944; SELECT g.groupid,g.name FROM hstgrp g WHERE EXISTS (SELECT NULL FROM hosts h,items i,graphs_items gi,graphs gr,hosts_groups hg WHERE hg.hostid=h.hostid AND h.status IN (0,1) AND hg.hostid=i.hostid AND i.itemid=gi.itemid AND gi.graphid=gr.graphid AND gr.flags IN (0,4) AND g.groupid=hg.groupid) AND EXISTS (SELECT NULL FROM hosts h,hosts_groups hg WHERE hg.hostid=h.hostid AND h.status IN (0,1) AND g.groupid=hg.groupid); /usr/libexec/mysqld, Version: 5.5.65-MariaDB (MariaDB Server). started with: Tcp port: 0 Unix socket: /var/lib/mysql/mysql.sock Time Id Command Argument

Time: 210730 18:14:10 User@Host: zabbixfe[zabbixfe] @ app-p-zabbix-fe02 [1.1.1.2] Thread_id: 18 Schema: zabbix QC_hit: No Query_time: 105.371170 Lock_time: 0.000070 Rows_sent: 20 Rows_examined: 542379 use zabbix; SET timestamp=1627661650; SELECT DISTINCT e.eventid,e.clock,e.ns,e.objectid,e.acknowledged,er1.r_eventid FROM events e LEFT JOIN event_recovery er1 ON er1.eventid=e.eventid WHERE e.source=’0′ AND e.object=’0′ AND e.objectid=90135 AND e.eventid<=’139663038′ AND e.value=1 ORDER BY e.eventid DESC LIMIT 20;

MysqlTuner says:

(it runs in < 1sec)

MySQLTuner 1.7.17 – 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 Please enter your MySQL administrative login: root Please enter your MySQL administrative password: [!!] Your MySQL version 5.5.65-MariaDB is EOL software! Upgrade soon! [OK] Operating on 64-bit architecture

——– Storage Engine Statistics —————————————————————– [–] Status: +ARCHIVE +Aria +BLACKHOLE +CSV +FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA [–] Data in InnoDB tables: 463.0G (Tables: 149) [OK] Total fragmented tables: 0 [!!] failed to execute: SHOW TABLE STATUS FROM `#mysql50#lost+found` [!!] FAIL Execute SQL / return code: 256

——– Analysis Performance Metrics ————————————————————– [–] innodb_stats_on_metadata: OFF [OK] No stat updates during querying INFORMATION_SCHEMA.

——– 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: 3d 20h 28m 20s (597M q [1K qps], 1M conn, TX: 1650G, RX: 130G) [–] Reads / Writes: 84% / 16% [–] Binary logging is disabled [–] Physical Memory : 78.4G [–] Max MySQL memory : 87.6G [–] Other process memory: 0B [–] Total buffers: 32.3G global + 514.7M per thread (110 max threads) [–] P_S Max memory usage: 0B [–] Galera GCache Max memory usage: 0B [!!] Maximum reached memory usage: 78.5G (100.16% of installed RAM) [!!] Maximum possible memory usage: 87.6G (111.70% of installed RAM) [!!] Overall possible memory usage with other process exceeded memory [OK] Slow queries: 0% (5K/597M) [OK] Highest usage of available connections: 83% (92/110) [OK] Aborted connections: 0.00% (5/1097879) [!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance [OK] Query cache is disabled by default due to mutex contention on multiprocessor machines. [OK] Sorts requiring temporary tables: 0% (15K temp sorts / 192M sorts) [!!] Joins performed without indexes: 15222 [OK] Temporary tables created on disk: 6% (1M on disk / 24M total) [OK] Thread cache hit rate: 99% (92 created / 1M connections) [OK] Table cache hit rate: 104% (632 open / 606 opened) [OK] Open file limit used: 0% (54/65K) [OK] Table locks acquired immediately: 100% (757M immediate / 757M locks)

——– Performance schema ———————————————————————— [–] Performance schema is disabled.

[–] Memory used by P_S: 0B

[–] 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 (5.5.65-MariaDB)

——– MyISAM Metrics —————————————————————————- [!!] Key buffer used: 18.2% (24M used / 134M cache)

[OK] Key buffer size / total MyISAM indexes: 128.0M/99.0K

[!!] Read Key buffer hit rate: 80.0% (5 cached / 1 reads)

——– InnoDB Metrics —————————————————————————- [–] InnoDB is enabled.

[–] InnoDB Thread Concurrency: 0

[OK] InnoDB File per table is activated

[!!] InnoDB buffer pool / data size: 32.0G/463.0G

[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (6.25 %): 1.0G * 2/32.0G should be equal to 25%

[OK] InnoDB buffer pool instances: 32

[–] InnoDB Buffer Pool Chunk Size not used or defined in your version

[OK] InnoDB Read buffer efficiency: 99.97% (272868942400 hits/ 272941485284 total)

[OK] InnoDB Write log efficiency: 96.86% (835415575 hits/ 862541514 total)

[OK] InnoDB log waits: 0.00% (0 waits / 27125939 writes)

——– AriaDB Metrics —————————————————————————-

[–] AriaDB is enabled.

[OK] Aria pagecache size / total Aria indexes: 128.0M/1B

[OK] Aria pagecache hit rate: 99.9% (13B cached / 7M reads)

###Thank you in advance OC