Databases Reference
In-Depth Information
CHAPTER 2
Benchmarking MySQL
Benchmarking is an essential skill for MySQL novices and power users alike. A bench-
mark, simply put, is a workload designed to stress your system. The usual goal is to
learn about the system's behavior, but there are other worthwhile reasons for running
benchmarks, such as reproducing a desired system state or burning in new hardware.
In this chapter we'll explore reasons, strategies, tactics, and tools for benchmarking
MySQL and MySQL-based applications. We'll focus especially on sysbench , because
it's an excellent tool for MySQL benchmarking.
Why Benchmark?
Why is benchmarking so important? It's because benchmarking is uniquely convenient
and effective for studying what happens when you give systems work to do. A bench-
mark can help you observe the system's behavior under load, determine the system's
capacity, learn which changes are important, or see how your application performs
with different data. Benchmarking lets you create fictional circumstances, beyond the
real conditions you can observe. You can do these things and more with benchmarks:
• Validate your assumptions about the system, and see whether your assumptions
are realistic.
• Reproduce a bad behavior you're trying to eliminate in the system.
• Measure how your application currently performs. If you don't know how fast it
currently runs, you can't be sure any changes you make are helpful. You can also
use historical benchmark results to diagnose problems you didn't foresee.
• Simulate a higher load than your production systems handle, to identify the scal-
ability bottleneck that you'll encounter first with growth.
• Plan for growth. Benchmarks can help you estimate how much hardware, network
capacity, and other resources you'll need for your projected future load. This can
help reduce risk during upgrades or major application changes.
 
Search WWH ::




Custom Search