Huawei Cloud Yaoyun Server L Instance Evaluation | Stress Testing of Best Practices for Enterprise Projects (11)

Huawei Cloud Yaoyun Server L instance evaluation | Enterprise project best practice series:

Huawei Cloud Yaoyun Server L Instance Evaluation|Introduction to Cloud Server Best Practices for Enterprise Projects (1)
Huawei Cloud Yaoyun Server L Instance Evaluation|Best Practices for Enterprise Projects Huawei Cloud Introduction (2)
Huawei Cloud Yaoyun Server L Instance Evaluation | Enterprise Project Best Practices Huawei Cloud Yaoyun Server L Instance Introduction (3)
Huawei Cloud Yaoyun Server L Instance Evaluation | Best Practices for Enterprise Projects: Yunyao Cloud Server L Instance Purchase (4)
Huawei Cloud Yaoyun Server L Instance Evaluation | Evaluation of Best Practices for Enterprise Projects Use Case (5)
Huawei Cloud Yaoyun Server L Instance Evaluation|Enterprise Project Best Practice Package Management Tool Installation Software (6)
Huawei Cloud Yaoyun Server L instance evaluation | Enterprise project best practices for docker deployment and application (7)
Huawei Cloud Yaoyun Server L instance evaluation | Enterprise project best practices for private library construction verdaccio (8) a>
Huawei Cloud Yaoyun Server L Instance Evaluation|Enterprise Project Best Practices for Starting the Pet Reservation Project (9)
Huawei Cloud Yaoyun Server L Instance Evaluation|Enterprise Project Best Practice Best Practices of Scheduled Tasks and Queue Queue Practice (10)
Huawei Cloud Yaoyun Server L Instance Evaluation | Best Practices of Enterprise Projects Stress Test (11)
Huawei Cloud Yaoyun Server L instance evaluation | Suggestions and summary of best practices for enterprise projects (12)


12. Cloud server stress test:

For server stress testing, you can choose the tool sysbench, which can simulate concurrent access instances of thousands of threads. As a widely used open source modular, cross-platform, multi-threaded benchmark testing tool, sysbench is mainly used to evaluate the performance of server systems under different load conditions.

Sysbench has the characteristics of ease of use, high flexibility, and powerful functions. It allows us to quickly evaluate the performance of the system and discover potential bottlenecks and optimization plans, whether it is CPU, disk IO, or even access database stress testing. Simulate the use of various SQL statements, simulate various transaction submissions, and simulate hundreds of thousands of TPS to stress test the database.


1. What is sysbench?

sysbench is a modular, cross-platform, multi-threaded benchmark testing tool. It is mainly used to evaluate and test the database load under various system parameters. It mainly includes the following benchmark tests:

serial number index Index value
1 CPU performance Find the largest prime number in the range {the shorter the time, the better}
2 Disk IO performance IOPS in different scenarios {the bigger, the better}
3 Scheduler performance IOPS in different scenarios {the bigger, the better}
4 Memory allocation and transfer speed Transfer a certain amount of data throughput size in different block sizes {bigger is better}
5 POSIX thread performance Threads execute concurrently, and the time it takes to respond to the semaphore in a loop {the less, the better}
6 Database Performance (OLTP Benchmark) The time it takes for concurrent threads to apply for mutex locks at the same time and cycle a certain number of times {the less, the better}

2. Install sysbench:

# 安装sysbench
sudo apt-get install sysbench -y
# 查看sysbench版本
sysbench --version

Insert image description here

3. Test and compare the machine:

The following is the same 2-core 2G cloud server configuration of a domestic cloud. The following test is to compare the CPU, disk IO, memory and other indicators with the same configuration of Huawei Cloud Server L instance.

Insert image description here

Huawei Cloud Yao Cloud Server L instance server configuration information:


4. CPU benchmark test:

4.1 Test instructions:

  • There are usually two types of CPU performance tests, namely calculating prime numbers and calculating pi.
  • sysbench is a test that uses the addition of prime numbers. Just run the CPU test directly.

