Workload management has three clearly defined stages: identification
of the work entering the data server, management of the work when
it is running, and monitoring to ensure that the data server is being
used efficiently.
A number of aspects must be considered for successful
workload management with DB2® workload
manager, starting with understanding your goals. In the grocery store
example described in Introduction to DB2 workload manager concepts, goals might
include maximizing customer spending, minimizing shoplifting, and
ensuring that customers leave the store satisfied so that they will
return again.
In a data server environment, you must also define goals. Sometimes
the goals are clear, especially when they originate from service level
agreement (SLA) objectives. For example, queries from a particular
application can consume no more than 10% of the total processor resource.
Goals can also be tied to a particular time of day. For example, an
overnight batch utility might have to complete loading data by 8 a.m.
so that the daily sales reports are on time. In other situations,
the goals can be difficult to quantify. A goal might be to keep the
database users satisfied and to prevent aberrant database activity
from hampering their day-to-day work. Whether the goals are quantifiable
or not, understanding them is critical when considering the following
stages of workload management:
- Identification
- If you want to achieve a goal for some kind of work, you first
must be able to identify details about the work. In the grocery store,
you can identify shopper information through credit cards and debit
cards, or an unpaid-for item through an active security tag on the
item. For the data server, you need to decide how you want to identify
the work that enters the system. You can use the name of the application
that submits the work, the authorization ID that submits the work,
or a combination of elements that provide some form of identification.
- Management
- The management phase includes mechanisms for making steady progress
towards your goal, and actions to take if a goal is not being met.
An example of a mechanism is managing price checks in fast checkout
lanes. Fast checkout lanes should result in faster throughput and
satisfied customers, but if a carton of milk has the wrong price and
a price check is required, the fast checkout lane could slow down.
The problem is managed by performing a fast price check, possibly
opening up another checkout lane, and trying to fix the pricing problem
so that it does not occur again. On the data server, you might find
that overall performance is suffering when a few poorly written SQL
statements are running, a surge in volume occurs during peak times,
or there is too much competition between different applications for
the same resources. The management phase includes mechanisms for assigning
resources to achieve your goals, and actions to take if a goal is
not being met.
- Monitoring
- Monitoring is important for a couple of reasons. First, to determine
whether you are achieving a goal, you must have a mechanism to track
progress toward that goal. Also, monitoring helps to identify the
problems that might be preventing you from achieving your goal. In
a store, the store manager can watch the flow of customers, automatically
be alerted to problems such as shoplifting or dangerously low inventory
of a particular sale item, or perform analysis on historical purchase
patterns to determine optimal product placement in the store. For
a data server, there are often explicit goals for response times of
database activities and it is important to have a way to measure this
metric, and watch for trends.
The following figure represents the workload management stages:
Figure 1. Stages of workload management