Created
January 20, 2020 11:09
-
-
Save imranrazakhan/71e4638b638364a939ac1410765188ee to your computer and use it in GitHub Desktop.
mysqltuner.pl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have no name!@db-1-wpfth:/tmp$ perl mysqltuner.pl | |
whoami: cannot find name for user ID 1000250000 | |
>> MySQLTuner 1.7.19 - 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: [OK] Currently running supported MySQL version 5.7.28 | |
[OK] Operating on 64-bit architecture | |
-------- Log file Recommendations ------------------------------------------------------------------ | |
[!!] log_error is set to stderr MT can't read stderr | |
-------- Storage Engine Statistics ----------------------------------------------------------------- | |
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MEMORY +MRG_MYISAM +MyISAM +PERFORMANCE_SCHEMA | |
[--] Data in InnoDB tables: 6.2G (Tables: 133) | |
[OK] Total fragmented tables: 0 | |
-------- 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 | |
[!!] User 'okdmysql@%' does not specify hostname restrictions. | |
[!!] User 'root@%' does not specify hostname restrictions. | |
[!!] There is no basic password file list! | |
-------- CVE Security Recommendations -------------------------------------------------------------- | |
[--] Skipped due to --cvefile option undefined | |
-------- Performance Metrics ----------------------------------------------------------------------- | |
[--] Up for: 13m 52s (204 q [0.245 qps], 612 conn, TX: 309K, RX: 13K) | |
[--] Reads / Writes: 68% / 32% | |
[--] Binary logging is disabled | |
[--] Physical Memory : 31.2G | |
[--] Max MySQL memory : 4.6G | |
[--] Other process memory: 0B | |
[--] Total buffers: 2.1G global + 17.1M per thread (151 max threads) | |
[--] P_S Max memory usage: 72B | |
[--] Galera GCache Max memory usage: 0B | |
[OK] Maximum reached memory usage: 2.1G (6.86% of installed RAM) | |
[OK] Maximum possible memory usage: 4.6G (14.74% of installed RAM) | |
[OK] Overall possible memory usage with other process is compatible with memory available | |
[OK] Slow queries: 0% (0/204) | |
[OK] Highest usage of available connections: 2% (4/151) | |
[!!] Aborted connections: 75.33% (461/612) | |
[!!] Query cache may be disabled by default due to mutex contention. | |
[!!] Query cache efficiency: 0.0% (0 cached / 302 selects) | |
[OK] Query cache prunes per day: 0 | |
[OK] No Sort requiring temporary tables | |
[!!] Joins performed without indexes: 3 | |
[!!] Temporary tables created on disk: 74% (133 on disk / 178 total) | |
[OK] Thread cache hit rate: 99% (4 created / 612 connections) | |
[OK] Table cache hit rate: 91% (277 open / 304 opened) | |
[OK] table_definition_cache(1400) is upper than number of tables(420) | |
[OK] Open file limit used: 0% (31/1M) | |
[OK] Table locks acquired immediately: 99% (412 immediate / 413 locks) | |
-------- Performance schema ------------------------------------------------------------------------ | |
[--] Memory used by P_S: 72B | |
[--] Sys schema is installed. | |
-------- ThreadPool Metrics ------------------------------------------------------------------------ | |
[--] ThreadPool stat is disabled. | |
-------- MyISAM Metrics ---------------------------------------------------------------------------- | |
[!!] Key buffer used: 18.3% (1M used / 8M cache) | |
[OK] Key buffer size / total MyISAM indexes: 8.0M/49.0K | |
[OK] Read Key buffer hit rate: 97.5% (602 cached / 15 reads) | |
-------- InnoDB Metrics ---------------------------------------------------------------------------- | |
[--] InnoDB is enabled. | |
[--] InnoDB Thread Concurrency: 0 | |
[OK] InnoDB File per table is activated | |
[!!] InnoDB buffer pool / data size: 2.0G/6.2G | |
[OK] Ratio InnoDB log file size / InnoDB Buffer pool size: 256.0M * 2/2.0G should be equal to 25% | |
[!!] InnoDB buffer pool instances: 4 | |
[--] Number of InnoDB Buffer Pool Chunk : 16 for 4 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: 91.82% (15079 hits/ 16422 total) | |
[!!] InnoDB Write Log efficiency: 336.08% (326 hits/ 97 total) | |
[OK] InnoDB log waits: 0.00% (0 waits / 423 writes) | |
-------- AriaDB Metrics ---------------------------------------------------------------------------- | |
[--] AriaDB is disabled. | |
-------- 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: ROW | |
[--] XA support enabled: ON | |
[--] Semi synchronous replication Master: Not Activated | |
[--] Semi synchronous replication Slave: Not Activated | |
[--] This is a standalone server | |
-------- Recommendations --------------------------------------------------------------------------- | |
General recommendations: | |
Restrict Host for 'okdmysql'@% to okdmysql@SpecificDNSorIp | |
UPDATE mysql.user SET host ='SpecificDNSorIp' WHERE user='okdmysql' AND host ='%'; FLUSH PRIVILEGES; | |
Restrict Host for 'root'@% to root@SpecificDNSorIp | |
UPDATE mysql.user SET host ='SpecificDNSorIp' WHERE user='root' AND host ='%'; FLUSH PRIVILEGES; | |
MySQL was started within the last 24 hours - recommendations may be inaccurate | |
Reduce or eliminate unclosed connections and network issues | |
We will suggest raising the 'join_buffer_size' until JOINs not using indexes are found. | |
See https://dev.mysql.com/doc/internals/en/join-buffer-size.html | |
(specially the conclusions at the bottom of the page). | |
When making adjustments, make tmp_table_size/max_heap_table_size equal | |
Reduce your SELECT DISTINCT queries which have no LIMIT clause | |
Variables to adjust: | |
query_cache_size (=0) | |
query_cache_type (=0) | |
query_cache_limit (> 1M, or use smaller result sets) | |
join_buffer_size (> 256.0K, or always use indexes with JOINs) | |
tmp_table_size (> 16M) | |
max_heap_table_size (> 16M) | |
innodb_buffer_pool_size (>= 6.2G) if possible. | |
innodb_buffer_pool_instances(=2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment