MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Drastic increase in cost of Job
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Problem Determination
View previous topic :: View next topic  
Author Message
hellohatim
Beginner


Joined: 12 Apr 2007
Posts: 28
Topics: 7

PostPosted: Tue Aug 07, 2007 4:59 pm    Post subject: Drastic increase in cost of Job Reply with quote

Hi,

We have a job which was recently changed in production. One step has contributed to significant increase in I-O as well as CPU consumption. This step before changes had 3 KSDS files, to which one more KSDS was added (ZIPSMSA file). These KSDS were created inline in JCL itself w/o using DEFINE IDCAMS.

The read/write counts of various files is as follows:

After changes
Code:
Sequential file counts
CUSTMAST READ    : 0007781246
MERACC   WRITTEN : 0007781246
CUSTMAST WRITTEN : 0007781246
ERRO REC WRITTEN : 0000032621

KSDS file hits
PLANIND   0007781246
TM        0006932569
ZIPDMA    0006911436
ZIPSMSA   0006921105


Before changes
Code:
Sequential file counts
CUSTMAST READ    : 0007717185
MERACC   WRITTEN : 0007717185
CUSTMAST WRITTEN : 0007717185
ERRO REC WRITTEN : 0000022197

KSDS file hits
PLANIND   0007717185
TM        0006872350
ZIPDMA    0006850169


I found one more thing in JESYSMSG, which changed quite a lot, altho I was not able to interpret it much,
VIO PAGE INS 738688
Prior to changes the value here was zero.

I am not able to understand why just adding one more KSDS will impact I-O and CPU so much. The percentage increase in Seq I-O is not much when one compares the above numbers.

Regards,
Hatim.
_________________
-Hatim M P
Back to top
View user's profile Send private message MSN Messenger
hellohatim
Beginner


Joined: 12 Apr 2007
Posts: 28
Topics: 7

PostPosted: Tue Aug 07, 2007 5:08 pm    Post subject: Reply with quote

I forgot to add a few more statictics for this step.

After
Code:

STEP         EXCP        CONN        CPU TIME
STEP0090   62216000   874K   22.77


Before
Code:

STEP         EXCP        CONN        CPU TIME
STEP0090   28403000   520K   10.96


Regards,
Hatim.
_________________
-Hatim M P
Back to top
View user's profile Send private message MSN Messenger
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Aug 07, 2007 11:40 pm    Post subject: Reply with quote

just guessing, but before the addition of the file, your job parms were tuned to allocate the necessary resources to run the job. you added a new file, did you change your job parms? or add any to increase what is provided by default at your installation?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
blitz2
Beginner


Joined: 23 Jan 2007
Posts: 84
Topics: 14

PostPosted: Tue Aug 07, 2007 11:40 pm    Post subject: Reply with quote

Quote:

KSDS were created inline in JCL itself w/o using DEFINE IDCAMS.


Can you please elaborate more on that?
________
Ship sale


Last edited by blitz2 on Thu Mar 10, 2011 5:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Wed Aug 08, 2007 8:06 am    Post subject: Reply with quote

The CPU time more than doubled and the I/O counts (EXCP) more than doubled! You need to understand how the new file affected the program logic path.

FYI,
VIO is a method of allocating active, temporary (usually small!) files in memory instead of on DASD. This reduces elapsed time usually spent waiting for DASD I/O. There is usually a special name, such as UNIT=VIO, to get this or SMS may be doing it for you.
_________________
Regards,
Bill Dennis

Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
Back to top
View user's profile Send private message
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Wed Aug 08, 2007 3:24 pm    Post subject: Reply with quote

I always suspect CI and CA splits when performance problems creep into VSAM applications. It's been a while since I worked with VSAM, but I think you can get the CI/CA split counts from a LISTCAT. Also, you might benefit from adding BUFNI and BUFND parms to the JCL.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Wed Aug 08, 2007 3:28 pm    Post subject: Reply with quote

Some tips from Optimization Manual:

