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 Previous  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
jsharon1248
Intermediate


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

PostPosted: Thu Aug 09, 2007 11:43 am    Post subject: Reply with quote

There's no debate that loading/retrieving data within an internal table will outperform any IO. But that would require modifications to the existing application architecture. Looking at the biggest bang for the buck, there will be lower risk and effort (cost) to attempt relatively simple modifications that do not impact the existing application architecture. If changing the CI size and increasing buffers reduces the run times to acceptable levels, great. If not, there's little loss.

Also, referring to the suspected problem file, hellohatim stated:

Quote:

this file will not have any inserts/deletes & is purely meant for random read purpose


I was not thinking about tuning for sequential processing based on that statement.
Back to top
View user's profile Send private message
hellohatim
Beginner


Joined: 12 Apr 2007
Posts: 28
Topics: 7

PostPosted: Thu Aug 09, 2007 12:04 pm    Post subject: Reply with quote

Hi Everybody,

Thanks once again for all your inputs.

The KSDS file does have 99,999 records only. the 6.9 M statistic was # of hits on KSDS not the number of records. The input sequential file is having > 7M records and for each record from this file, the zip code variable is used to index into the KSDS file.

Code:
3700-QC-ZIPSMSA.                                               
                                                               
    MOVE I01-AD-5-DIG-US-ZIP-CD      TO WS01-ACTUAL-CD.       
    MOVE WS01-POSTAL-CD              TO ZIPSMSA-POST-CD.       
    PERFORM 7400-READ-ZIPSMSA      THRU 7400-EXIT.             
                                                               
    EVALUATE TRUE                                             
                                                               
        WHEN WS01-ZIPSMSA-KEYFND                               
             PERFORM 3710-QC-ZIPSMSA-PROC                     
                                   THRU 3710-EXIT             
        WHEN WS01-ZIPSMSA-NOTFND                               
             MOVE '0004'             TO WW02-ERROR-CODE       
             MOVE 'ZIP CODE'         TO WW02-DESCRIPTION(01:08)
             MOVE  ZIPSMSA-POST-CD   TO WW02-DESCRIPTION(10:06)
             MOVE  'MISSING IN ZIPSMSA '                       
                                     TO WW02-DESCRIPTION(18:19)
             PERFORM 8100-WRITE-ERROR-PARA                     
                                   THRU 8100-EXIT             
    END-EVALUATE.                                             
                                                               
3700-EXIT.                                                     
    EXIT.                                                     
                                                               
3710-QC-ZIPSMSA-PROC.                                         
                                                               
    IF ZIPSMSA-SMSA-CD NOT = I01-SMSA-CD                       
       MOVE ZIPSMSA-SMSA-CD          TO I01-SMSA-CD           
       ADD 1                         TO WA01-SMSA-UP           
    ELSE                                                       
       ADD 1                         TO WA01-SMSA-NU           
    END-IF.                                                   
                                                               
3710-EXIT.                                                     
    EXIT.                                                     


The increase in I-O percentage for KSDS as well as Seq read write from the numbers I gave above would be approximate 25% (reading KSDS file and writing error records for not found). But the total cost increased 200%. This is what I am not able to understand.

I think internal tables with binary search will be the best bet. We are thinking on restructuring the application for the same. The cost of the job has more then doubled, with increased elapsed time as well. Guess the cost to restructure will be much less.

Will also try using BUFNI & BUFND to check the results, also tweaking the CISZ size. Will post the results on this forum by next week.

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


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

PostPosted: Thu Aug 09, 2007 12:16 pm    Post subject: Reply with quote

Can you post a LISTCAT of the KSDS file after it's been loaded?
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
hellohatim
Beginner


Joined: 12 Apr 2007
Posts: 28
Topics: 7

PostPosted: Thu Aug 09, 2007 12:44 pm    Post subject: Reply with quote

Hi,

Please find the Listcat output attached.

Regards,
Hatim.

