Java Reference
In-Depth Information
workloads going smoothly. In our McDonald's example, I've often wondered
if each restaurant could start a single line for the terminally slow, for the cus-
tomers who pay for 27 Big Macs with a shoebox full of pennies. That's proba-
bly not enforceable, but supermarkets do essentially the same thing, in reverse.
Because the majority of the work consists of longer transactions, supermarkets
offer express lanes for short transactions. These lines limit the number of items
per customer and may limit the form of payment. This arrangement makes the
workloads for the various queues much more predictable.
We can simulate the express lane in our systems by dedicating servers to
workloads of similar sizes. The key is to isolate long-running transactions to a
subset of the servers. If a specialized long-duration-transaction server is idle, it
can then take on short transactions, just like in the supermarket. The reverse is
not true, because the long-duration transactions can adversely affect our
overall balance. Figure 10.6 shows our workloads with Q1 functioning as a
specialized server for long transactions.
Figure 10.6
A dedicated server (Q1 here) for longer tasks can smooth out the
workload and ensure that a single odd task cannot throw the entire
system out of kilter.
Q 1
Q 2
Q 3
Q 4
Partitioning jobs
Another possible solution to the distribution problem is to break larger jobs
into smaller ones. In many cases, it makes sense to break huge user interfaces
down for other reasons. A well-known trick that Disney uses is hiding the line .
The customers for a popular ride enter a short line to a building with lots of
displays of interesting things, which again goes outside into a garden, which
then enters another building with actors talking about the ride experience
itself. The larger line is broken into many smaller ones. The authors of the
most effective surveys also hide the length of the survey by breaking it into
smaller chunks and branching conditionally. A “yes” answer to “Did you buy
model 4045A ?” could lead to more questions about that model. We can do the
Search WWH ::

Custom Search