Beruflich Dokumente
Kultur Dokumente
Report By:
Larry Higa
Lawrence Higa Consulting, Inc.
Overview..........................................................................................................................................................3
Elements of a System Usage Profile................................................................................................................3
Primary Elements of System Usage.............................................................................................................4
1. CPU (ResusageSpma Data) Node Level....................................................................................4
2. Disk I/O (ResusageSpma Data) Node Level..............................................................................6
3. Available Free Memory & Paging/Swapping (ResusageSpma Data) Node Level.................7
4. Number of Concurrent Active Sessions........................................................................................7
Secondary Elements of System Usage.........................................................................................................7
1. CPU (ResusageSvpr Data) Vproc Level....................................................................................8
2. Disk I/O (ResusageSvpr Data) Vproc Level..............................................................................8
3. Bynet I/O (ResusageSpma Data) Node Level..............................................................................8
4. Host I/O (ResusageShst Data) - Vproc Level..............................................................................9
Sample Charts of Typical and Problem Situations.........................................................................................10
1. Parallel Efficiency Average / Max Node CPU Chart.........................................................................10
2. OS as PCT of CPU vs. AVG CPU Busy Chart (OS % CPU Problem)..............................................10
3. OS vs. DBS CPU Busy Chart (Different view of OS % CPU Problem)............................................10
4. Poor Parallel Efficiency Average / Max Node CPU Chart.................................................................10
5. Avg CPU Busy vs. CPU Idle Waiting for I/O Chart...........................................................................11
6. I/O Wait vs. Disk I/Os Chart...............................................................................................................11
7. CPU Idle Waiting for I/O vs. Buddy Backup Bynet I/O Chart...........................................................11
8. Average & Min Free Memory Available vs. Total Page/Swap IOs....................................................11
9. Concurrent Sessions Chart..................................................................................................................11
Overview
The purpose of establishing a system resource usage profile is to obtain a picture in graphic and numerical
format of the usage of a system to help isolate/identify performance problems that may be due to
application changes, new software releases, hardware upgrades, etc. Having a long-term pattern of usage
also enables one to see trends and helps one in doing capacity planning. The pattern or profile of usage can
be seen as a cycle: daily, weekly, monthly, etc., corresponding to the customers business or workload
cycle.
From a performance monitoring / debugging perspective, one is looking for changes in the pattern.
Usually, one is looking for a marked increase in a particular resource. Often times, the system may be at
100% CPU capacity and the users applications are running fine with no complaints. Then something
happens and the users are complaining about response time. The system is at 100% CPU busy, but this is
no different from before. The change could be an increase in the number of concurrent queries in the
system, or it could be an increase the volume of disk I/O or in Bynet broadcast messages. In some cases, a
longer term of several months may be necessary to see a significant change in the pattern. Once a change
in pattern is correlated with a performance problem or degradation, one can eliminate possible causes of the
problem and narrow the search for the basic causes.
A baseline profile should be established when the system is at a semi-steady state. This means data is
loaded, updated on a regular basis (daily, weekly), and accessed by users or by a production application.
The baseline period could be all hours of a day or just the on-line daytime hours when users are running
their queries. For some users, the critical period may be the nighttime load of the data; for others, it could
be a monthly load and report generation over a short 2-5 day period. There are also different levels of data
summarization for the purpose of establishing a baseline profile. At one level, one can maintain the
detailed logging period data. Other levels could be totals by hour or totals by day.
For some users, a profile can be established for a known set of benchmark queries. With benchmark
queries, the common basis for determining if the performance of a new software release is acceptable or not
is if the response time of the queries are nearly the same or better, or if they are considerably slower. In
situations where the system is running slower, the baseline profile will provide a contrast in the system
resource usage between the different instances of running the benchmark.
DBC.ResusageSpma
DBC.ResusageSvpr
DBC.ResusageSvpr2
DBC.ResusageShst
DBC.Diskspace
DBC.AccessLog
DBC.Ampusage
In general, the bulk of the system usage profile comes from the Resusage tables in which data is recorded
on a periodic basis, usually every 10 minutes. Established Resusage macros are used to extract data and
automatically charted with an Excel program. For data from other tables, separate procedures need to be
established in order to get data periodically.
The data in a profile can be grouped as primary and secondary elements. The primary elements are the
more important ones that will generally give a first level indication of a performance problem. For
example, the system may be a 100% CPU bottleneck utilization where normal may be at 80% or lower, or
the system is at maximum disk I/O capacity compared to a normal of 50%. Another common situation is
the number of concurrent queries (tasks) in the system. Normal my have been 10 to 15 concurrent queries
and a performance problem is occurring when there are 50 to 60 concurrent queries.
Secondary elements are useful for a more detailed analysis. In such situations, several factors may be
necessary to get a proper interpretation of what is affecting performance.
When establishing a baseline profile, one must first gather and chart the data. Then, one needs to describe
what one sees in the charts. The following sections contain a description of the individual elements that
make up a profile and what one generally can see / interpret from the different elements.
CPU busy
Disk I/O activity
Concurrent active sessions
OS as Pct of CPU
Percent of CPU busy time that the system was executing operating system work as opposed to database
work. The formula for calculating this column is CPU time for the operating system divided by the
sum of the CPU time for both the user and the operating system. This column does not represent the
percent of absolute time that the system was spending in the operating system.
The lower the value of this column means the CPUs are spending more time executing DBMS code.
Conditions where this column goes below 20% are large product joins, duplicate row checks, collect
statistics, SQL statements doing aggregation on lots of data columns, SQL statements with a lot of
numeric expressions or use of SQL functions such as INDEX, SUBSTR, etc. Often times, when this
number goes below 20% for lengthy periods of time and the maximum CPU busy is around
100%, it is an indication of a duplicate row check problem or a very large product join.
Duplicate row check problems can be resolved by changing the physical data model of the table. The
change could be modifying the primary index, adding a unique secondary index or changing the table
from a SET table to a MULTISET table2. For large product joins, this usually can be corrected by
collecting statistics on the join columns of the tables involved in the joins.
I/O Wait %
This is the most misunderstood column of all the Resusage columns. I/O Wait % is the percent of time
the system is waiting for completion of disk or Bynet I/O, and there are no other tasks available to run
in the system. It does not necessarily mean the system is at I/O throughput capacity.
The more common cause of the I/O Wait is the database software (user queries) has requested a disk
read and there is a lack of concurrent tasks running in the system. For example, if there is a single job
running in the system, when the tasks finishes processing a data block and requests another data block,
the system may have to do a physical I/O to get the data block. At this point, the system will initiate a
physical I/O and schedule another task for execution. As long there is another task to run, the CPU
will not be idle even though there is a pending I/O completion. When there are no other tasks to run,
the system will record that a CPU is idle and waiting for an I/O completion.
Similarly, some disk writes can occur asynchronously, in which case the writing task continues without
waiting for I/O completion. When disk writes are for table data modifications that were not sent to the
another node for buddy backup logic, the task must wait for completion of the physical disk I/O.
I/O Waits can occur when there is a lot of Bynet Buddy backup activity. The task in the sending node
must wait for acknowledgement from the receiving node that it received the buddy backup data before
2
Duplicate row checks can happen inadvertently when the user neglects to define a primary index. In this
case, by default, the first column of the table becomes the primary index. In an extreme case, the data for
this column has only a single distinct value, which will result in a factor of (n2/2)duplicaterowchecks
(wherenisthenumberofrowsinthetable).
5
the task in the sending node can continue its processing. Because the receiving node can be busy for a
number of different reasons, there is no Bynet threshold number to indicate that the buddy backup
traffic over the Bynet is the bottleneck. In general, one can get an indication if this is the bottleneck by
charting the I/O Wait column with the buddy backup column (in the ResNet macros).
The most common situation is that there simply are not enough concurrent tasks running in the system.
A true disk I/O bottleneck occurs when the disk subsystem is transferring data at its maximum
throughput capacity. Depending on the I/O hardware and configuration, I/O bottlenecks generally do
not occur until the nodes are doing over 1400 I/Os per second, or transferring at least 70-80 MB/sec.
There are no known cases of Bynet bottleneck. The speed of the Bynet is significantly faster than the
rate that the nodes can provide data for transferring over the Bynet.
On TNT systems, I/O Waits are not detected and zero is recorded for this column.
CPU profile summary. The key interpretations of the CPU profiles are:
CPU is at maximum CPU busy capacity (100%) for most (much/high proportion) of the critical
period (day shift, end of month processing, all the time, etc.).
Another interpretation could be: the system averages 60% (an arbitrary percent less than 100%)
and is almost never at 100% busy., i.e., there is meaningful CPU capacity available to do more
work.
There is significant node CPU skewing for a number of periods during the critical time periods.
Or, there is occasional skewing, but only for brief periods of time. None are large enough to
cause a significant performance problem.
The OS as percent of CPU is below 20% for over 2 continuous hours. This generally implies an
application problem that should be investigated.
The OS as percent of CPU varies from 10% to 80% without any special pattern. This value is
below 20% only for 10 20 minutes at a time and happens only occasionally during the critical
time periods. This could be due to the applications doing a lot of aggregation, collect statistics or
numerous arithmetic expressions in the queries.
The secondary elements of system usage provide a profile of the system usage, but are not critical for
immediate problem detection. They provide a background for comparison when problems occur to help
identify the kind of changes in system usage that occur at the time of the problem. The secondary elements
include:
CPU busy at the vproc level
Disk I/O by type table data, table data CI, spool, transient journal, permanent journal
Bynet I/O by type buddy backup (complete and partial segments), point to point, broadcast
Host I/O
Logical and Physical Number of disk reads and writes, and Mbytes transferred for
Table data blocks and Table data CIs
Spools blocks and Spool CIs
TJ (Transient Journal) and PJ (Permanent Journal)
For disk management data associated with running out of free disk cylinders, the data to look at are:
Mini-cylinder Packs
Cylinder Defragmentations
In a steady state, table data buddy backup flushes should be approximately the same as for complete
segment backups. This column is generally not important unless there is a specific performance problem
that cannot be understood or explained. Then any discrepancy between the flushes and the complete
segments can point to an internal problem with the system.
Data Read From and Written To a Host (Mainframe channel connect or LAN connect)
Number of I/Os & Mbytes transferred; Also KB per I/O
Chart shows system is at maximum 100% utilization on 10/13, from 23:00 to 10:00 the next
morning. The parallel efficiency at this time is also at 100%, an excellent situation. However,
this does not say anything about efficient use of the system. One needs to check the next chart that
shows OS as Pct of CPU.
On 10/13, from 0:00 to 6:30, there is significant skewing even though the maximum utilization is
less than 40%. This may or may not be a problem.
2. OS as PCT of CPU vs. AVG CPU Busy Chart (OS % CPU Problem)
During the peak CPU utilization, the OS as % of CPU is extremely low for a lengthy period of
time. Below 20% for 11 hours indicates there is an application problem, usually a large number of
duplicate row checks or a very large product join. (This turned out to be a duplicate row check
problem where an Insert into a table was executing and the choice of primary index was a poor
one.)
During the peak period, the sum of OS % busy and DBS % busy add up to 100%. The chart
shows the DBS was executing about 90% busy and the OS was executing only about 10% busy.
The lengthy duration of the DBS executing at such a high % indicates an application problem,
usually a large number of duplicate row checks or a very large product join. (This turned out to be
a duplicate row check problem where an Insert into a table was executing and the choice of
primary index was a poor one.)
On 8/25, from midnight through 7:00, there was extreme skewing where one node was running at
100% and the other nodes averaged as low as 20%. Definitely, this needs to be investigated.
On 8/26, for 2 hours (21:00 and 22:00) and on 8/27 from 1:00 through 7:00, the valley shaped area
shows the max CPU busy a little over 25% with an average around 6%. This is an indication of a
single node (out of 4) running with a single CPU running at 100% busy and all other CPUs in the
node and in other nodes running virtually at 0%. (With one CPU in a node at 100% and the 3
other CPUs at 0%, the overall node CPU average would be 25%. With the one node at 25% and
10
the other nodes at 0, the overall average for all nodes would be 6.25%.) Again, there is a problem
that needs to be investigated.
5. Avg CPU Busy vs. CPU Idle Waiting for I/O Chart
Upper area of chart indicates the CPU was idle waiting of disk or Bynet I/O completion. The I/O
wait could be due to a real disk I/O bottleneck or simply not having enough jobs in the system.
When there are not enough jobs in the system to keep the CPUs busy, the I/O wait could be due to
disk I/O or Bynet buddy backup I/O.
The chart shows high spikes of I/O wait without the corresponding spikes in disk I/Os. (A better
chart would have been to show Mbytes transferred per second.) By and large, the I/O wait is not
due to an I/O throughput bottleneck.
7. CPU Idle Waiting for I/O vs. Buddy Backup Bynet I/O Chart
The chart shows a high correlation between the occurrence of the I/O wait and the Buddy Backup
traffic. This indicates the users workload was doing table updates throughout most of the time
period. However, this does not mean the Buddy Backup was at a throughput bottleneck. The I/O
wait looks more like too few jobs in the system. If the data is available, the number of concurrent
active sessions should also be looked at for this time period.
8. Average & Min Free Memory Available vs. Total Page/Swap IOs
For most of the time, available free memory is over 150 Mbytes. On occasion they drop down so
low that they cause a high number of page/swap I/Os. This looks like a case where the FSG Cache
percent should be raised so as to not leave so much free memory unused. Also, UNIX memory
parameters, LOTSFREE, DESFREE and MINFREE should be raised to reduce the risk of UNIX
panics.
The Concurrent Sessions Chart shows the average and max node CPU busy at 10 minute logging
periods and the number of concurrent active sessions at less than a minute frequency. The
beginning of the chart shows the number of concurrent active sessions at 10 (scale on right hand
side of chart), fluctuating to about 20 concurrency for an hour or so, then picking up to 40,
dropping down and going back to 40. At approximately 17:22, the concurrent load on the system
dropped from about 40 down to 12 while the CPU still remained at 100% busy. This helps to
explain why response time is longer at different times of the day even though the CPU is 100%
busy throughout most of the time period.
11
100
80
60
40
20
0
0:00
3:10
6:20
9:30
12:40
15:50
19:00
22:10
1:20
4:30
7:40
10:50
14:00
99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/14 99/10/14 99/10/14 99/10/14 99/10/14
100
80
60
OS % CPU
40
20
0
0:00
3:10
6:20
9:30
12:40
15:50
19:00
22:10
1:20
4:30
7:40
10:50
14:00
99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/14 99/10/14 99/10/14 99/10/14 99/10/14
13
100.0
80.0
60.0
40.0
20.0
0.0
0:00
3:20
6:40
10:00
13:20
16:40
20:00
23:20
2:40
6:00
9:20
12:40
16:00
99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/13 99/10/14 99/10/14 99/10/14 99/10/14 99/10/14
14
os % busy
dbs % busy
100
80
60
40
20
13
21
5
13
21
5
13
21
5
13
21
8/24/1998 8/24/1998 8/25/1998 8/25/1998 8/25/1998 8/26/1998 8/26/1998 8/26/1998 8/27/1998 8/27/1998 8/27/1998
15
35
14,000,000
120
30
10,000,000
8,000,000
20
80
6,000,000
Disk I/Os
I/O Wait %
100 25
15
60
4,000,000
10
40 5
0
20
2,000,000
0
11
22
9
20
7
18
5
16
3
14
98/08/03 98/08/03 98/08/03 98/08/04 98/08/04 98/08/05 98/08/05 98/08/06 98/08/06 98/08/07 98/08/07
0
0
9
18
3
12
21
6
15
0
9
18
3
12
21
98/08/03 98/08/03 98/08/03 98/08/04 98/08/04 98/08/04 98/08/05 98/08/05
1698/08/06 98/08/06 98/08/06 98/08/07 98/08/07 98/08/07
I/O Wait %
Avg CPU Bsy
40
16,000,000
35
14,000,000
30
12,000,000
25
10,000,000
20
8,000,000
15
6,000,000
10
4,000,000
2,000,000
0
0 4
8 12 16 20 0 4
8 12 16 20 0 4
8 12 16 20 0
4 8 12 16 20 0
98/08/03 - 98/08/07
17
4 8 12 16 20
I/O Wait %
CPU Idle Waiting for I/O vs. Buddy Backup Bynet I/O
Average & Min Free Memory Available vs. Total Page/Swap IOs
700
250,000
600
200,000
150,000
400
300
100,000
200
50,000
100
0
0
18
0:00
16:20
8:40
1:00
17:20
9:40
2:00
18:20
10:40
4:30
20:50
7/16/2001 7/16/2001 7/17/2001 7/18/2001 7/18/2001 7/19/2001 7/20/2001 7/20/2001 7/21/2001 7/22/2001 7/22/2001
500
Avg
Max
19
Active Sessions
18:18:07
18:04:27
17:50:33
17:36:31
17:22:49
17:08:27
16:54:39
16:40:33
16:26:51
16:13:32
15:59:41
15:45:23
15:30:47
15:16:50
15:03:33
14:50:18
14:36:53
14:23:36
120.0
CPU Usage
50
100.0
40
80.0
60.0
30
40.0
20
20.0
10
0.0
0