Server has been running for a week and time to try and tune Mysql (MariaDB) up some.
Server Specs:
7GB Ram
2 cpu
NVME drives
Server runs Litespeed and all sites on it are WordPress and utilize LsCache + LSMCD as an object cache.
Current configs for sql:
SQL Tuner Output:
Been 2 years at least since I dove into tuning a sql server so have forgotten near everything. I do remember changing adding a select few configs to do with logs could cause the server not to start back up, because of format change I think...
I have a lot of reading and catching up to do and any help is appreciated
This server will get an upgrade in the near future as well and its ram will near double.
Server Specs:
7GB Ram
2 cpu
NVME drives
Server runs Litespeed and all sites on it are WordPress and utilize LsCache + LSMCD as an object cache.
Current configs for sql:
Code:
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# include all files from the config directory
#
!includedir /etc/my.cnf.d
[mysqld]
log-error=/var/lib/mysql/s05.thedomain.ca.err
performance-schema=0
innodb_file_per_table=1
max_allowed_packet=268435456
open_files_limit=10000
Code:
-------- Storage Engine Statistics -----------------------------------------------------------------
[--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE
[--] Data in MyISAM tables: 41.3M (Tables: 355)
[--] Data in InnoDB tables: 16.5M (Tables: 67)
[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 --------------------------------------------------------------
[OK] NO SECURITY CVE FOUND FOR YOUR VERSION
-------- Performance Metrics -----------------------------------------------------------------------
[--] Up for: 4d 17h 45m 0s (2M q [6.225 qps], 115K conn, TX: 8G, RX: 520M)
[--] Reads / Writes: 67% / 33%
[--] Binary logging is disabled
[--] Physical Memory : 6.5G
[--] Max MySQL memory : 38.6G
[--] Other process memory: 0B
[--] Total buffers: 417.0M global + 258.9M per thread (151 max threads)
[--] P_S Max memory usage: 0B
[--] Galera GCache Max memory usage: 0B
[OK] Maximum reached memory usage: 4.2G (64.70% of installed RAM)
[!!] Maximum possible memory usage: 38.6G (594.40% of installed RAM)
[!!] Overall possible memory usage with other process exceeded memory
[OK] Slow queries: 0% (0/2M)
[OK] Highest usage of available connections: 9% (15/151)
[OK] Aborted connections: 0.11% (127/115076)
[!!] name resolution is active : a reverse name resolution is made for each new connection and can reduce performance
[!!] Query cache may be disabled by default due to mutex contention.
[!!] Query cache efficiency: 0.0% (0 cached / 1M selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 171K sorts)
[!!] Joins performed without indexes: 9337
[!!] Temporary tables created on disk: 41% (173K on disk / 422K total)
[OK] Thread cache hit rate: 99% (15 created / 115K connections)
[OK] Table cache hit rate: 76% (597 open / 777 opened)
[!!] table_definition_cache(400) is lower than number of tables(687)
[OK] Open file limit used: 8% (804/10K)
[OK] Table locks acquired immediately: 99% (945K immediate / 945K locks)
-------- Performance schema ------------------------------------------------------------------------
[--] Performance schema is disabled.
[--] Memory used by P_S: 0B
[--] Sys schema is installed.
-------- ThreadPool Metrics ------------------------------------------------------------------------
[--] ThreadPool stat is enabled.
[--] Thread Pool Size: 2 thread(s).
[--] Using default value is good enough for your version (10.3.22-MariaDB)
-------- MyISAM Metrics ----------------------------------------------------------------------------
[!!] Key buffer used: 22.1% (29M used / 134M cache)
[OK] Key buffer size / total MyISAM indexes: 128.0M/6.9M
[OK] Read Key buffer hit rate: 100.0% (7M cached / 1K reads)
[!!] Write Key buffer hit rate: 64.0% (654K cached / 419K writes)
-------- InnoDB Metrics ----------------------------------------------------------------------------
[--] InnoDB is enabled.
[--] InnoDB Thread Concurrency: 0
[OK] InnoDB File per table is activated
[OK] InnoDB buffer pool / data size: 128.0M/16.5M
[!!] Ratio InnoDB log file size / InnoDB Buffer pool size (75 %): 48.0M * 2/128.0M should be equal to 25%
[OK] InnoDB buffer pool instances: 1
[--] Number of InnoDB Buffer Pool Chunk : 1 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% (15199748 hits/ 15200315 total)
[!!] InnoDB Write Log efficiency: 69.98% (331283 hits/ 473377 total)
[OK] InnoDB log waits: 0.00% (0 waits / 142094 writes)
-------- AriaDB Metrics ----------------------------------------------------------------------------
[--] AriaDB is enabled.
[OK] Aria pagecache size / total Aria indexes: 128.0M/1B
[!!] Aria pagecache hit rate: 88.7% (1M cached / 158K 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:
Control warning line(s) into /var/lib/mysql/s05.thedomain.ca.err file
Control error line(s) into /var/lib/mysql/s05.thedomain.ca.err file
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).
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries which have no LIMIT clause
Performance schema should be activated for better diagnostics
Before changing innodb_log_file_size and/or innodb_log_files_in_group read this: https://bit.ly/2TcGgtU
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
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)
table_definition_cache(400) > 687 or -1 (autosizing if supported)
performance_schema = ON enable PFS
innodb_log_file_size should be (=16M) if possible, so InnoDB total log files size equals to 25% of buffer pool size.
I have a lot of reading and catching up to do and any help is appreciated