10.07.2015 Views

The Definitive Guide to SQL Server Performance Optimization

The Definitive Guide to SQL Server Performance Optimization

The Definitive Guide to SQL Server Performance Optimization

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 1<strong>The</strong>re are two methods for scaling, or growing, a solution. <strong>The</strong> first method is the one we tend <strong>to</strong>think of first—buy bigger hardware. This technique is called scaling up, because it simply meansupgrading your existing hardware <strong>to</strong> support more capacity. <strong>SQL</strong> <strong>Server</strong> works well in scale-upsituations, but scaling up has an upper limit. Most servers are built <strong>to</strong> accommodate only acertain number of processors, a certain amount of memory, and so forth. After you’ve scaled upas far as you can go, you’re stuck. Even if you’re willing <strong>to</strong> buy brand-new hardware fromscratch, scaling up will only take you so far because you can only buy so big of a server at anygiven time.<strong>The</strong> other method of scaling is scaling out (adding more servers <strong>to</strong> the solution). Each new serverperforms the same tasks as the original server. Web farms are the classic example of scale-outarchitecture, in which you simply keep adding Web servers (all hosting the same content) untilyou’ve got enough of them <strong>to</strong> handle the number of users attempting <strong>to</strong> reach your Web site.Contrary <strong>to</strong> popular belief, <strong>SQL</strong> <strong>Server</strong> can scale out, although doing so is definitely much moredifficult than scaling out a Web farm. In <strong>SQL</strong> <strong>Server</strong>, scaling out means using federateddatabases, replication, linked servers, and other techniques that allow multiple <strong>SQL</strong> <strong>Server</strong>computers <strong>to</strong> look like a single server, even if they’re not hosting identical copies of thedatabase. Chapter 6 focuses on scaling <strong>SQL</strong> <strong>Server</strong> and includes an explanation of federated databases,distributed databases, replication, linked servers, and much more.Scaling can sometimes be the easiest solution <strong>to</strong> performance problems. If your current <strong>SQL</strong><strong>Server</strong> system can’t handle your workload, either upgrade it (scale up) or add another one (scaleout) <strong>to</strong> help handle the load. Scaling doesn’t require any fancy query tuning, complexperformance-troubleshooting procedures, or any of that stuff. Unfortunately, scaling—especiallywith <strong>SQL</strong> <strong>Server</strong>—is almost always expensive because it involves buying more server hardware.In the case of <strong>SQL</strong> <strong>Server</strong>, scaling out can also mean a lot of additional administrative overhead,as you’re adding more <strong>SQL</strong> <strong>Server</strong> computers that you’ll have <strong>to</strong> maintain and troubleshoot. Soalthough scaling is often the easiest solution <strong>to</strong> performance problems, it isn’t always the bestsolution. <strong>The</strong> best solution is often <strong>to</strong> make more efficient use of the hardware you’ve got, whichmeans digging in and fine-tuning everything. Fortunately, that’s what the rest of this book is allabout!Holistic <strong>Performance</strong>Always remember <strong>to</strong> look at the big picture when it comes <strong>to</strong> performance. Many administra<strong>to</strong>rsfall in<strong>to</strong> what I call the performance trap—looking for the one little detail that, once fixed, willnoticeably improve performance every time. Other folks call it the magic bullet, which, whenfired, will kill your performance problems. Unfortunately, there is no such thing. Modern serversare systems, which means they consist of several interlocking subsystems that all work <strong>to</strong>gether.Changing one subsystem might simply shift a performance problem <strong>to</strong> another subsystem. <strong>SQL</strong><strong>Server</strong> is a system, <strong>to</strong>o, with memory caches, a query optimizer, database statistics, and muchmore. <strong>SQL</strong> <strong>Server</strong> interacts closely with both the Windows OS and your server hardware, sochanging any particular performance component is bound <strong>to</strong> have an effect somewhere else.19

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!