Sysbench 1.0
Before the compilation and installation, modify the sysbench.c code to avoid initialization timeout in high concurrency scenarios.
- Modify the sysbench.c file.
You can modify the sysbench.c code to solve the initialization timeout problem when 512 concurrent threads are used in the mix scenario. The error information is as follows:
1FATAL: Worker threads failed to initialize within 30 seconds!
To be specific, change the default value of 30 seconds to 300 seconds or another required value.
- Open the sysbench.c file.
1vi /home/sysbench-1.0/src/sysbench.c - Find #define THREAD_INIT_TIMEOUT 30 in line 86 and change 30 to 300 or another required value.
1#define THREAD_INIT_TIMEOUT 300 - Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the sysbench.c file.
- Go to the directory where the Sysbench source code is located.
1cd /home/sysbench-1.0
- Perform compilation and installation.
1 2 3 4
./autogen.sh ./configure make -j128 make -j128 install
The number following -j indicates the number of CPU cores needed for parallel compilation. The value must be less than or equal to the number of CPU cores. You can run the following command to view the number of CPU cores:
1cat /proc/cpuinfo | grep processor | wc -l
- View the Sysbench version.
1sysbench --versionExpected result:
1sysbench 1.0.20
Parent topic: Performing Compilation and Installation