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

Memory usage in Docker higher than configured.

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.6.12
    • N/A
    • OTHER
    • None
    • Debian 11
      Docker version 20.10.17
      MariaDB Server 10.6.12-MariaDB-1:10.6.12+maria~ubu2004-log

    Description

      All of our MariaDB Containers use more memory than they should.
      We have a couple of MariaDB Servers running in Docker Containers and after a while they all run at about 90-100% of the maximum memory for the container (mem_limit).
      We calculate the possible memory usage with:

      SELECT ROUND( ( @@GLOBAL.key_buffer_size + @@GLOBAL.query_cache_size + @@GLOBAL.tmp_table_size + @@GLOBAL.innodb_buffer_pool_size + @@GLOBAL.aria_pagecache_buffer_size + @@GLOBAL.innodb_log_buffer_size + @@GLOBAL.max_connections * ( @@GLOBAL.sort_buffer_size + @@GLOBAL.read_buffer_size + @@GLOBAL.read_rnd_buffer_size + @@GLOBAL.join_buffer_size + @@GLOBAL.thread_stack + @@GLOBAL.binlog_cache_size) ) / 1024 / 1024, 1) `total MB`;
      

      The result for one server is 13.3 GB but the container uses 16GB.
      For another server its more extreme: 23.6GB calculated and 39.5GB used.
      Most of the servers keep it very close to the docker mem_limit, but one server just exceeded it and went OOM.
      I attached one of the my.cnf files.
      Our max_connections limit is at 1000 but the maximum used connections is more in the range of 200. For one server even much lower with 50 Connections.
      What we where able to observe:
      If we restart the server and then import a big database, the memory always reaches 90-95% of mem_limit. Yesterday we observed on one server that this also happens when doing backups from an external container via mariadb-dump. After that the memory usage is not reduced.

      I would be very thankful for any help.

      Attachments

        Activity

          People

            Unassigned Unassigned
            bjoernmariadb Bjoern
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

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