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

Strange mariadb memory usage investigation

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Incomplete
    • 10.6.22
    • N/A
    • Memory management
    • None
    • - MariaDB 10.6.22 running on RHEL 8 with 8vCPU and 32GB memory
      - Galera cluster with 2 DB nodes and 1 arbitrator
      - DB node 1 as a primary and DB node 2 as a slave such that all read/write operations are sent to node 1 only.

    Description

      I took the below scenario to investigate the mariadb memory usage.

      Scenario:
      1. create database test and create table t1(see attached sql file)
      2. restart both nodes one by one.
      3. record the initial memory usage:

      • get mariadb memory usage by 'top' command (top -b -n 1 | grep mariadbd )
      • get system inactive memory usage and active memory usage by 'vmstat' command (vmstat -a)
      • get mariadbd virtual and real memory usage (VSZ and RSS) by 'ps' command (ps aux | grep mariadbd)
        4. Load single_insert_t1_3M.sql file (see the zip file attached) to insert 3 million rows to table t1 by running mysql client( mysql .... < single_insert_t1_3M.sql)
        5. After finishing inserting 3 million rows to table t1, repeat step 3 to take memory usage to calculate the memory consumed in step 4.
        6. The memory consumption is recorded in the excel Please see the excel file attached.

      From the 'top' or 'RSS' result, the mariadbd process memory increased is around 3.5GB. It is supposed the 3.5GB memory used by the mariadbd process should be reflected in active memory. However it is noticed that this ammount of memory used is increased in inactive memory instead of active memory. Is this memory usage behavior is normal? Please advise.

      Attachments

        1. create_table_t1.sql
          0.9 kB
        2. mariadb_mem_test.xlsx
          94 kB
        3. my.cnf
          9 kB
        4. my-1.cnf
          9 kB
        5. single_insert_t1_3M.sql.zip
          1.76 MB

        Activity

          People

            marko Marko Mäkelä
            ktchow_ogcio Chow King Tak
            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.