What factor influence the CPU time and elapsed time for a Job.

How to do Performance analysis and Capacity Planning for a shop. We also talk about Software Cost here.
Post Reply
Kanika
Registered Member
Posts: 21
Joined: Sat Jul 13, 2013 6:31 pm

What factor influence the CPU time and elapsed time for a Job.

Post by Kanika »

Hi,

I want to know what are the factors which can influence and decide on CPU time and the elapsed time taken by a Job. I have a Job which is running a simple COBOL batch program. This program has a single input file and two output file. The program read the input file and writes to output files.

I execute this Job for five time with same number of input records and keeping all the other things same but in all the runs I get different CPU and elapsed times. Why this happens? I would expect the times to be same. Are there some factors influencing the CPU time and elapsed time apart from the obvious. Please enlighten me.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What factor influence the CPU time and elapsed time for a Job.

Post by Robert Sample »

CPU won't usually vary much for a given job -- but the system records it to much greater precision that the JES2 or JES3 output will show. Hence you may see slight variations in CPU time but you won't generally see huge differences. If you see more than .1 or .2 CPU second difference between jobs, there's probably something else going on to impact CPU time.

Elapsed time, however, is a totally different story. Elapsed time depends upon the number of address spaces (batch jobs, TSO users, started tasks and possibly OMVS processes) executing in the LPAR, their relative priorities compared to yours, how busy the CPU is, the WLM (Workload Manager) policy, and so forth. I have seen jobs that run in 2 minutes when the system is not busy take more than 5 hours when the CPU is running 100% -- even though the CPU time was within .1 second of the same.
Kanika
Registered Member
Posts: 21
Joined: Sat Jul 13, 2013 6:31 pm

Re: What factor influence the CPU time and elapsed time for a Job.

Post by Kanika »

Robert Sample wrote:CPU won't usually vary much for a given job -- but the system records it to much greater precision that the JES2 or JES3 output will show.  Hence you may see slight variations in CPU time but you won't generally see huge differences.  If you see more than .1 or .2 CPU second difference between jobs, there's probably something else going on to impact CPU time.

Elapsed time, however, is a totally different story.  Elapsed time depends upon the number of address spaces (batch jobs, TSO users, started tasks and possibly OMVS processes) executing in the LPAR, their relative priorities compared to yours, how busy the CPU is, the WLM (Workload Manager) policy, and so forth.  I have seen jobs that run in 2 minutes when the system is not busy take more than 5 hours when the CPU is running 100% -- even though the CPU time was within .1 second of the same.
Thanks!
If I want to calculate the CPU time consumed by a job, then should I rely on the CPU time shown in the SYSOUT of the job or I should look for some other place?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What factor influence the CPU time and elapsed time for a Job.

Post by Robert Sample »

The quick and easy and hence not very accurate way is to look at the job output.  If you want more detail the SMF type 30 record is generated at the end of the job and it has LOTS of detail.  It may not be accessible to applications people at your site, though.
And your post said CPU time as if it is a single number.  It is actually multiple numbers (TCB, SRB, zAAP, zIIP) that are combined to be called "the" CPU time for the job.
Kanika
Registered Member
Posts: 21
Joined: Sat Jul 13, 2013 6:31 pm

Re: What factor influence the CPU time and elapsed time for a Job.

Post by Kanika »

And your post said CPU time as if it is a single number. It is actually multiple numbers (TCB, SRB, zAAP, zIIP) that are combined to be called "the" CPU time for the job.
So I need to calculate all these to get the CPU time or look at the CPU time from SYSOUT?

ANd Where are these factors shown for a job run?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: What factor influence the CPU time and elapsed time for a Job.

Post by Robert Sample »

 The CPU time on SYSOUT is TCB and SRB if I recall correctly.  The source for good CPU data is the SMF records - for a batch job, type 30 subtype 4 / 5 (step / job termination records).
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Mainframe Performance, Capacity Planning and Software Cost.”