Benchmarks can be said to be the only convenient way to learn what happens to a system under a given workload. The importance of benchmarking is visible, and before we design benchmarks, we need to look at common errors in benchmark tests to prevent ourselves from making these mistakes in our tests.
Common errors in database benchmark tests:
- Use a subset of real data instead of a complete collection: for instance, applications need to process 100G of data, but only 1G when testing, or just use current data to test, but want to simulate the future of a large increase in business situation.
- Using the wrong data distribution: for example, using evenly distributed data testing, while system real data has many hot spots (randomly generated test data usually cannot simulate real data distribution)
- Use an unreal distribution parameter: For example, assume that all users ' personal information will be read evenly.
- In multi-user scenarios, only single-user testing is done.
- Test distributed applications on a single server.
- Does not match the real user behavior. For example, "Think Time" in a Web page. When a real user requests to a page, they will read for a period of time instead of pausing one by one click on the relevant link.
- Executes the same query repeatedly. Real queries are different, which can lead to a decrease in cache hit ratios. Repeated execution of the same query, to some extent, results in all or part of the cache.
- No check errors: If the results of the test are not properly explained, such as a query that should be slow suddenly becomes faster, you should check for errors. Otherwise, it might just test the speed at which MySQL detects syntax errors. After the benchmark test is complete, be sure to check the error log, which should be the basic requirement.
- The process of system preheating (warm up) is ignored. For example, the system restarts immediately after the test. Sometimes it is necessary to understand how long it takes for the system to be restarted to achieve normal performance capacity, and to pay special attention to the length of preheating. Conversely, if you want to analyze the normal performance, it should be noted that if the benchmark test starts immediately after the restart, then the cache is cold, there is no data, even if the pressure of the test is the same, the result is different from the cache has been filled with data.
- Use the default server configuration
- The test time is too short. Benchmarks need to last for some time.
Errors that should be avoided in a database baseline test