Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-32231

Memory is not being released (memory leak)

    XMLWordPrintable

Details

    Description

      My MariaDB 10.6 has got memory leak issues. Database itself is 600GB of data size and 18,5k of tables (InnoDB).

      Level of available memory in zabbix is constantly going down slowly, but also especially rapidly when i run query to count all the tables size:

      SELECT table_schema, ROUND(SUM(data_length + index_length) / 1024 / 1024 / 1024, 2) as sizeGB FROM information_schema.TABLES GROUP BY table_schema ORDER BY sizeGB DESC;

      So maybe its connected with the amount of tables but still - memory leak is there because memory is not being released after is used - it goes down to ~3GB and database crash.

      Below i'm pasting my mysqltunner output, please let me know if it could be fixed or how further debugged

       >>  MySQLTuner 2.0.5
      	 * Jean-Marie Renouard <jmrenouard@gmail.com>
      	 * Major Hayden <major@mhtx.net>
       >>  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.6.10-MariaDB-1:10.6.10+maria~ubu2004-log
      [OK] Operating on 64-bit architecture
       
      -------- Log file Recommendations ------------------------------------------------------------------
      [!!] Log file  doesn't exist
       
      -------- Storage Engine Statistics -----------------------------------------------------------------
      [--] Status: +Aria +CSV +InnoDB +MEMORY +MRG_MyISAM +MyISAM +PERFORMANCE_SCHEMA +SEQUENCE 
      [--] Data in Aria tables: 32.0K (Tables: 1)
      [--] Data in InnoDB tables: 611.0G (Tables: 18780)
      [OK] Total fragmented tables: 0
       
      -------- Analysis Performance Metrics --------------------------------------------------------------
      [--] innodb_stats_on_metadata: OFF
      [OK] No stat updates during querying INFORMATION_SCHEMA.
       
      -------- Views Metrics -----------------------------------------------------------------------------
       
      -------- Triggers Metrics --------------------------------------------------------------------------
       
      -------- Routines Metrics --------------------------------------------------------------------------
       
      -------- Security Recommendations ------------------------------------------------------------------
      [OK] There are no anonymous accounts for any database users
      [OK] All database users have passwords assigned
      [!!] There is no basic password file list!
       
      -------- CVE Security Recommendations --------------------------------------------------------------
      [--] Skipped due to --cvefile option undefined
       
      -------- Performance Metrics -----------------------------------------------------------------------
      [--] Up for: 16d 1h 34m 2s (167M q [120.847 qps], 630K conn, TX: 565G, RX: 759G)
      [--] Reads / Writes: 42% / 58%
      [--] Binary logging is disabled
      [--] Physical Memory     : 62.0G
      [--] Max MySQL memory    : 50.6G
      [--] Other process memory: 0B
      [--] Total buffers: 34.2G global + 131.1M per thread (128 max threads)
      [--] P_S Max memory usage: 72B
      [--] Galera GCache Max memory usage: 0B
      [OK] Maximum reached memory usage: 45.8G (73.89% of installed RAM)
      [OK] Maximum possible memory usage: 50.6G (81.53% of installed RAM)
      [OK] Overall possible memory usage with other process is compatible with memory available
      [OK] Slow queries: 0% (252/167M)
      [OK] Highest usage of available connections: 71% (91/128)
      [!!] Aborted connections: 7.34%  (46284/630358)
      [OK] Query cache is disabled by default due to mutex contention on multiprocessor machines.
      [OK] Sorts requiring temporary tables: 0% (30K temp sorts / 15M sorts)
      [!!] Joins performed without indexes: 955042
      [OK] Temporary tables created on disk: 0% (55K on disk / 7M total)
      [!!] Thread cache is disabled
      [OK] Table cache hit rate: 98% (203M hits / 206M requests)
      [OK] table_definition_cache (20000) is greater than number of tables (19073)
      [OK] Open file limit used: 0% (61/32K)
      [OK] Table locks acquired immediately: 99% (271K immediate / 271K locks)
       
      -------- Performance schema ------------------------------------------------------------------------
      [--] Performance_schema is activated.
      [--] Memory used by P_S: 72B
      [--] Sys schema is installed.
       
      -------- ThreadPool Metrics ------------------------------------------------------------------------
      [--] ThreadPool stat is disabled.
       
      -------- MyISAM Metrics ----------------------------------------------------------------------------
      [--] No MyISAM table(s) detected ....
       
      -------- InnoDB Metrics ----------------------------------------------------------------------------
      [--] InnoDB is enabled.
      [OK] InnoDB File per table is activated
      [!!] InnoDB buffer pool / data size: 32.0G / 611.0G
      [!!] Ratio InnoDB log file size / InnoDB Buffer pool size (12.5%): 4.0G * 1 / 32.0G should be equal to 25%
      [--] Number of InnoDB Buffer Pool Chunk: 256 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: 99.82% (127117497426 hits/ 127350441335 total)
      [!!] InnoDB Write Log efficiency: 86.73% (458108328 hits/ 528205890 total)
      [OK] InnoDB log waits: 0.00% (0 waits / 70097562 writes)
       
      -------- Aria Metrics ------------------------------------------------------------------------------
      [--] Aria Storage Engine is enabled.
      [OK] Aria pagecache size / total Aria indexes: 2.0G/376.0K
      [OK] Aria pagecache hit rate: 100.0% (1B cached / 210K 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:
          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).
          Set thread_cache_size to 4 as a starting value
          Before changing innodb_log_file_size and/or innodb_log_files_in_group read this: https://bit.ly/2TcGgtU
      Variables to adjust:
          long_query_time (<= 10)
          join_buffer_size (> 500.0K, or always use indexes with JOINs)
          thread_cache_size (start at 4)
          innodb_buffer_pool_size (>= 611.0G) if possible.
          innodb_log_file_size should be (=8G) if possible, so InnoDB total log files size equals 25% of buffer pool size.
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            kamkos Kamil
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.