start page | rating of books | rating of authors | reviews | copyrights

Book HomeManaging and Using MySQLSearch this book

Chapter 5. Performance Tuning

Contents:

An Approach to Performance Tuning
Application Tuning
Database Server Tuning
Operating System/Hardware 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 Tuning

When performance tuning a MySQL application, there are five main things to consider:

  1. Application tuning

  2. SQL query tuning

  3. Database server tuning

  4. Operating system

  5. Hardware

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.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.