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

--autoset-thread-cache-size doesn't work

Details

    Description

      The documentation says that the thread_cache_size system variable supports auto-sizing in MariaDB 10.2 and later, and that auto-sizing is the default:

      From MariaDB 10.2.0, the default is automatically set to the smaller of either 256, or the max_connections size.
      

      https://mariadb.com/kb/en/library/server-system-variables/#thread_cache_size

      However, this does not seem to be the case. This system variable does not support AUTO_SET, and the default is 256:

      static Sys_var_ulong Sys_thread_cache_size(
             "thread_cache_size",
             "How many threads we should keep in a cache for reuse. These are freed after 5 minutes of idle time",
             GLOBAL_VAR(thread_cache_size), CMD_LINE(REQUIRED_ARG),
             VALID_RANGE(0, 16384), DEFAULT(256), BLOCK_SIZE(1));
      

      https://github.com/MariaDB/server/blob/mariadb-10.4.6/sql/sys_vars.cc#L3655

      The only time that this system variable appears to be auto-sized is if its configured value is greater than max_connections:

        /* Ensure that some variables are not set higher than needed */
        if (thread_cache_size > max_connections)
          SYSVAR_AUTOSIZE(thread_cache_size, max_connections);
      

      https://github.com/MariaDB/server/blob/mariadb-10.4.6/sql/mysqld.cc#L9013

      Is this a documentation bug, or is the behavior of thread_cache_size incorrect?

      Attachments

        Issue Links

          Activity

            GeoffMontee Geoff Montee (Inactive) created issue -
            GeoffMontee Geoff Montee (Inactive) made changes -
            Field Original Value New Value
            serg Sergei Golubchik made changes -
            serg Sergei Golubchik made changes -
            Affects Version/s 10.2.25 [ 23408 ]
            Affects Version/s 10.3.16 [ 23410 ]
            Affects Version/s 10.4.6 [ 23412 ]
            Issue Type Bug [ 1 ] Task [ 3 ]
            serg Sergei Golubchik made changes -
            Issue Type Task [ 3 ] Bug [ 1 ]
            serg Sergei Golubchik made changes -
            Affects Version/s 10.2 [ 14601 ]
            Affects Version/s 10.3 [ 22126 ]
            Affects Version/s 10.4 [ 22408 ]
            serg Sergei Golubchik made changes -
            Summary Support AUTO_SET for thread_cache_size system variable --autoset-thread-cache-size doesn't work
            serg Sergei Golubchik made changes -
            Assignee Sergei Golubchik [ serg ] Ian Gilfillan [ greenman ]

            Looks like a documentation bug. It didn't do "smaller of either 256, or the max_connections size" even in 10.2.0

            serg Sergei Golubchik added a comment - Looks like a documentation bug. It didn't do "smaller of either 256, or the max_connections size" even in 10.2.0
            serg Sergei Golubchik made changes -
            Fix Version/s N/A [ 14700 ]
            Fix Version/s 10.2 [ 14601 ]
            Fix Version/s 10.3 [ 22126 ]
            Fix Version/s 10.4 [ 22408 ]
            greenman Ian Gilfillan made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]
            serg Sergei Golubchik made changes -
            Workflow MariaDB v3 [ 97824 ] MariaDB v4 [ 156411 ]

            People

              greenman Ian Gilfillan
              GeoffMontee Geoff Montee (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.