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

Userstat Plugin CPU_TIME much higher than BUSY_TIME in versions 10.11.X and beyond

    XMLWordPrintable

Details

    • Bug
    • Status: In Testing (View Workflow)
    • Major
    • Resolution: Unresolved
    • 11.4.1, 10.11.10, 11.4.5, 10.11.12, 10.11.13, 10.11.14
    • 10.11, 11.4, 11.8
    • Plugin - userstat
    • None
    • Almalinux 8, Debian 11

    Description

      Hello,

      We are using the userstat plugin to track users mysql cpu minutes. Since upgrading from MariaDB 10.6 to 10.11, we noticed increased CPU_TIME in the information_schema.user_statistics table. The CPU_TIME column reads as much as 10 times higher than BUSY_TIME.
      In versions 10.6 and below, BUSY_TIME always used to be slighly higher than CPU_TIME, which I think is the expected behaviour:

      https://mariadb.com/docs/server/server-management/variables-and-modes/server-status-variables#cpu_time

      "Busy_time
      Description: Cumulative time in seconds of activity on connections. Part of User Statistics. Requires the userstat system variable to be set in order to be recorded.
      Scope: Global
      Data Type: numeric

      Description: Total CPU time used. Part of User Statistics. Requires the userstat system variable to be set in order to be recorded.
      Scope: Global, Session
      Data Type: numeric

      I have confirmed this on multiple environments and setups, including Almalinux 8 and Debian 11. The results are always the same, regardless of the configuration in use. I'm using this simple query to test:

      MariaDB [(none)]> SELECT BENCHMARK(50000000, MD5('cpu_test'));
      +--------------------------------------+
      | BENCHMARK(50000000, MD5('cpu_test')) |
      +--------------------------------------+
      |                                    0 |
      +--------------------------------------+
      1 row in set (11.693 sec)
      

      In the example above, the query finished for 11.693 seconds. However, the recorded CPU_TIME for this query is 116.220914, while BUSY_TIME is 11.693639.

      I couldn't find anything related in the changelog, nor in the documentation.

      Attachments

        Activity

          People

            serg Sergei Golubchik
            btodorov Borislav Iliev Todorov
            Votes:
            4 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.