example one of client servers: dual xeon e5-2680v4 (28c/56t) 256RAM 2x1tb NVME raid1 mysql
[root@server src]# ./mysqltuner.pl
>> MySQLTuner 1.8.5 - 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] Currently running supported MySQL version 10.5.15-MariaDB-cll-lve
[OK] Operating on 64-bit architecture
-------- Log file Recommendations ------------------------------------------------------------------
[OK] Log file /var/log/mysql/mysql_error.log exists
[--] Log file: /var/log/mysql/mysql_error.log(1G)
[OK] Log file /var/log/mysql/mysql_error.log is not empty
[!!] Log file /var/log/mysql/mysql_error.log is bigger than 32 Mb
[OK] Log file /var/log/mysql/mysql_error.log is readable.
[!!] /var/log/mysql/mysql_error.log contains 6556 warning(s).
[!!] /var/log/mysql/mysql_error.log contains 32 error(s).
[--] 0 start(s) detected in /var/log/mysql/mysql_error.log
[--] 0 shutdown(s) detected in /var/log/mysql/mysql_error.log
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE
[--] Data in MyISAM tables: 28.9G (Tables: 32572) -
there is sense to use query_cache -
also there is total 63k tables, so cached can be all or at least 1/4
[--] Data in InnoDB tables: 42.6G (Tables: 30324) -
there it takes recommended innodb buffer pool size = 42G
[--] Data in MEMORY tables: 1.1M (Tables: 182)
[!!] Total fragmented tables: 5
-------- Analysis Performance Metrics --------------------------------------------------------------
[--] innodb_stats_on_metadata: OFF
[OK] No stat updates during querying INFORMATION_SCHEMA.
-------- Security Recommendations ------------------------------------------------------------------
[!!] User 'nagios'@% does not specify hostname restrictions.
[!!] User 'webme'@% does not specify hostname restrictions.
-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 40d 8h 23m 26s (2B q [630.699 qps], 31M conn, TX: 45925G, RX: 601G)
[--] Reads / Writes: 93% / 7%
[--] Binary logging is disabled
[--] Physical Memory : 251.6G
[--] Max MySQL memory : 100.6G
[--] Other process memory: 0B
[--] Total buffers: 51.2G global + 194.9M per thread (260 max threads) -
here your ram warning 1
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 78.8G (31.30% of installed RAM) -
here current MAX consumption
[OK] Maximum possible memory usage: 100.6G (40.00% of installed RAM) -
here your ram warning 2
[OK] Overall possible memory usage with other process is compatible with memory available
[OK] Slow queries: 0% (356K/2B)
[OK] Highest usage of available connections: 55% (145/260)
[OK] Aborted connections: 2.48% (770002/31001738) -
due to inactivity timeout or killed by mysql_governor (cloudlinux)
[!!] 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% (651K temp sorts / 539M sorts)
[!!] Joins performed without indexes: 6540756
[!!] Temporary tables created on disk: 67% (171M on disk / 255M total) -
it this case ignored due to separate inRAM tmp dir
[OK] Thread cache hit rate: 99% (145 created / 31M connections)
[OK] Table cache hit rate: 99% (3B hits / 3B requests)
[!!] table_definition_cache(30000) is lower than number of tables(63344) -
but at least it's bigger than default 1400
[OK] Open file limit used: 8% (27K/320K) -
better to keep limit high enough for future
[OK] Table locks acquired immediately: 99% (2B immediate / 2B 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: 56 thread(s).
[--] Using default value is good enough for your version (10.5.15-MariaDB-cll-lve)
-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 25.1% (1B used / 6B cache)
[OK] Key buffer size / total MyISAM indexes: 6.0G/6.7G -
recommeded to keep equal, but in previous string you can see that it uses only 25% during last 40 days uptime, that's why check and tune as really needed, start from 1/2
[OK] Read Key buffer hit rate: 100.0% (191B cached / 63M reads)
[!!] Write Key buffer hit rate: 62.5% (62M cached / 38M writes)
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[!!] InnoDB buffer pool / data size: 40.0G/42.6G
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (5 %): 2.0G * 1/40.0G should be equal to 25% -
2G makes restart about 1 minute, recommended 10G will take up to 5 minutes + in case of crash - repair will take up to 1 hour thats why only 2G
[--] Number of InnoDB Buffer Pool Chunk : 320 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% (502307653762 hits/ 502309962675 total)
[!!] InnoDB Write Log efficiency: 962.64% (77896164 hits/ 8091931 total)
[OK] InnoDB log waits: 0.00% (0 waits / 85988095 writes)
-------- Aria Metrics ------------------------------------------------------------------------------
[--] Aria Storage Engine is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/616.0K
[OK] Aria pagecache hit rate: 98.2% (9B cached / 163M reads)
-------- Recommendations ---------------------------------------------------------------------------
General recommendations:
/var/log/mysql/mysql_error.log is > 32Mb, you should analyze why or implement a rotation log strategy such as logrotate!
Check warning line(s) in /var/log/mysql/mysql_error.log file
Check error line(s) in /var/log/mysql/mysql_error.log file
Run OPTIMIZE TABLE to defragment tables for better performance
OPTIMIZE TABLE `123world_viktorqp_bee`.`modx_session`; -- can free 424.25708770752 MB
OPTIMIZE TABLE `123rkc_rnr`.`cache_page`; -- can free 1163.20782470703 MB
OPTIMIZE TABLE `123veln_db`.`cache_data`; -- can free 162 MB
OPTIMIZE TABLE `123veln_db`.`cache_render`; -- can free 100 MB
OPTIMIZE TABLE `123arant_w`.`wp_postmeta`; -- can free 58 MB
Total freed space after theses OPTIMIZE TABLE : 1907.46491241455 Mb
Variables to adjust:
join_buffer_size (> 256.0K, or always use indexes with JOINs)
table_definition_cache(30000) > 63344 or -1 (autosizing if supported)
performance_schema = ON enable PFS
innodb_buffer_pool_size (>= 42.6G) if possible.
innodb_log_file_size should be (=10G) if possible, so InnoDB total log files size equals to 25% of buffer pool size.
and so on...
optimal to tune mysql that has at least 48h uptime, there is no sense to tune all parameters up to 100% - you can't, if it is not a one fixed project DB, it's shared hosting wit different DBs that can be changed every day. So good values near 75+%