Analysis of GLOBAL STATUS and VARIABLES:
Observations:
- Version: 10.1.44-MariaDB-0ubuntu0.18.04.1
- 7.8 GB of RAM
- Uptime = 1d 00:37:45
- 71.7 QPS
The More Important Issues:
Version 10.1 is getting quite old; consider upgrading.
There were a lot of DELETEs during that day. Is that normal?
Suggested changes to settings:
key_buffer_size = 20M
If using SSD disk:
innodb_io_capacity = 1000
innodb_flush_neighbors = 0
Details and other observations:
( Key_blocks_used * 1024 / key_buffer_size ) = 8 * 1024 / 262144 = 3.1%
-- Percent of key_buffer used. High-water-mark.
-- Lower key_buffer_size (now 262144) to avoid unnecessary memory usage.
( innodb_buffer_pool_size / innodb_buffer_pool_instances ) = 6144M / 1 = 6144MB
-- Size of each buffer_pool instance.
-- An instance should be at least 1GB. In very large RAM, have 16 instances.
( innodb_lru_scan_depth ) = 1,024
-- innodb_lru_scan_depth is a very poorly named variable. A better name would be innodb_free_page_target_per_buffer_pool. It is a number of pages InnoDB tries to keep free in each buffer pool instance to speed up read and page creation operations.
-- "InnoDB: page_cleaner: 1000ms intended loop took ..." may be fixed by lowering lru_scan_depth
( innodb_io_capacity ) = 200
-- When flushing, use this many IOPs.
-- Reads could be slugghish or spiky. Use 2000 if using SSD drive.
( innodb_io_capacity_max / innodb_io_capacity ) = 2,000 / 200 = 10
-- Capacity: max/plain
-- Recommend 2. Max should be about equal to the IOPs your I/O subsystem can handle. (If the drive type is unknown 2000/200 may be a reasonable pair.)
( Uptime / 60 * innodb_log_file_size / Innodb_os_log_written ) = 88,665 / 60 * 48M / 3815175168 = 19.5
-- Minutes between InnoDB log rotations Beginning with 5.6.8, innodb_log_file_size can be changed dynamically; I don't know about MariaDB. Be sure to also change my.cnf
-- (The recommendation of 60 minutes between rotations is somewhat arbitrary.) Adjust innodb_log_file_size (now 50331648). (Cannot change in AWS.)
( default_tmp_storage_engine ) = default_tmp_storage_engine =
( Innodb_row_lock_time_avg ) = 38,990
-- Avg time to lock a row (millisec)
-- Possibly conflicting queries; possibly table scans.
( Innodb_row_lock_time_max ) = 51,002
-- Max time to lock a row (millisec)
-- Possibly conflicting queries; possibly table scans.
( innodb_flush_neighbors ) = innodb_flush_neighbors = 1
-- A minor optimization when writing blocks to disk.
-- Use 0 for SSD drives; 1 for HDD.
( innodb_io_capacity ) = 200
-- I/O ops per second capable on disk . 100 for slow drives; 200 for spinning drives; 1000-2000 for SSDs; multiply by RAID factor. Limits write IO requests per second (IOPS).
-- For starters: HDD: 200; SSD: 2000.
( innodb_strict_mode ) = innodb_strict_mode = OFF
-- When ON, this catches some subtle errors earlier.
-- OFF leaves some warnings as warnings; ON makes them errors.
( innodb_adaptive_hash_index ) = innodb_adaptive_hash_index = ON
-- Whether to use the adapative hash (AHI).
-- ON for mostly readonly; OFF for DDL-heavy
( innodb_flush_log_at_trx_commit ) = 0
-- 1 = secure; 2 = faster
-- (You decide) Use 1, along with sync_binlog (now 0)=1 for the greatest level of fault tolerance. 0 is best for speed. 2 is a compromise between 0 and 1.
( sync_binlog ) = 0
-- Use 1 for added security, at some cost of I/O =1 may lead to lots of "query end"; =0 may lead to "binlog at impossible position" and lose transactions in a crash, but is faster. 0 is OK for Galera.
( innodb_adaptive_hash_index ) = innodb_adaptive_hash_index = ON
-- Usually should be ON.
-- There are cases where OFF is better. See also innodb_adaptive_hash_index_parts (after 5.7.9) and innodb_adaptive_hash_index_partitions (now 1) (MariaDB and Percona). ON has been implicated in rare crashes (bug 73890). 10.5.0 decided to default OFF.
( innodb_print_all_deadlocks ) = innodb_print_all_deadlocks = OFF
-- Whether to log all Deadlocks.
-- If you are plagued with Deadlocks, turn this on. Caution: If you have lots of deadlocks, this may write a lot to disk.
( innodb_purge_threads ) = 1
-- Number of threads to clean up history list.
-- If you have a lot of writes, recommend 4 in versions 5.6 and 10.0 or later.
( max_connections ) = 80
-- Maximum number of connections (threads). Impacts various allocations.
-- If max_connections (now 80) is too high and various memory settings are high, you could run out of RAM.
( innodb_ft_result_cache_limit ) = 2,000,000,000 / 8375186227.2 = 23.9%
-- Byte limit on FULLTEXT resultset. (It grows as needed.)
-- Lower the setting.
( local_infile ) = local_infile = ON
-- local_infile (now ON) = ON is a potential security issue
( (Com_insert + Com_update + Com_delete + Com_replace) / Com_commit ) = (760824 + 1003342 + 2842 + 0) / 2014065 = 0.877
-- Statements per Commit (assuming all InnoDB)
-- Low: Might help to group queries together in transactions; High: long transactions strain various things.
( Com__biggest ) = Com__biggest = Com_begin
-- Which of the "Com_" metrics is biggest.
-- Normally it is Com_select (now 499597).
( binlog_format ) = binlog_format = STATEMENT
-- STATEMENT/ROW/MIXED.
-- ROW is preferred by 5.7 (10.3)
( slow_query_log ) = slow_query_log = OFF
-- Whether to log slow queries. (5.1.12)
( long_query_time ) = 10
-- Cutoff (Seconds) for defining a "slow" query.
-- Suggest 2
( log_slow_slave_statements ) = log_slow_slave_statements = OFF
-- (5.6.11, 5.7.1) By default, replicated statements won't show up in the slowlog; this causes them to show.
-- It can be helpful in the slowlog to see writes that could be interfering with Replica reads.
( back_log ) = 66
-- (Autosized as of 5.6.6; based on max_connections)
-- Raising to min(150, max_connections (now 80)) may help when doing lots of connections.
Abnormally small:
(Com_select) / (Com_insert + Com_update + Com_delete + Com_replace) = 0.283
Acl_proxy_users = 0
Key_blocks_unused = 194
host_cache_size = 208
Abnormally large:
Acl_table_grants = 18
Com_begin = 23 /sec
Com_show_master_status = 2.1 /HR
Com_show_slave_hosts = 0.24 /HR
Com_show_status = 0.2 /sec
Handler_delete = 99 /sec
Innodb_buffer_pool_pages_flushed / max(Questions, Queries) = 0.651
Innodb_buffer_pool_pages_misc * 16384 / innodb_buffer_pool_size = 11.5%
Innodb_ibuf_merged_delete_marks = 48 /sec
Innodb_num_index_pages_written = 46 /sec
Innodb_rows_deleted = 99 /sec
Tc_log_page_size = 4,096
Abnormal strings:
binlog_checksum = NONE
innodb_default_row_format = compact
innodb_fast_shutdown = 1
innodb_log_compressed_pages = OFF
myisam_stats_method = NULLS_UNEQUAL
sql_slave_skip_counter = 0