Chapter 5. Performance TuningContents:
An Approach to Performance Tuning MySQL is known for its speed. A number of factors out of MySQL's control, however, can impact application and database performance. Application architects control some of these factors, but database administrators control others. In this chapter, we will introduce you to some of the principles of performance tuning and discuss some of the tools you have at your disposal. The key to good database performance is solid application and database design. Performance tuning cannot make up for poor design because it is too late in the application development process. Chapter 7 covers the elements of good database design. This chapter handles those things you can do after an application is deployed to help the system run its fastest. 5.1. An Approach to Performance TuningWhen performance tuning a MySQL application, there are five main things to consider:
These are ranked in terms of "bang for the buck." For example, adding memory or upgrading your processor will usually improve the performance of your applications, but you should be able to achieve greater gains for lower cost if you tune your application code and database server first. In addition, any performance tuning on the MySQL server will apply to all applications using that server. Characteristics that are advantageous for one particular application may not improve the performance of another. Based on these factors, as a general methodology, we recommend that you look at tuning issues in the order listed above. Copyright © 2003 O'Reilly & Associates. All rights reserved. |
|