|< Day Day Up >|
As the underlying platform upon which your MySQL database resides, it's imperative that your server operating system be as efficient as possible. This section examines ways to perk up the two most popular operating systems for MySQL servers: Linux/Unix and Microsoft Windows. Because discretion is the better part of valor, this book takes no sides and makes no attempt to broker or mediate the religious war between aficionados in each camp. Instead, it assumes that the reader has already made a decision. Actually, it's likely that many readers will be managing both flavors of operating system.
This book assumes that if you are tasked with administering a database server, you are familiar with the operating system specific monitoring and management tools for your environment. For more details on these tools, see Chapter 2, "Performance Monitoring Options." In addition, it's a good idea to use these tools to help first get your computer to a stable, decently performing baseline prior to undertaking some of the MySQL-specific alterations described in this chapter.
In keeping with their commitment to open source solutions, many MySQL administrators have chosen to deploy their database servers on one of the many available flavors of the Linux operating system. Other administrators have instead opted for the Unix operating system.
Regardless of your choice of operating system, a number of variables are under your control that can help improve MySQL's performance on your platform. This section reviews these options, with the assumption that you do not want to make major kernel modifications. If you are inclined to embark on that path, check the MySQL website for a list of platform-specific kernel alterations.
Upgrading to a Recent Kernel
On Linux systems, MySQL relies on a number of key kernel features found in more recent versions. In the absence of these capabilities, your performance might be adversely affected. These kernel enhancements include the following:
If at all possible, it is wise to upgrade your kernel to at least version 2.4.
Disabling Unnecessary Services
In their understandable rush to move from operating system installation to production, many administrators choose default packages and values for their Linux or Unix platforms. Unfortunately, any time saved during installation is paid back with interest after the server goes live: Many unnecessary software packages have been installed, and numerous extraneous processes are now a permanent part of the server landscape.
These processes represent a perpetual tax on server response because administrators are often reluctant to break a working system to remove a potentially unneeded component. Consequently, think carefully before installing any of the following server packages or processes on your platform:
This list is far from comprehensive; there are loads of other candidates for elimination from your server. Take the time to excise them from the picture before going live.
Although Linux is often the first operating system that comes to mind when you think of a MySQL-based server, in fact Windows-based platforms represent a significant percentage of MySQL's installed base.
This section surveys a collection of tips that can help remove performance bottlenecks from any MySQL server hosted in a Windows environment.
Running the Right MySQL Server Process
In older (prior to version 4.1) releases of MySQL, Windows administrators had to take care to choose the correct server process for optimal MySQL performance. Things have been made simpler in more recent versions. Table 14.1 provides a list of factors to help you decide which version of the MySQL server process to launch.
Choosing the Right Operating System
Over time, Microsoft has released many variations of the Windows operating system. Some of these varieties are more appropriate than others for a relational database server such as MySQL. Whether you are purchasing and configuring a new computer, or repurposing an existing machine, try to select a Microsoft operating system designed to run as a server.
Microsoft also issues frequent Windows updates, often designed to address bugs, security gaps, and so on. After your server has been deployed, it's important to keep track of these patches.
Disabling Extraneous Services
When you install Windows, you are provided with many choices about what operating system components to enable. It's natural for a harried administrator to elect to install everything, rather than taking the time to carefully evaluate each option, just like their Linux-and Unix-administering peers. This can lead to a computer loaded with automatically launched services that add no value to a MySQL database, yet drain memory and CPU resources.
For example, look at the following small subset of available Windows services, and think if any of them would add any value to your database server:
It's not an exaggeration to state that the preceding list of five services represents a tiny proportion of all of the potentially unnecessary Windows services. This can be especially dramatic if you have pressed a previously configured computer into service for MySQL: There might be dozens of unnecessary software packages and services already installed and running.
Watching Out for Spyware
In an ideal world, your Windows-based MySQL database server will run on its own pristine, dedicated machine, free from the distractions of other chores and activities. Unfortunately, in the real world, MySQL databases are often resident on machines that play many roles, not only that of a database server. The real world also sees rampant infestation of Windows-based computers with performance and privacy-damaging spyware.
If your database server computer is used for any web browsing at all, or if a user (perhaps you?) might have downloaded software from other sources, it's worth the time and effort to run one of the many free or commercially available utilities to check for spyware.
|< Day Day Up >|