Code:
READY                                                                                                                               
   LISTCAT ENT('C8USP.C8SEM110.IDCAMS.V.SMSAZIP') ALL                                                                               
CLUSTER ------- C8USP.C8SEM110.IDCAMS.V.SMSAZIP                                                                                     
     IN-CAT --- CATALOG.UCATW.PRD01                                                                                                 
     HISTORY                                                                                                                         
       DATASET-OWNER-----(NULL)     CREATION--------2007.217                                                                         
       RELEASE----------------2     EXPIRATION------0000.000                                                                         
     SMSDATA                                                                                                                         
       STORAGECLASS ----PDBASEC     MANAGEMENTCLASS--PDBASEA                                                                         
       DATACLASS ----------HVSM     LBACKUP ---0000.000.0000                                                                         
       BWO STATUS------00000000     BWO TIMESTAMP---00000 00:00:00.0                                                                 
       BWO---------------(NULL)                                                                                                     
     RLSDATA                                                                                                                         
       LOG ----------------(NULL)   RECOVERY REQUIRED --(NO)     FRLOG ------------(NULL)                                           
       VSAM QUIESCED -------(NO)    RLS IN USE ---------(NO)                                                                         
       LOGSTREAMID-----------------------------(NULL)                                                                               
       RECOVERY TIMESTAMP LOCAL-----X'0000000000000000'                                                                             
       RECOVERY TIMESTAMP GMT-------X'0000000000000000'                                                                             
     PROTECTION-PSWD-----(NULL)     RACF----------------(NO)                                                                         
     ASSOCIATIONS                                                                                                                   
       DATA-----C8USP.C8SEM110.IDCAMS.V.SMSAZIP.DATA                                                                                 
       INDEX----C8USP.C8SEM110.IDCAMS.V.SMSAZIP.INDEX                                                                               
   DATA ------- C8USP.C8SEM110.IDCAMS.V.SMSAZIP.DATA                                                                                 
     IN-CAT --- CATALOG.UCATW.PRD01                                                                                                 
     HISTORY                                                                                                                         
       DATASET-OWNER-----(NULL)     CREATION--------2007.217                                                                         
       RELEASE----------------2     EXPIRATION------0000.000                                                                         
       ACCOUNT-INFO-----------------------------------(NULL)                                                                         
     PROTECTION-PSWD-----(NULL)     RACF----------------(NO)                                                                         
     ASSOCIATIONS                                                                                                                   
       CLUSTER--C8USP.C8SEM110.IDCAMS.V.SMSAZIP                                                                                     
     ATTRIBUTES                                                                                                                     
       KEYLEN----------------15     AVGLRECL--------------18     BUFSPACE------------9728     CISIZE--------------4096               
       RKP--------------------0     MAXLRECL--------------18     EXCPEXIT----------(NULL)     CI/CA----------------180               
       SHROPTNS(3,3)      SPEED     UNIQUE           NOERASE     INDEXED       NOWRITECHK     NOIMBED       NOREPLICAT               
       UNORDERED        NOREUSE     NONSPANNED                                                                                       
     STATISTICS                                                                                                                     
       REC-TOTAL----------43262     SPLITS-CI--------------0     EXCPS------------4672416                                           
       REC-DELETED------------0     SPLITS-CA--------------0     EXTENTS----------------1                                           
       REC-INSERTED-----------0     FREESPACE-%CI----------0     SYSTEM-TIMESTAMP:                                                   
       REC-UPDATED------------0     FREESPACE-%CA----------0          X'C1010AEB6A5121C3'                                           
       REC-RETRIEVED----6921105     FREESPC--------313298944                                                                         
     ALLOCATION                                                                                                                     
       SPACE-TYPE------CYLINDER     HI-A-RBA-------314081280                                                                         
       SPACE-PRI------------426     HI-U-RBA---------1474560                                                                         
       SPACE-SEC--------------0                                                                                                     
     VOLUME                                                                                                                         
       VOLSER------------CIZW3E     PHYREC-SIZE---------4096     HI-A-RBA-------314081280     EXTENT-NUMBER----------1               
       DEVTYPE------X'3010200F'     PHYRECS/TRK-----------12     HI-U-RBA---------1474560     EXTENT-TYPE--------X'40'               
       VOLFLAG------------PRIME     TRACKS/CA-------------15                                                                         
       EXTENTS:                                                                                                                     
       LOW-CCHH-----X'2B470000'     LOW-RBA----------------0     TRACKS--------------6390                                           
       HIGH-CCHH----X'2CF0000E'     HIGH-RBA-------314081279                                                                 

