-1

Any suggestion on how can I solve this General recommendations by MySQL tuner?

Am using this plugin eningtron

Server info

**OS: CentOS Linux release 7.9.2009 (Core)
Processors: 4 CPU(s)**
**RAM: 7.64 GB**

MySQL Tuner Output

=== MySQL Tuner ===

 >>  MySQLTuner 1.8.5 - Major Hayden 
 >>  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 passed on the command line
[OK] Currently running supported MySQL version 10.3.36-MariaDB
[OK] Operating on 64-bit architecture
 
-------- Log file Recommendations ------------------------------------------------------------------
[OK] Log file /var/lib/mysql/mysql_error.log exists
[--] Log file: /var/lib/mysql/mysql_error.log(2M)
[OK] Log file /var/lib/mysql/mysql_error.log is not empty
[OK] Log file /var/lib/mysql/mysql_error.log is smaller than 32 Mb
[OK] Log file /var/lib/mysql/mysql_error.log is readable.
[!!] /var/lib/mysql/mysql_error.log contains 1593 warning(s).
[!!] /var/lib/mysql/mysql_error.log contains 7189 error(s).
[--] 430 start(s) detected in /var/lib/mysql/mysql_error.log
[--] 1) 2022-09-10 11:32:10 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 2) 2022-09-10 11:31:02 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 3) 2022-09-10 11:27:22 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 4) 2022-09-10 11:19:02 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 5) 2022-09-09 22:21:15 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 6) 2022-09-09 20:58:14 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 7) 2022-09-09 20:06:37 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 8) 2022-09-09 20:04:32 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 9) 2022-09-09 20:03:35 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 10) 2022-09-09 20:03:00 0 [Note] /usr/sbin/mysqld: ready for connections.
[--] 339 shutdown(s) detected in /var/lib/mysql/mysql_error.log
[--] 1) 2022-09-10 11:32:09 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 2) 2022-09-10 11:31:01 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 3) 2022-09-10 11:27:21 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 4) 2022-09-10 11:19:01 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 5) 2022-09-09 20:58:13 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 6) 2022-09-09 20:06:17 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 7) 2022-09-09 20:03:34 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 8) 2022-09-09 20:02:59 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 9) 2022-09-09 19:48:34 0 [Note] /usr/sbin/mysqld: Shutdown complete
[--] 10) 2022-09-09 19:47:52 0 [Note] /usr/sbin/mysqld: Shutdown complete
 
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE 
[--] Data in InnoDB tables: 1.1G (Tables: 146)
[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
[--] There are 620 basic passwords in the list.
 
-------- CVE Security Recommendations --------------------------------------------------------------
[--] Skipped due to --cvefile option undefined
 
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 6m 47s (39K q [98.066 qps], 1K conn, TX: 30M, RX: 4M)
[--] Reads / Writes: 99% / 1%
[--] Binary logging is disabled
[--] Physical Memory     : 7.6G
[--] Max MySQL memory    : 31.0G
[--] Other process memory: 0B
[--] Total buffers: 4.4G global + 271.2M per thread (100 max threads)
[--] P_S Max memory usage: 95M
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 5.8G (76.36% of installed RAM)
[!!] Maximum possible memory usage: 31.0G (405.77% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (0/39K)
[OK] Highest usage of available connections: 5% (5/100)
[OK] Aborted connections: 0.09%  (1/1135)
[!!] 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% (0 temp sorts / 1K sorts)
[!!] Joins performed without indexes: 95
[!!] Temporary tables created on disk: 76% (3K on disk / 4K total)
[OK] Thread cache hit rate: 99% (5 created / 1K connections)
[OK] Table cache hit rate: 86% (52K hits / 60K requests)
[OK] table_definition_cache(40000) is upper than number of tables(452)
[OK] Open file limit used: 0% (23/640K)
[OK] Table locks acquired immediately: 100% (12 immediate / 12 locks)
 
-------- Performance schema ------------------------------------------------------------------------
[--] Memory used by P_S: 95.1M
[--] Sys schema is installed.
 
-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is enabled.
[--] Thread Pool Size: 4 thread(s).
[--] Using default value is good enough for your version (10.3.36-MariaDB)
 
-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 18.8% (4.5M used / 24.0M cache)
[OK] Key buffer size / total MyISAM indexes: 24.0M/65.0K
[!!] Read Key buffer hit rate: 50.0% (12 cached / 6 reads)
 
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[OK] InnoDB buffer pool / data size: 4.0G/1.1G
[OK] Ratio InnoDB log file size / InnoDB Buffer pool size: 512.0M * 2/4.0G should be equal to 25%
[OK] InnoDB buffer pool instances: 4
[--] Number of InnoDB Buffer Pool Chunk : 32 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: 99.95% (75288151 hits/ 75322931 total)
[!!] InnoDB Write Log efficiency: 3.77% (4 hits/ 106 total)
[OK] InnoDB log waits: 0.00% (0 waits / 110 writes)
 
-------- Aria Metrics ------------------------------------------------------------------------------
[--] Aria Storage Engine is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/0B
[!!] Aria pagecache hit rate: 92.4% (42K cached / 3K 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:
    Check warning line(s) in /var/lib/mysql/mysql_error.log file
    Check error line(s) in /var/lib/mysql/mysql_error.log file
    MySQL was started within the last 24 hours - recommendations may be inaccurate
    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=1
    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).
    Temporary table size is already large - reduce result set size
    Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
  *** MySQL's maximum memory usage is dangerously high ***
  *** Add RAM before increasing MySQL buffer variables ***
    join_buffer_size (> 4.0M, or always use indexes with JOINs)

Operation completed.

my.cnf my.cnf

2
  • Replace the Screenshot by the full mysql-tuner output as formatted text (and make the data after 24hrs of uptime). What else runs on this machine, how much of the memory is used by things other than mariadb? What is the show global status output (will need to be a pastebin link). Are you actually having troubles of any sort? What mariadb configuration variable have you set? The "performance plugin" isn't database related and can be omitted.
    – danblack
    Sep 9 at 22:47
  • Here is my answer for similar question dba.stackexchange.com/a/256135/7895
    – Kondybas
    Sep 10 at 8:23

1 Answer 1

0

Swapping is terrible for performance. So, if mysql is swapping, lower innodb_buffer_pool_size to avoid swapping.

Of course, if you lower that setting "too much", there will be other problems. (We need to see more information to provide further discussion.)

One image implies using both Apache and nginx -- I thought they performed the same function; why have both?

The other image left out a lot of useful info. For even for info, please provide the info discussed in http://mysql.rjweb.org/doc.php/mysql_analysis#tuning ; be sure to include how much RAM you have after account for the other apps on the same server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.