When using VSAM files, increase the number of data buffers (BUFND) for sequential access or index
buffers (BUFNI) for random access. Also, select a control interval size (CISZ) that is appropriate for the
application. A smaller CISZ results in faster retrieval for random processing at the expense of inserts,
whereas a larger CISZ is more efficient for sequential processing. In general, using large CI and buffer space
VSAM parameters may help to improve the performance of the application.
In general, sequential access is the most efficient, dynamic access the next, and random access is the least
| efficient. However, for relative record VSAM (ORGANIZATION IS RELATIVE), using ACCESS IS
| DYNAMIC when reading each record in a random order can be slower than using ACCESS IS RANDOM,
| since VSAM may prefetch multiple tracks of data when using ACCESS IS DYNAMIC. ACCESS IS
| DYNAMIC is optimal when reading one record in a random order and then reading several subsequent
| records sequentially.
Random access results in an increase in I/O activity because VSAM must access the index for each request.
If you use alternate indexes, it is more efficient to use the Access Method Services to build them than to use
the AIXBLD run-time option. Avoid using multiple alternate indexes when possible since updates will have
to be applied through the primary paths and reflected through the multiple alternate paths.
| VSAM buffers can be allocated above the 16 MB line if all of the following are true:
| the programs are compiled with VS COBOL II Release 3.0 or higher, COBOL/370 Release 1.0 or
| higher, or IBM COBOL for MVS & VM Release 2.0 or higher
| the programs are running with LE/370 Release 3.0 or higher, or IBM Language Environment for MVS
| & VM Release 5.0 or higher
Back to top
View user's profile Send private message
hellohatim
Beginner


Joined: 12 Apr 2007
Posts: 28
Topics: 7

PostPosted: Wed Aug 08, 2007 5:53 pm    Post subject: Reply with quote

Hello Everyone,

Thanks for all your replies. I will add some more information here.

I had defined KSDS inside the JCL itself like this...

Code:
--SYSUT2   DD DSN=C8USP.C8SEM110.IDCAMS.V.SMSAZIP,                         
//            DISP=(NEW,CATLG,DELETE),                                     
//            LRECL=018,KEYOFF=0,KEYLEN=15,RECORG=KS,                       
--            DATACLAS=HUGE                                                 

i.e I have not used IDCAMS here. I did check the VSAM parameters of output file, its CISZ is 4096.

secondly this file will not have any inserts/deletes & is purely meant for random read purpose. There are tables which store values against each zip codes. For each record in one seq file, I have to retrieve the corresponding value against the zip code. This is the only logic added in the program. There are 7 M records in seq file, and 99,999 records in zip table file. There is no complicated logic added to the program which could have consumed more CPU Time. Just one VSAM read statement and an If condition to populate the W-S variable.

We have used Access is dynamic here. The other design approach would have been to mix n match seq against the zip table file. Other approach would be to load in an internal array and index. We found VSAM to be eaiser way of coding.

Following are file parameters.

Code:
Data Component Information:                       Current Allocation Options: 
 Device type:             3390                     Load option:          SPEED
 Organization:            KSDS                     Write check:             NO
 KSDS key length:           15                     Buffer space:          9728
 KSDS key location:          0                     Erase on delete:         NO
 Average record size:       18                     Imbedded index:          NO
 Maximum record size:       18                     Replicated index:        NO
Allocated Space:    Unit    Primary  Secondary     Reuse option:            NO
 Data:         CYLINDERS        426          0     Share option:           3-3
 Index:           TRACKS         17          0     Spanned records:         NO
Dataset Date Information:                          Key ranges present:      NO
 Creation date:         2007/08/05                 AIX-unique keys:           
 Expiration date:                                  AIX-upgrade:               
 Modification date:     2007/08/06                                             
 Modification time:     04:32 AM  GMT                                         


Code:
Current Allocations in Tracks:            Current Utilization in Tracks:       
 Allocated space:             6390         Used data space:       16 (   0 %) 
 Allocated extents:              1         Used extents:           1 ( 100 %) 
 Allocation type:           UNIQUE         Prime records:             43,262   
KSDS Index Allocation in Tracks:           Deleted records:                0   
 Allocated space:               17         Inserted records:               0   
 Number of records:              3         Updated records:                0   
- - - - - - - - - - - Current Reorganization Information - - - - - - - - - - -
Data - Control Area Information:          Control Interval Information:       
 Physical record size:        4096         Size-data:    4096 Index:    1536   
 Records per track:             12         Number CIs/CA:                180   
 Tracks per CA:                 15         Number free CIs/CA:             0   
 Retrieved records:        6921105         Percent free CIs/CA:            0   
 Max record number               0         Percent free bytes/CI:          0   
 Number CA splits:               0         Number CI splits:               0   


