calculate optimal region szie for a zSeries batch job



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

calculate optimal region szie for a zSeries batch job

Postby ocjohnh » Wed Jun 29, 2016 10:21 pm

Not sure if the is the right place for my question...yet anyway...
can any one tell me how I can calculate optimal region szie for a zSeries batch job ?
ocjohnh
 
Posts: 12
Joined: Tue Jul 31, 2012 1:22 pm
Has thanked: 1 time
Been thanked: 0 time

Re: calculate optimal region szie for a zSeries batch job

Postby Robert Sample » Wed Jun 29, 2016 11:41 pm

Sorry, but there is no such thing as "optimal region size" for a batch job. First, sites customize their systems, and use different products (both IBM and third-party), so the available amount of memory varies from site to site. Furthermore, sites can customize and implement system exits to override region parameters even if specified on a JOB statement. And up to a limit, giving more memory to a job allows you to specify more buffers which can speed up the job. But more buffers means more memory, so you really have a trade off between the amount of memory used and the time the job takes. Plus, the actual memory needed depends on the program. Defining a 100-million-byte table in a COBOL program, for example, means that program will need more memory than a program that uses no tables.

If you want to know for a specific job what to set the REGION (or MEMLIMIT) parameter to, consult your co-workers, or your team leader, or your site support group for recommendations. But ultimately the region required will be set by trial and error -- testing with a particular value.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: calculate optimal region szie for a zSeries batch job

Postby ocjohnh » Thu Jun 30, 2016 10:52 pm

Hi Robert, thx for your reply and I see where you coming from and I have to agree with you in a great extent.
still I didn't mean to picky but just for education purpose,
is it possible for us to identify some areas that we can put into consideration if we have to find out the optimal size ?

I can imagine a few areas as below:
1) the ways of program to manage the data (e.g. a cobol pgm handles a table with million rows of records)
2) the volume size of input data to the batch program in JCL (i.e. more data, more region size requirements)
3) the high EXCP count for the job execution (e.g. if higher EXCP count, then higher region size might help somehow)

do the rmode and amode for the program also take effect on the consumption for region size ? or any other things we can put them into consideration ?
ocjohnh
 
Posts: 12
Joined: Tue Jul 31, 2012 1:22 pm
Has thanked: 1 time
Been thanked: 0 time

Re: calculate optimal region szie for a zSeries batch job

Postby steve-myers » Fri Jul 01, 2016 12:19 am

ocjohnh wrote:... the ways of program to manage the data (e.g. a cobol pgm handles a table with million rows of records) …
<Personal opinion on> Few, if any programs are written that way. I don't actually do Cobol. Most programs that process large amounts of data read a row of data, extract data from the row, possibly stash select bits away in storage for later use, and continue on. I do a lot of SMF work, and most of those programs work that way.
ocjohnh wrote:... the volume size of input data to the batch program in JCL (i.e. more data, more region size requirements) ...
I guess that's true, but it's not a given. It depends on the data. It's true of most of my SMF programs.
ocjohnh wrote:... high EXCP count for the job execution (e.g. if higher EXCP count, then higher region size might help somehow) ...
Too some extent EXCP count can be reduced by other means. Again, it depends on many things.
ocjohnh wrote:... do the rmode and amode for the program also take effect on the consumption for region size ? ...
Many of my programs are AMODE 31, RMODE 24. and allocate storage above the line. RMODE 24 because control areas like DCBs are in the program text and must be below the line. Truthfully, the programs are rarely very large, but the amount of data they process can be quite large. Writing Assembler for RMODE ANY is rarely worth the hassle.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: calculate optimal region szie for a zSeries batch job

Postby Robert Sample » Fri Jul 01, 2016 12:31 am

is it possible for us to identify some areas that we can put into consideration if we have to find out the optimal size ?

I can imagine a few areas as below:
1) the ways of program to manage the data (e.g. a cobol pgm handles a table with million rows of records)
2) the volume size of input data to the batch program in JCL (i.e. more data, more region size requirements)
3) the high EXCP count for the job execution (e.g. if higher EXCP count, then higher region size might help somehow)

do the rmode and amode for the program also take effect on the consumption for region size ? or any other things we can put them into consideration ?
One question you need to consider: optimal from what standpoint? Optimal from the program standpoint may be wasteful for the system, and vice versa. Broadly speaking, your site support group should be able to provide some guidance. Each site is somewhat different so what I say here may -- or may not -- apply to your site. As a simple example, many sites prohibit using REGION=0(K or M) due to potential system problems; other sites encourage the use of REGION=0K/0M.

As far as your cases:
1) if the COBOL program has an array then it will obviously need more memory than if it just retrieves one row at a time from the database.
2) I've seen programs where input data volume had an impact on memory needed (where the program was dynamically building a table from the data), but this is actually quite rare. 99%+ of the time, the memory requirements for a program are fixed. They will change with new releases of the operating system or if the program is recompiled (particularly if the compiler version changes), but otherwise it would be rare to see variation in memory usage.
3) EXCP count reflects the amount of data being input to or output from the program and hence would rarely, if ever, have much of an impact on memory requirements for the program. A high EXCP count may indicate other performance issues -- such as long elapsed time due to lack of buffers -- that may be alleviated by additional memory for the program, but in general a program with high EXCP counts that has been optimized for buffer usage will not be helped by more memory.

RMODE and AMODE may impact program memory requirements -- but again, may not (it all depends). In general, an RMODE(24) AMOD(24) program will be limited to the amount of memory available below the line-- depending upon the site, that is usually somewhere between 8 and 10 megabytes. Moving to 31-bit addressing for both RMODE and AMODE allows the program to use up to 2 gigabytes of memory. Note that recent compilers are starting to generate code that uses 31-bit addressing exclusively and 24-bit addressing is slowly dying out.

The most optimal (from the program standpoint) solution is to specify REGION=0M or REGION=0K on the JOB statement and don't code any REGION on any EXEC statement. From the JCL Reference manual:
A value equal to 0K or 0M — gives the job all the storage available below and
above 16 megabytes. The resulting size of the region below and above 16
megabytes is installation-dependent. When REGION=0K/0M is specified, the
MEMLIMIT is set to NOLIMIT.
Note:
This may cause storage problems. See the Considerations When Using the
REGION parameter section for more information.

Considerations when using the REGION parameter
Specifying a REGION size that gives the job all the available storage below the 2
GB bar, such as 0K or any value greater than 16,384K, can cause storage problems
if the IBM- or installation-supplied routine IEALIMIT or IEFUSI is not used to
establish a limiting value.
This will let the program use whatever is available. However, your site may override REGION=0M/0K to something else through an installation exit. Only your site support group can tell you for sure.
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post