Information Technology Reference
In-Depth Information
vice currently receives, and expected growth rates. All of these factors then guide the
design. This process was described previously in
Section 1.7
.
Once the system is running, performance limits will be discovered. This is where the
design features that enable further scaling come into play.
Whileeveryeffortismadetoforeseepotentialscalingissues,notallofthemcanreceive
engineering attention. The additional design and coding effort that will help deal with fu-
ture potential scaling issues is lower priority than writing code to fix the immediate issues
of the day. Spending too much time preventing scaling problems that may or may not hap-
pen is called
premature optimization
and should be avoided.
5.1.1 Identify Bottlenecks
A bottleneck is a point in the system where congestion occurs. It is a point that is resource
starved in a way that limits performance. Every system has a bottleneck. If a system is un-
derperforming, the bottleneck can be fixed to permit the system to perform better. If the
system is performing well, knowing the location of the bottleneck can be useful because it
enables us to predict and prevent future problems. In this case the bottleneck can be found
by generating additional load, possibly in a test environment, to see at which point per-
formance suffers.
Deciding what to scale is a matter of finding the bottleneck in the system and elimin-
ating it. The bottleneck is where a backlog of work accumulates. Optimizations done to
theprocessupstreamofthebottlenecksimplymakethebackloggrowfaster.Optimizations
made downstream of the bottleneck may improve the efficiency of that part but do not im-
provethe total throughput ofthe system. Therefore anyeffortnotspent focused onthe bot-
tleneck is wasteful.
5.1.2 Reengineer Components
Some scaling issues can be resolved through adjustments to the current system. For ex-
ample,enlargingacachemightbeassimpleasadjustingaconfigurationfile.Otherscaling
issues require engineering effort.
Rewriting parts of a system is called
reengineering
and is usually done to improve
speed, functionality, or resource consumption. Sometimes reengineering is difficult be-
cause of earlier design decisions that led to particular code or design structures. It is often
best to first replace such code with code that is functionally equivalent but has an internal
organization that makes other reengineering efforts easier to accomplish. Restructuring an
existing body of code—namely, altering its internal structure without changing its external
behavior—is called
refactoring
.
Search WWH ::
Custom Search