...

   INDEX ------ C8USP.C8SEM110.IDCAMS.V.SMSAZIP.INDEX                                                                               
     IN-CAT --- CATALOG.UCATW.PRD01                                                                                                 
     HISTORY                                                                                                                         
       DATASET-OWNER-----(NULL)     CREATION--------2007.217                                                                         
       RELEASE----------------2     EXPIRATION------0000.000                                                                         
     PROTECTION-PSWD-----(NULL)     RACF----------------(NO)                                                                         
     ASSOCIATIONS                                                                                                                   
       CLUSTER--C8USP.C8SEM110.IDCAMS.V.SMSAZIP                                                                                     
     ATTRIBUTES                                                                                                                     
       KEYLEN----------------15     AVGLRECL---------------0     BUFSPACE---------------0     CISIZE--------------1536               
       RKP--------------------0     MAXLRECL------------1529     EXCPEXIT----------(NULL)     CI/CA-----------------26               
       SHROPTNS(3,3)   RECOVERY     UNIQUE           NOERASE     NOWRITECHK       NOIMBED     NOREPLICAT     UNORDERED               
       NOREUSE                                                                                                                       
     STATISTICS                                                                                                                     
       REC-TOTAL--------------3     SPLITS-CI--------------0     EXCPS-----------13865162     INDEX:                                 
       REC-DELETED------------0     SPLITS-CA--------------0     EXTENTS----------------1     LEVELS-----------------2               
       REC-INSERTED-----------0     FREESPACE-%CI----------0     SYSTEM-TIMESTAMP:            ENTRIES/SECT----------13               
       REC-UPDATED------------0     FREESPACE-%CA----------0          X'C1010AEB6A5121C3'     SEQ-SET-RBA------------0               
       REC-RETRIEVED----------0     FREESPC-----------674304                                  HI-LEVEL-RBA--------3072               
     ALLOCATION                                                                                                                     
       SPACE-TYPE---------TRACK     HI-A-RBA----------678912                                                                         
       SPACE-PRI-------------17     HI-U-RBA------------4608                                                                         
       SPACE-SEC--------------0                                                                                                     
     VOLUME                                                                                                                         
       VOLSER------------CIZW3E     PHYREC-SIZE---------1536     HI-A-RBA----------678912     EXTENT-NUMBER----------1               
       DEVTYPE------X'3010200F'     PHYRECS/TRK-----------26     HI-U-RBA------------4608     EXTENT-TYPE--------X'00'               
       VOLFLAG------------PRIME     TRACKS/CA--------------1                                                                         
       EXTENTS:                                                                                                                     
       LOW-CCHH-----X'00230006'     LOW-RBA----------------0     TRACKS----------------17                                           
       HIGH-CCHH----X'00240007'     HIGH-RBA----------678911                                                                 


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


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

PostPosted: Thu Aug 09, 2007 4:05 pm    Post subject: Reply with quote

Well, it's obvious that CI splits or CA splits are not the problem! I'm no VSAM expert, but BUFSPACE seems a bit small. Also, aren't the usual SHROPTNS (2,3) instead of (3,3)? For random access, DO NOT use DYNAMIC access, use RANDOM access. Also, random access files can benefit significantly from using BLSR.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
jsharon1248
Intermediate


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

PostPosted: Fri Aug 10, 2007 10:02 am    Post subject: Reply with quote

