Poor Concurrent Query Performance in the mysqlslap Test When the Debug Mode Is Enabled During MySQL Compilation
Symptom
Test environment: Kunpeng server, NeoKylin 7.6, and mysql-boost-5.7.21.tar.gz downloaded from the official website.
After MySQL is installed, mysqlslap is used to test the performance of concurrent queries. The test result does not meet expectations.
Key Process and Cause Analysis
The DWITH_DEBUG=1 option is added to the cmake command, and the debug mode is used.
cmake -DBUILD_CONFIG=mysql_release -DCMAKE_INSTALL_PREFIX=/data1/xk/mysql_3306 -DMYSQL_TCP_PORT=3306 -DWITH_DEBUG=1 -DWITH_BOOST=../boost/ ..
After comparison, it is found that the performance varies greatly after the debug mode is disabled. The test result in release mode is normal.
Conclusion and Solution
Delete DWITH_DEBUG=1 from the cmake command and use the release mode for the test. Run the following cmake command:
cmake -DBUILD_CONFIG=mysql_release -DCMAKE_INSTALL_PREFIX=/data1/xk/mysql_3306 -DMYSQL_TCP_PORT=3306 -DWITH_BOOST=../boost/ ..
Parent topic: MySQL