Code:
Volume Allocations:                                     
                                                       
 1. CIZW3E  2. *       3. *       4. *       5. *       
 6. *       7. *       8. *       9. *      10. *       
11. *      12. *      13. *      14. *      15. *       
16. *      17. *      18. *      19. *      20. *       
21. ______ 22. ______ 23. ______ 24. ______ 25. ______ 
26. ______ 27. ______ 28. ______ 29. ______ 30. ______ 
31. ______ 32. ______ 33. ______ 34. ______ 35. ______ 
36. ______ 37. ______ 38. ______ 39. ______ 40. ______ 


Would like to find the root cause so that it will help us in future design decisions.

Regards,
Hatim.
_________________
-Hatim M P
Back to top
View user's profile Send private message MSN Messenger
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Aug 09, 2007 2:52 am    Post subject: Reply with quote

zip file is 18 x 100000 - that only 1,800,000; Cobol table can hold that. create one module that you call, that only contains the table and logic (1) to load at beging of job, (2) do a search all to replace the random read.

either that or create the zip ksds so that the ordering is the same as the acess. Unless the ksds zip file is being accessed seq (albeit dynamic) prefetch will never have enough in memory to preclude physical i/o.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
blitz2
Beginner


Joined: 23 Jan 2007
Posts: 84
Topics: 14

PostPosted: Thu Aug 09, 2007 6:50 am    Post subject: Reply with quote

There are only 99999 records in the file but the statistics indicate 6921105 reads. Dbz's approach is one solution. Another may be to load the cobol table dynamically as you read from the file i.e. Search the cobol table first and then do a random read if there is no row in cobol table. Populate the cobol table whenever you read the file. I'm sure atleast the number of reads will reduce drastically... If you try it out, please post the findings.
________
Lamborghini Lma002 Specifications


Last edited by blitz2 on Thu Mar 10, 2011 5:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Aug 09, 2007 6:57 am    Post subject: Reply with quote

blitz2,

loading the table dynamically means an unordered table, which defeats the SEARCH ALL.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Thu Aug 09, 2007 9:25 am    Post subject: Reply with quote

If a large percentage of your reads are going after a previously unread record, I'd go with Dick's suggession. If you find that you are reading the same record many times throughout the execution of your program, I'd go with blitz2's. I've used both methods and a lot depends on how often you end up rereading the same record. In my case it was a DB2 table that was being read, but the same idea holds true for a VSAM file. As Dick mentioned, the 2nd method precludes the use of a binary search.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
blitz2
Beginner


Joined: 23 Jan 2007
Posts: 84
Topics: 14

PostPosted: Thu Aug 09, 2007 9:30 am    Post subject: Reply with quote

yes, with a dynamic load, binary search would not work but a serial search would... final goal being to reduce I/O operations.
________
MONTANA MEDICAL MARIJUANA DISPENSARY


Last edited by blitz2 on Thu Mar 10, 2011 5:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
jsharon1248
Intermediate


Joined: 08 Aug 2007
Posts: 291
Topics: 2
Location: Chicago

PostPosted: Thu Aug 09, 2007 9:55 am    Post subject: Reply with quote

I'm thinking that the KSDS access should not create a performance issue. If you can apply changes to the code, store the record read from the KSDS file in WS. When you need to read again, check to see if the record is already in WS. This alone could reduce the number of total reads required.

Also, I'd try a smaller CI size. 4096 will store 150+ records. If your access is truly random, you're move 150+ records to the buffer to get the one you want. Try something like 1024 or 512. One more thing is to increase the BUFNI and BUFND. I don't remember the exact formulas, but I think the defaults are too low.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Thu Aug 09, 2007 10:16 am    Post subject: Reply with quote

These files possibly need to be tuned for more than 1 process: Random and Sequential. Tuning for 1 type precludes optimum tuning for the second.

There are 3 other files:
PLANIND
TM
ZIPDMA
that are only read. if the files are also capable of being loaded into separate cobol modules (3), the binary search in memory will beat I/O any day of the week, regardless of the vsam restructuring.

OP needs to sit down and detemine all of his requirements. VSAM structuring for one type of process and program redesign (tabling) for another.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Problem Determination All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group