Rate This Document
Findability
Accuracy
Completeness
Readability

Installation Description

The MySQL thread pool feature is provided in a patch. Apply the patch in the MySQL source code, and then compile and install the MySQL database.

The patch is developed for MySQL 8.0.25. This feature does not conflict with the patch for NUMA scheduling tuning. However, if the thread pool plugin is used, the scheduling tuning for user connection threads in NUMA scheduling tuning becomes invalid.

For details about the environment requirements for using the patch, see MySQL Porting Guide.

  1. Download and decompress the MySQL 8.0.25 source package.
    1
    2
    3
    4
    cd /home
    wget https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-8.0.25.tar.gz --no-check-certificate
    tar -zxvf mysql-boost-8.0.25.tar.gz
    cd mysql-8.0.25
    
  2. Convert the project into a Git repository.
    1
    2
    3
    git init
    git add -A
    git commit -m "init"
    
    • Generally, Git is provided by the system. Configure the Yum source by following instructions in MySQL Porting Guide.
      1
      yum install git
      
    • If the Git submission user information is not configured, configure the user email and user name before running the git commit command.
      1
      2
      git config user.email "123@example.com"
      git config user.name "123"
      
  3. Download the patch file.
    1
    wget https://gitee.com/kunpengcompute/mysql-server/releases/download/KunpengBoostKit22.0.RC2.ThreadPool/code-threadpool-for-MySQL-8.0.25.patch --no-check-certificate
    
  4. Check whether the content is modified.
    1
    git status
    
    The following shows that a 0001-THREAD_POOL_8.patch file is added.
    1
    2
    3
    4
    5
    6
    # On branch master
    # Untracked files:
    #   (use "git add <file>..." to include in what will be committed)
    #
    #       code-threadpool-for-MySQL-8.0.25.patch
    nothing added to commit but untracked files present (use "git add" to track)
    
  5. Check whether the patch file conflicts with the MySQL source code.
    1
    git apply --check code-threadpool-for-MySQL-8.0.25.patch
    

    If no error is reported, the patch can be applied.

  6. Apply the patch file.
    1
    git apply --whitespace=nowarn code-threadpool-for-MySQL-8.0.25.patch
    

    The following information is displayed. Warning information can be ignored. If no error information is displayed, the patch is successfully installed.

    After the patch takes effect, the thread_pool directory is generated in plugin/. The thread_pool directory contains the threadpool_unix.cc, threadpool_common.cc, threadpool.h and threadpool_unix.h files.

    After the patch is applied, you can create, compile, and install MySQL. For details, see MySQL Porting Guide.