Rate This Document
Findability
Accuracy
Completeness
Readability

Installation Description

  • The MySQL pluggable 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, 8.0.30, and 8.0.35. This feature does not conflict with the patch for MySQL NUMA scheduling tuning. However, if the thread pool plugin is used, the scheduling tuning for user connection threads in MySQL NUMA scheduling tuning becomes invalid.
  • MySQL 8.0.25, 8.0.30, and 8.0.35 support the pluggable thread pool plugin that can be dynamically loaded.
  • The thread pool feature requires that the numactl library be installed in the compilation environment. If the library is not installed, run the yum install -y numactl numactl-devel* command to install it. If the numactl library is not installed during MySQL compilation, the message "undefined symbol: numa_xxxxx" is displayed when the MySQL program that is not loaded with the numa library installs the .so file of the thread pool patch.
  • The MySQL pluggable thread pool feature requires that the CMake version be later than 3.7.
  1. Download the MySQL source code of the target version, upload it to the /home directory on the server and decompress it, and then go to the root directory of the MySQL source code.

    For the download link of the MySQL source code, see Table 2.

    For MySQL 8.0.25, run the following commands:

    1
    2
    3
    cd /home
    tar -zxvf mysql-boost-8.0.25.tar.gz
    cd mysql-8.0.25
    

    For MySQL 8.0.30, run the following commands:

    1
    2
    3
    cd /home
    tar -zxvf mysql-boost-8.0.30.tar.gz
    cd mysql-8.0.30
    

    For MySQL 8.0.35, run the following commands:

    1
    2
    3
    cd /home
    tar -zxvf mysql-boost-8.0.35.tar.gz
    cd mysql-8.0.35
    

    You can also run the following commands to download the MySQL source code.

    For MySQL 8.0.25:

    1
    2
    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
    

    For MySQL 8.0.30:

    1
    2
    wget https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-8.0.30.tar.gz --no-check-certificate
    tar -zxvf mysql-boost-8.0.30.tar.gz
    

    For MySQL 8.0.35:

    1
    2
    wget https://cdn.mysql.com/archives/mysql-8.0/mysql-boost-8.0.35.tar.gz --no-check-certificate
    tar -zxvf mysql-boost-8.0.35.tar.gz
    
  2. In the root directory of the source code, run the git init command to create Git management information.
    1
    2
    3
    git init
    git add -A
    git commit -m "Initial commit"
    
    • Generally, Git is provided by the system. If not, configure the Yum source by following instructions in MySQL Porting Guide and then install Git.
      1
      yum install git
      
    • If the Git commit 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 MySQL thread pool feature patch and upload it to the root directory of the MySQL source code. This patch applies to MySQL 8.0.25, 8.0.30, and 8.0.35.

    You can also run the following command to download the MySQL thread pool feature patch:

    1
    wget https://gitee.com/kunpengcompute/mysql-server/releases/download/KunpengBoostKit23.0.RC4.ThreadPool/code-threadpool-for-MySQL-8.0.patch --no-check-certificate
    
  4. Check whether the content is modified.
    1
    git status
    
    The following shows that a code-threadpool-for-MySQL-8.0.patch file is added.
    1
    2
    3
    4
    5
    6
    7
    [root@localhost mysql-8.0.25]# git status
    On branch master
    Untracked files:
      (use "git add <file>..." to include in what will be committed)
            code-threadpool-for-MySQL-8.0.patch
    
    nothing added to commit but untracked files present (use "git add" to track)
    
  5. Apply the patch file.
    1
    2
    git apply --check code-threadpool-for-MySQL-8.0.patch
    git apply --whitespace=nowarn code-threadpool-for-MySQL-8.0.patch
    
  6. After the patch file is successfully applied, you can check the new thread_pool directory and the new source code file in the mysql-8.0.25, mysql-8.0.30, or mysql-8.0.35 directory.
    1
    ll ./plugin/thread_pool/
    

    Expected result:

  7. Compile and install the MySQL source code. For details, see MySQL Porting Guide.