Reviewing the LISTCAT, I noticed that you're allocating over 100 times more space than you're using. Data HI-A-RBA is 314081280 but HI-U-RBA is only 1474560. Index HI-A-RBA is 678912 but HI-U-RBA is only 4608. I know space is cheap but that's over 400 CYLS that can't be used for anything else. You could easily get by with an allocation of CYLINDERS(5 1).

If you decide to experiment with BUFNx parms, I would initially leave the data CI size as is (4096) and try BUFNI=3. For this file, there are only 3 index CI's; 1 root CI and 2 leaf CI's. The problem is that the default buffers allocated for VSAM are 1 index buffer and 2 data buffers. For every read, you're swapping out the root CI and one of the leaf CI's. That's 2 physical IO's for every logical read just for the index. Then add 1 physical IO if the data CI isn't in one of the two data buffers. Using BUFNI=3, you'll store the entire index in the buffers. For the BUFND value, I suspect that the nature of the input data results in something close to skip sequential processing. Most likely, there are pockets of records on the input file where the zip values are similar. If that's the case, leave the data CI size alone and try BUFND=10 or even 20. If that's not the case and the distribution really is random, you could reduce the data CI size to 512 and get by with BUFND=5. Changing the data CI size would also result in a change to the index CI size and you'd want to increase the BUFNI value to number of index CI's. If you see good results playing around with the BUFNx parms for this file, you might want to consider experimenting with these parms for the other VSAM files too. Just for fun.

By the way, based on the interest generated by your post, you can tell what excites the masses. Thanks for the fun.
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


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

PostPosted: Fri Aug 10, 2007 11:12 am    Post subject: Reply with quote

jsharon1248,

great input. as you indicated, this file is so small that with the right allocaton for the index and data, it could be contained completely in memory, thus no application logic change.

I have always found it easier to just load files into COBOL tables since I could never get the systems types to properly allocate the vsam structures.

The other three files: PLANIND, TM, and ZIPDMA might also receive performance gains if they were allocated differently.

Does not matter much if the file is in memory or a COBOL table - get rid of the physical I/O's.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
hellohatim
Beginner


Joined: 12 Apr 2007
Posts: 28
Topics: 7

PostPosted: Fri Aug 10, 2007 11:38 am    Post subject: Reply with quote

jsharon1248 & Dick,

Thanks a lot for your inputs. Yes this one was a major flaw, have been allocating undue space to the zipcode files. I will definitely tune the VSAM files for various parameters.

One more thing, we merged all three zip code files, TM, DMA, SMSA into one zip file with three columns. We have observed four times reduction in the job cost. This one is actually a design flaw, we could have done with just one file right from the begining Smile

I will post the results by next week for suggestions posted by jsharon1248.

Thanks & Regards,
Hatim.
_________________
-Hatim M P
Back to top
View user's profile Send private message MSN Messenger
jsharon1248
Intermediate


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

PostPosted: Fri Aug 10, 2007 11:57 am    Post subject: Reply with quote

Hatim

Thanks for the followup and looking forward to the results next week.


One more 'by the way'. I'm heading straight for the 'About MVSForums' to start a new thread to praise this site. I'm a newbie, but I've been around long enough to recognize exceptional quality.
Back to top
View user's profile Send private message
hellohatim
Beginner


Joined: 12 Apr 2007
Posts: 28
Topics: 7

PostPosted: Fri Aug 17, 2007 3:08 pm    Post subject: Reply with quote

Hello,

Sorry for the delayed response. Please find the comparisons below...

