24
Optimizing Batch Job Performance Optimizing Batch Job Performance • Resources Consumed by Program • I/O by Database File Name • Delays Caused by Object Locks • Heaviest Active Job Function Names • Record Lock Contention • Time Spent on Job Status • CPU by Line of Source Code • Duration of ILE Modules • Elapse Time by ILE Procedure Name

Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Embed Size (px)

Citation preview

Page 1: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Optimizing Batch Job Performance

Optimizing Batch Job Performance• Resources Consumed by Program• I/O by Database File Name• Delays Caused by Object Locks• Heaviest Active Job Function Names• Record Lock Contention• Time Spent on Job Status• CPU by Line of Source Code• Duration of ILE Modules• Elapse Time by ILE Procedure Name

Page 2: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

System Navigator

Identify Job LevelBottleneck First!!

Page 3: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Workload Navigator

Is the job CPU, Memory or I/O bound?

Page 4: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Resources Consumed by Program

Resources Consumed by Program

• “Job” versus “Job Stream”• Application or Operating System• CPU, I/O, Memory, Elapse Time• Date Routines, Tax Calculation Routine• Imbedded SQL, High Initiation/Termination• Stand-alone or Hundreds of Calls• ILE w/ Many Modules versus OPM Program

Page 5: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Operating System Level

Operating System Level

Page 6: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Application Level

Application Level

Page 7: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

I/O by Database File Name

I/O by Database File Name

• Compare Percent Reads to Writes/Updates• Number of I/Os versus Records in File• Small I/O Counts, Files Opening/Closing• High Sequential Reads, Low Random Reads• Time to Purge or Move Some Data?• “Open Orders” File w/ 7 Years of Closed• Proper Logical Views for Quick Access

Page 9: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Delays Caused by Object Locks

Delays Caused by Object Locks

• Work Files that Should be in QTEMP• Separate Data Libraries per Location?• Hundreds of Jobs Daytime, One Job at Night• Rare Situations Require Exclusive Locks!• CPYF CRTFILE(*YES) vs. CRTDUPOBJ• Fix the Job, Don’t Live w/ Consequences• Older Code more Prone to Locking Issues

Page 10: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Lock Wait Job Status

Page 11: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Locks by Object Name

Page 12: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Heaviest Active Job Function Names

Heaviest Active Job Function Names

• Job Going In and Out of Short DLYJOBs• Operating System Rebuilding Access Paths• Job Copying Data with Selection Criteria

Page 13: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Job Function Example

Page 14: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Record Lock Contention

Record Lock Contention

• Don’t Single Thread, Fear of Record Locks• Not a Bigger Issue at Night versus Daytime • Automatic Notification and Retry• Monitor Time Spent in Lock Wait Status• Release Records in Code if Causing Delays

Page 15: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Record Lock Example

Page 16: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Time Spent on Job Status

Time Spent on Job Status

• Never Ending Job, Always in RUN Status?• Nightly Job, not Always in RUN Status?• DLYJOB used as Bad Timing Technique • Object Locks for Long Periods of Time• Short Object Locks, Thousands of Times• Data Queue Wait that Never Waits!• Job Waits on Message for Hours Nightly

Page 17: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Job Status Example

Page 18: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

CPU by Line of Source Code

CPU by Line of Source Code

• Is There One Bad Line of Code?• SETON LR at end of Date Routine• CHAIN to CustMast for Every Line Item• Open/Close 50 Files for Each Line Item• OPNQRYFs are 73% of CPU and Elapse• CALL to Tax Routine, 85% of Elapse• Format Date Routine, 93% of Duration

Page 19: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Source Code Example

Page 20: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Duration of ILE Modules

Duration of ILE Modules

• Complex ILE Bound Program• Identify Specific Module Causing Delays• Date Routines, Tax Calculation Routine• Older Routines, Called for Every Line Item• Outside Loop, Now that Impact is Known

Page 21: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

ILE Modules Example

Page 22: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Elapse Time by ILE Procedure Name

Elapse Time by ILE Procedure Name

• Identify High Use Subroutines• Optimize Those Routines• Minimize Calls to Intensive Routines• Pinpoint Section of Code Needing Rework

Page 23: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

ILE Procedure Name Example

Page 24: Optimizing Batch Job Performance Resources Consumed by Program I/O by Database File Name Delays Caused by Object Locks Heaviest Active Job Function Names

Q&A

To receive MB Software’s FREE performance evaluation:

1. Register at http://www.mb-software.com 2. Download and install software on AS/400 or iSeries 3. Call (800) 713-5034 to schedule your free performance review session

What To Expect:

After allowing performance data to accumulate for one full business day, you will log into a secure area of MB Software’s web site. We will then have a conference call to discuss our findings and how you can gain performance improvements with your existing applications. It’s that easy!

Questions & Answers