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

High CPU Usage When Absolutely Idle on OSX

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 10.1.12
    • N/A
    • Encryption
    • None
    • OSX

    Description

      I have installed mariadb using homebrew on my development machine. It starts at boot time, but if I am not actively working on my local development environment, no queries are running. Despite no activity, mariadb is using 100% of my CPU. Stopping the service has been my only option.

      Attachments

        Issue Links

          Activity

            This is interesting. The second I attach the lldb debugger to the mariadb process, the CPU usage immediate drops - before I get a chance to do the trace. If I exit lldb, the CPU usage goes up again. So, I'm not sure a trace is going to capture the problem in action.

            amykhar Amy Anuszewski added a comment - This is interesting. The second I attach the lldb debugger to the mariadb process, the CPU usage immediate drops - before I get a chance to do the trace. If I exit lldb, the CPU usage goes up again. So, I'm not sure a trace is going to capture the problem in action.

            The CPU usage makes sense. The reason why this happens is that when you attach lldb, the process is halted. If you send lldb the continue command, the CPU usage should go back to where it was before.

            The thing that could be the culprit is:
            thread #27: tid = 0x68743, 0x000000010239fbf2 mysqld`fil_space_get_by_id(unsigned long) + 30
            frame #0: 0x000000010239fbf2 mysqld`fil_space_get_by_id(unsigned long) + 30
            frame #1: 0x00000001023aff89 mysqld`fil_space_get_crypt_data(unsigned long) + 247
            frame #2: 0x00000001023b3590 mysqld`fil_crypt_find_space_to_rotate(key_state_t*, rotate_thread_t*, bool*) + 1583
            frame #3: 0x00000001023b473e mysqld`fil_crypt_thread + 763
            frame #4: 0x00007fff81ef499d libsystem_pthread.dylib`_pthread_body + 131
            frame #5: 0x00007fff81ef491a libsystem_pthread.dylib`_pthread_start + 168
            frame #6: 0x00007fff81ef2351 libsystem_pthread.dylib`thread_start + 13

            This seems to be the thread that is actually performing some work.

            cvicentiu Vicențiu Ciorbaru added a comment - The CPU usage makes sense. The reason why this happens is that when you attach lldb, the process is halted. If you send lldb the continue command, the CPU usage should go back to where it was before. The thing that could be the culprit is: thread #27: tid = 0x68743, 0x000000010239fbf2 mysqld`fil_space_get_by_id(unsigned long) + 30 frame #0: 0x000000010239fbf2 mysqld`fil_space_get_by_id(unsigned long) + 30 frame #1: 0x00000001023aff89 mysqld`fil_space_get_crypt_data(unsigned long) + 247 frame #2: 0x00000001023b3590 mysqld`fil_crypt_find_space_to_rotate(key_state_t*, rotate_thread_t*, bool*) + 1583 frame #3: 0x00000001023b473e mysqld`fil_crypt_thread + 763 frame #4: 0x00007fff81ef499d libsystem_pthread.dylib`_pthread_body + 131 frame #5: 0x00007fff81ef491a libsystem_pthread.dylib`_pthread_start + 168 frame #6: 0x00007fff81ef2351 libsystem_pthread.dylib`thread_start + 13 This seems to be the thread that is actually performing some work.

            amykhar, thanks for providing the stack trace.Please also attach your cnf file(s).

            jplindst, since encryption is the main suspect here, could you please take a look?

            elenst Elena Stepanova added a comment - amykhar , thanks for providing the stack trace.Please also attach your cnf file(s). jplindst , since encryption is the main suspect here, could you please take a look?
            amykhar Amy Anuszewski added a comment - - edited

            Enclosed is my my.cnf my.cnf

            (There are no files in my.cnf.d)

            amykhar Amy Anuszewski added a comment - - edited Enclosed is my my.cnf my.cnf (There are no files in my.cnf.d)

            This is not a bug. You have background key rotation enabled i.e. InnoDB background threads (4 in you case) are doing periodically check does one of the tablespaces need a key rotation. You can disable background key rotation either by setting innodb-encryption-rotate-key-age=0, note that this will also disable system tablespace key rotation and here key rotation means also unencrypted to encrypted state change.

            jplindst Jan Lindström (Inactive) added a comment - This is not a bug. You have background key rotation enabled i.e. InnoDB background threads (4 in you case) are doing periodically check does one of the tablespaces need a key rotation. You can disable background key rotation either by setting innodb-encryption-rotate-key-age=0, note that this will also disable system tablespace key rotation and here key rotation means also unencrypted to encrypted state change.

            People

              jplindst Jan Lindström (Inactive)
              amykhar Amy Anuszewski
              Votes:
              0 Vote for this issue
              Watchers:
              7 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.