4.2 Test command:

sysbench --num-threads=12 --max-requests=10000 --debug=on --test=cpu --cpu-max-prime=20000 run

Parameter analysis

serial number parameter illustrate
1 num-thread Number of test threads to create, default is 1
2 max-requests The maximum number of requests, the default is 10000, 0 means no limit
3 debug Whether to display more debugging information, the default is off
4 test Specify test project name
5 cpu-max-prime Maximum number of prime number generators, default is 10000

4.3 Comparison of test results:

Insert image description here

Insert image description here


5. Thread benchmark test:

5.1 Test instructions:

Tests the performance of thread scheduling and is used for thread performance testing under high load.

5.2 Test command:

sysbench --num-threads=12 --max-requests=10000 --test=threads --thread-yields=100 --thread-locks=2 run

Parameter analysis

serial number parameter illustrate
1 num-thread Number of test threads to create, default is 1
2 max-requests The maximum number of requests, the default is 10000, 0 means no limit
3 debug Whether to display more debugging information, the default is off
4 test Specify test project name
5 thread-yields Multiple threads are generated per request, the default is 1000
6 threads-locks The number of locks per thread, the default is 8

5.3 Comparison of test results:

Insert image description here

Insert image description here


6. Memory benchmark test:

6.1 Test instructions:

  • The memory allocation test mainly conducts continuous read and write or random read and write tests of memory for different block sizes.
  • Sequential and random allocation of 8K and 16K can be tested separately.
  • Take 8K sequential allocation as an example.

6.2 Test command:

sysbench --num-threads=12 --max-requests=10000 --test=memory --memory-block-size=8K --memory-total-size=100G --memory-access-mode=seq run

Parameter analysis

serial number parameter illustrate
1 num-thread Number of test threads to create, default is 1
2 max-requests The maximum number of requests, the default is 10000, 0 means no limit
3 debug Whether to display more debugging information, the default is off
4 test Specify test project name
5 memory-block-size When testing, the memory block size
6 memory-total-size Total size of transferred data
7 memory-access-mode Memory access mode (seq, rnd), the default is seq

6.3 Comparison of test results:

Insert image description here

Insert image description here


7. IO benchmark test:

7.1 Test instructions:

  • File IO test is used to test IO load performance.
  • It is necessary to test the IO load performance in 6 modes, taking the random read and write mode as an example.

7.2 Test command:

# 生成测试数据
sysbench --num-threads=12 --max-requests=10000 --test=fileio --file-total-size=3G --file-test-mode=rndrw prepare
# 进行测试
sysbench --num-threads=12 --max-requests=10000 --test=fileio --file-total-size=3G --file-test-mode=rndrw run
# 销毁生成的测试数据
sysbench --num-threads=12 --max-requests=10000 --test=fileio --file-total-size=3G --file-test-mode=rndrw clean

Insert image description here

Parameter analysis

serial number parameter illustrate
1 num-thread Number of test threads to create, default is 1
2 max-requests The maximum number of requests, the default is 10000, 0 means no limit
3 debug Whether to display more debugging information, the default is off
4 test Specify test project name
5 file-total-size total file size
6 file-test-mode File test mode (seqrewr, sequential read and write; seqrd, sequential read; seqwr, sequential write; rndrw, random read and write; rndrd, random read; rndwr, random write)

7.3 Comparison of test results:

Insert image description here

Insert image description here


8. Summary:

  • For memory, random allocation is faster than sequential allocation, and the larger the block allocation, the faster it is.
  • For disks, sequential writing is faster than random writing, sequential reading is slower than random reading, and sequential reading and writing is faster than random reading and writing. For different servers, different reading and writing modes can be considered to improve IO performance.

You can conduct a comparative test through indicators such as CPU, disk IO, memory, etc.Huawei Cloud Server L instance server is indeed slightly better.

Guess you like

Origin blog.csdn.net/wanmeijuhao/article/details/133847613