IBM i Global

 View Only
  • 1.  DASD is high on IBM i

    Posted Mon May 02, 2022 02:25 PM
    Hi Team,

    Our system ASP is suddenly spiked to 88%. How can I reduce the ASP on priority. Also today is the 1st day of 4 day billing, hence the system is busy.

    I am new to the system and finding it difficult to check what is exactly causing the issue. I need to find the root cause and bring down the ASP. Please help.



    ------------------------------
    Avinash Yadav
    ------------------------------


  • 2.  RE: DASD is high on IBM i

    IBM Champion
    Posted Mon May 02, 2022 03:54 PM
    First thing you need to do is to run RTVDSKINF.  This gathers stuff on where your disk is being consumed.  It can only be run in batch.  I have it automatically run on a weekly basis by the following
    WRKJOBSCDE
    From there you can fill in the blanks on 
    or you can enter this set of commands
    CALL QCMD
    F11 (will give you a full screen of entry)
    Then paste the following and press enter.
    ADDJOBSCDE JOB(OPDSKGET)
    CMD(RTVDSKINF) FRQ(*WEEKLY)
    SCDDATE(*NONE) SCDDAY(*THU)
    SCDTIME(040000) SAVE(*NO)
    RCYACN(*NOSBM) JOBD(*USRPRF)
    JOBQ(ROUTINES/RTVDSKINF) USER(ROB) 
    MSGQ(*USRPRF) TEXT('RTVDSKINF')
    Then add this entry too:
    ADDJOBSCDE JOB(OPDSKPRT)
    CMD(PRTDSKINF RPTTYPE(*SYS))
    FRQ(*WEEKLY) SCDDATE(*NONE)
    SCDDAY(*THU) SCDTIME(040500)
    SAVE(*NO) RCYACN(*NOSBM)
    JOBD(*USRPRF) JOBQ(ROUTINES/RTVDSKINF)
    USER(ROB) MSGQ(*USRPRF)
    TEXT('PRTDSKINF *SYS')
    These two will generate a report like the following:

    See how that can help?
    There's an option on PRTDSKINF that I often use:
    PRTDSKINF RPTTYPE(*LIB) OBJ(*NONE)
    This will tell you your biggest libraries sorted by size.
    If you need more detail try:
    PRTDSKINF RPTTYPE(*LIB) OBJ(*ALL) MINSIZE(99000)
    PRTDSKINF is worthless without a recent RTVDSKINF.

    Now, if you find your "User directories" is the culprit then you should look at the combo of
    RTVDIRINF
    and
    PRTDIRINF
    These run a LONG time.
    There are some nice samples in Run SQL Scripts for analyzing the files created by RTVDIRINF.




    ------------------------------
    Robert Berendt
    ------------------------------



  • 3.  RE: DASD is high on IBM i

    Posted Tue May 03, 2022 07:58 AM
    Hi Avinash,

    I recently discover the ncdu open source utility, I found it very very smart and useful.

    Read this on how to install it:


    https://powerwire.eu/ncdu-on-ibm-i

    Bye

    ------------------------------
    Paolo Salvatore
    ------------------------------



  • 4.  RE: DASD is high on IBM i

    IBM Champion
    Posted Tue May 03, 2022 09:39 PM
    Edited by Satid Singkorapoom Tue May 03, 2022 09:59 PM
    Dear  Avinash

    In my experience, some customers create a lot of work files during major business cycle processing.    During this 4-day billing period, do you know if your core application codes create a lot of "work files" or not?  If so, the spike should reduce after this period passes if the app codes delete these work files or clear their members. You should run WRKSYSSTS again after this 4-day billing period to see how much the used disk space reduces. If it reduces substantially, you take note of it and inform your management.   One way to eliminate a lot of persistent work files is to use Common Table Expression (CTE) but this requires coding in SQL.   I have an article that discusses CTE if you want.

    Another possible cause of used disk space spike is spooled files and you will see this from PRTDSKINF report.   By the way, make sure you run RTVDSKINF during low workload period to obtain accurate disk usage data.  Some 20 years ago when I wrote an IBM redbook on AS/400 disk management, a developer told me that RTVDSKINF command skips any objects that are locked while it runs and therefore does not record the files' disk space consumption.  I'm not sure if this has been rectified or not since then but I suspect not.   If you find a lot of trivial spooled files eating much disk space, there are a few freeware on the web that you can obtain to delete spooled files from selected users that are older than a number of days you can specify.  I may still have its source CL code. Let me know if you are interested.  You can run this regularly using WRKJOBSCDE.

    Next is that there can be too many large tables (in GB or even TB size) with too many deleted rows lying around that need to be reorganized and purged to reduce disk allocation.  You can run a meta-data query to see such tables and here is the SQL code for the query :

    SELECT TABLE_NAME, TABLE_SCHEMA, DATA_SIZE, NUMBER_ROWS, NUMBER_DELETED_ROWS  FROM QSYS2.SYSTABLESTAT ORDER BY NUMBER_DELETED_ROWS DESC FETCH FIRST 50 ROWS ONLY

    This query can take some time to run and a sample is looks like this : 


    You can eliminate too many deleted rows by consider enabling REUSE DELETED RECORDS parameter of those tables.

    Next I notice is that, in your provided screen shot, Current and Peak temporary (disk space) used are in a range of hundred GB indicating that your workload contains substantial amount of Queries and/or SQL.  (The Current values is about 10%  and the Peak is about 20% of your total disk space and this may explain the spike).   SQL and Queries use a lot of temp disk space when joining tables, using CTE and such but this reduces once they finish their runs. (A customer of mine had a join that consumed 200GB temp disk while running and I informed them this was a bad query. Once rectified it reduced a lot.)  Try looking at Current temporary used on low workload day and see how far below the Peak value, if very low, then you take note and let others be aware of it.  You can hunt down such bad Queries/SQL with WRKACTJOB and sort the list in descending order with Temp Storage column.  Read these articles for more on this : 

    How Much Temporary Storage Is In Use And Who Is Using It?
    (R720 & higher) Temporary Space Growth Debug

    Last thing is that you should use IBM i PDI chart named Resource Utilization Overview to see fluctuation in System ASP disk consumption whether it increases a lot only during your 4-day billing period. If so, inform you application team on this. A sample of this chart is here : 



    Hope these help.

    ------------------------------
    Satid Singkorapoom
    ------------------------------