Code:
C8SEM125 STEP0020 STEP0090    00 28403K   520K  10.96 - BEFORE CHANGES WITH 3 VSAM FILES
C8SEM125 STEP0020 STEP0090    00 62216K  3419K  21.52 - AFTER CHANGES WITH 4TH VSAM FILE
PUCAN125 STEP0020 STEP0090    00 12006K   321K  24.20 - ADDING BUFFER SPACE THRU DEFINE IDCAMS, $315
PUCAN125 STEP0020 STEP0090    00 11925K  1478K   5.06 - MERGING 4 VSAM FILES, $58.8
PUCAN125 STEP0020 STEP0090    00 11804K  2164K   4.75 - REPLACING BY RRDS, $74.9
PUCAN125 STEP0020 STEP0090    00  5824K   799K   3.57 - With Arrays, $53.5


The job costs for last four have been given becoz they include only the impacted step. One thing I observed was that even after increasing the buffers, the cost only increased. Another observation was RRDS proved more costly then KSDS. I thought RRDS would have been cheaper. Further using Arrays, CPU did not reduce much, but I/O reduced one half.

I have been reading the "VSAM demystified" red book, checking out this topic to see if it can help...

Quote:
LSR with direct access
LSR buffering mode is designed for direct access. If your applications use NSR
buffering and direct access, and you are having performance problems, you can
take advantage of LSR buffering techniques using SMB or BLSR.
Refer to
_________________
-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: Sat Aug 18, 2007 12:52 pm    Post subject: Reply with quote

Hi,

I did run the original production job with 4 VSAM file but this time with the following parameters...

Code:
//STEP0090.IPLANIND DD AMP=('BUFNI=128,BUFND=16,ACCBIAS=DO')
//STEP0090.IZIPTM   DD AMP=('BUFNI=128,BUFND=16,ACCBIAS=DO')
//STEP0090.IZIPDMA  DD AMP=('BUFNI=128,BUFND=16,ACCBIAS=DO')
//STEP0090.IZIPSMSA DD AMP=('BUFNI=128,BUFND=16,ACCBIAS=DO')

These are the statistics...
Code:
PUCAN125 STEP0020 STEP0090    00 21447K  15357  12.96


I/O reduced 1/3 and CPU almost 50%!

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


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

PostPosted: Mon Aug 20, 2007 9:12 am    Post subject: Reply with quote

A few things. First, I don't see a cost for the first 2 runs. If we're going to make meaningful comparisons, we need to see the initial costs. Second, I don't know what the counts represent. I think one of them is EXCP's, but I'm not sure. I'd also like to see run times, a LISTCAT, and the actual BUFNx values used. From what I see, there is a downward trend. The last 3 runs show significant improvements over the original. As expected, the internal WS tables show the best results, but merging the files into 1 KSDS is pretty close.
Back to top
View user's profile Send private message
jsharon1248
Intermediate


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

PostPosted: Mon Aug 20, 2007 9:15 am    Post subject: Reply with quote

I'm sorry, I missed your last post. I think you're way too high on the BUFNI values. Send a LISTCAT and we can see if we can squeeze a little more out of this.
Back to top
View user's profile Send private message
hellohatim
Beginner


Joined: 12 Apr 2007
Posts: 28
Topics: 7

PostPosted: Mon Aug 20, 2007 11:54 am    Post subject: Reply with quote

Hi jsharon1248,

The listcat dumps are pretty big.Can you please let me know your email id so that I can mail you the dumps? Or if you need only some of the stats, I can copy paste them here.

I did not include the cost of other two jobs becuase they included other steps as well. The statistic I had provided was only for STEP0090, the one which had VSAM file issue. Remaining jobs I had run with STEP0090 only for testing. I will send the elapsed times later as well.

Taking my last post as example, 21447K is EXCP count and 12.96 CPU Time, i.e 5 & 7 column respectively.

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


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

PostPosted: Mon Aug 20, 2007 12:14 pm    Post subject: Reply with quote

I'd only want to see the values for BUFSPACE, CISIZE, REC-TOTAL,HI-A-RBA,HI-U-RBA, SPACE-PRI for the DATA and INDEX sections. Also, LEVELS from the INDEX section. I don't think we'll seen any drastic improvements, but there could still be slight gains.
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 Previous  1, 2, 3  Next
Page 2 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