AIX

 View Only
Expand all | Collapse all

The raw nmon data about to "%CPU Used (The percentage of the processor that is used in the last interval.)" How nmon calcuate for each interval time?

  • 1.  The raw nmon data about to "%CPU Used (The percentage of the processor that is used in the last interval.)" How nmon calcuate for each interval time?

    Posted Mon December 05, 2022 10:07 PM

    Hello Nmon expert,

    The raw nmon data about to "%CPU Used (The percentage of the processor that is used in the last interval.)" How nmon calcuate for each interval time?

    By reference from  IBM URL: nmon Command
        The  "%CPU Used" is The percentage of the processor that is used in the last interval.
        and  "%CPU" Percentage of CPU utilized by the specific thread.

    When check the content in nmon raw data in "BBBL" and "TOP".

    NMON:BBBL

        CPU in sys 80
        Virtual CPU 22
        Logical CPU 88
       smt threads 4
       capped 0
       min Virtual 1
       max Virtual 32
       min Logical 1
       max Logical 128
       min Capacity 0.1
      max Capacity 16
      Entitled Capacity 5.9

    Once generated via nmon analyzer the result shown in "top".

    Time PID %CPU %Usr %Sys Threads Size ResText ResData CharIO %RAM Paging Command WLMclass IntervalCPU% WSet User Arg
    Avg. WAvg. Max. WSet=> Min. Avg. Max. Avg. WAvg. Max.
    09:26:20 262152 210.6 210.6 0 12 1472 0 1472 0 0 0 lrud Unclassified 105.30 1,472 root lrud
    09:21:19 262152 174.19 174.19 0 12 1472 0 1472 0 0 0 lrud Unclassified 87.10 1,472 root lrud
    09:31:20 262152 108.69 108.69 0 12 1472 0 1472 0 0 0 lrud Unclassified 54.35 1,472 root lrud
    02:21:19 262152 77.67 77.67 0 12 1472 0 1472 0 0 0 lrud Unclassified 38.84 1,472 root lrud
    02:06:19 262152 74.72 74.72 0 12 1472 0 1472 0 0 0 lrud Unclassified 37.36 1,472 root lrud
    02:16:19 262152 72.15 72.15 0 12 1472 0 1472 0 0 0 lrud Unclassified 36.08 1,472 root lrud
    02:26:19 262152 70.44 70.44 0 12 1472 0 1472 0 0 0 lrud Unclassified 35.22 1,472 root lrud

    Excerpt for only "%CPU Avg."
       Time           PID       %CPU
                                           Avg.
       09:26:20 262152 210.6
       09:21:19 262152 174.19
       09:31:20 262152 108.69
       02:21:19 262152 77.67
    ....
     
       Customer would like to know, how nmon from raw data and then analyser calculation the "%CPU Avg." for each interval?

    Ibm remove preview
    nmon Command
    View this on Ibm >


    Best regards,
    Charin Kumjudpai (IBMTH as local AIX support)



    ------------------------------
    CHARIN KUMJUDPAI
    ------------------------------


  • 2.  RE: The raw nmon data about to "%CPU Used (The percentage of the processor that is used in the last interval.)" How nmon calcuate for each interval time?

    Posted Fri May 26, 2023 01:18 AM
    Edited by CHARIN KUMJUDPAI Fri May 26, 2023 11:30 AM

    ..




























    ...

















    .



  • 3.  RE: The raw nmon data about to "%CPU Used (The percentage of the processor that is used in the last interval.)" How nmon calcuate for each interval time?

    Posted Mon May 29, 2023 05:58 AM

    Hi,

    nmon uses the AIX getprocs64() system call to extract process stats.

    The AIX kernel on a 100 times-a-second via the timer interrupt increments counters for each process.
    Depending on the current mode of the process user mode = running the program, system mode handling a system call and in the kernel, idle but waiting for disk I/O or idle.

    nmon grabs all the stats, wait for the requested snapshot time and then collects another set of state.
     The difference (called a delta) between the two sets of counters is what the process was doing in the time between taking the snapshots.
    So (new-number - old-number)/time-in-seconds = the percentage.

    It is a percentage because the timer interrupts are 100 times a second.

    You might have noticed some processes go well over 100% - this is because they are multi-threaded so they get  more then one increment.

    200% might be two threads running all the time of say 4 threads running 50% of the time - there is no way to work that out without nmon capturing thread information.  nmon does not do that because the volume of data would be enormous = many times that of the process information. Capturing the volume of data would also time lots more CPU time.  We don't want nmon to become a CPU-hungry process.  AIX tracing can be used to do that if necessary but would you want your RDBMS to run at half speed to get the thread details which are very hard to understand - you need to know the process threading models and algorithms or the data is largely meaningless.

    Hope this answers you question, cheers N



    ------------------------------
    Nigel Griffiths
    ------------------------------



  • 4.  RE: The raw nmon data about to "%CPU Used (The percentage of the processor that is used in the last interval.)" How nmon calcuate for each interval time?

    Posted Mon May 29, 2023 06:36 AM
    Edited by CHARIN KUMJUDPAI Mon May 29, 2023 06:48 AM

    Hello Nigel Griffiths,

     

    Thank you for you update for my long back posted in community, please ignore it.

     

    Now, I've the severity 2 case which is related to NMON and NMON analyzer.

    As of now, the IBM TechXchange Community getting errors.

    Sorry, an unexpected error has occurred.

    We have logged this issue. If the problem persists, please contact us and provide the following error log key: f628a382-6cd1-4731-b67d-01886709d5e4

     

    May I bother you to help about the NMON and NMON analyzer with the below question.

     

    Once generated with NMON analyzer done.

    In TOP for PID=18613336 shown the "%CPU" i.e 41.81,39.8... as i shown below.

    If comparing the values of "%CPU" in TOP and "CPU%" in CPU_ALL worksheet. The TOP(%CPU) > 30-43% by Avg and in CPU_ALL(CPU%) is < 3-10

     

    Customer question:  

    How NMON analyzer calculated the TOP(%CPU) and CPU_ALL(CPU%)?

              Because the values of %CPU in TOP and CPU% in CPU_ALL are much differ.

     

    TOP(%CPU)

          Time        PID         %CPU  %Usr  %Sys  Threads     Size  ResText     ResData      CharIO      %RAM  Paging      Command     WLMclass    IntervalCPU%      WSet  User      Arg              

          04:31:36    18613336    41.81 37.81 4     1     11248 8     11248 76533054    0      10    mumps Unclassified                 cbsadm      /cbsprod/gtm_dist/mumps -direct                 

          04:32:36    18613336    39.8  35.89 3.91  1     11248 8     11248 74702743    0      9     mumps Unclassified                 cbsadm      /cbsprod/gtm_dist/mumps -direct                 

          ...  

          04:58:37    18613336    41.27 35.16 6.1   1     11252 8     11252 74676420    0      9     mumps Unclassified                 cbsadm      /cbsprod/gtm_dist/mumps -direct                 

          04:59:37    18613336    42.33 36.07 6.25  1     11252 8     11252 75298145    0      10    mumps Unclassified                 cbsadm      /cbsprod/gtm_dist/mumps -direct                 

          05:00:37    18613336    41.4  35.14 6.26  1     11252 8     11252 74384992    0      10    mumps Unclassified                 cbsadm      /cbsprod/gtm_dist/mumps -direct                 

          05:01:37    18613336    41.62 35.42 6.2   1     11252 8     11252 73875555    0      11    mumps Unclassified                 cbsadm      /cbsprod/gtm_dist/mumps -direct                 

          05:02:37    18613336    40.35 34.06 6.28  1     11252 8     11252 71585427    0      12    mumps Unclassified                 cbsadm      /cbsprod/gtm_dist/mumps -direct                 

          ..

          05:24:37    18613336    40.42 35.6  4.82  1     11668 8     11668 68027121    0      381   mumps Unclassified                 cbsadm      /cbsprod/gtm_dist/mumps -direct                 

          05:25:37    18613336    26.31 22.87 3.44  1     11680 8     11680 43052669    0      362   mumps Unclassified                 cbsadm      /cbsprod/gtm_dist/mumps -direct                        

     

    CPU_ALL(CPU%)

     

          CPU Total   User% Sys%  Wait% Idle% Busy  PhysicalCPUs      CPU%

          04:24:37    1.2   1.9   0.7   96.1  3.1   64                3.1

          04:25:37    1.4   2.5   1.2   94.9  3.9   64                3.9

          04:26:37    1.4   2.5   1.2   94.9  3.9   64                3.9

          ...

          04:50:36    4.3   4.3   1.3   90.1  8.6   64                8.6

          04:51:36    4.2   4.5   1.2   90.2  8.6   64                8.7

          04:52:36    4.4   4.8   1.2   89.6  9.2   64                9.2

          ...

          05:05:36    4.4   6.1   1.8   87.7  10.5  64                10.5

          05:06:36    4.8   4.9   1.8   88.5  9.7   64                9.7

          05:07:36    4.4   5.1   1.7   88.8  9.5   64                9.5

          ...

          05:25:37    3.4   3.3   0.8   92.4  6.7   64                6.7

          05:32:37    1.7   2     0.5   95.8  3.7   64                3.7

          05:33:37    1.6   2.1   0.5   95.8  3.7   64                3.7

          05:34:37    1.5   1.9   0.5   96.1  3.4   64                3.4

     

     

    Best Regards,

     

     

    Charin Kumjudpai

    388 SP Building, Phayathai,

     

    Phayathai, Bangkok 10400

    --------------------------------------------------

    Thailand

     

    Unreasonable Effectiveness 

    OR

    Reasonable Ineffectiveness

    --------------------------------------------------

     

    Phone:

    +662-298-3509

     

     

    Mobile:

    +668-1-701-9346

     

     

    Email:

    charin@th.ibm.com

     

     

     

     

     

     

     

     

     

     

     

     

     






  • 5.  RE: The raw nmon data about to "%CPU Used (The percentage of the processor that is used in the last interval.)" How nmon calcuate for each interval time?

    Posted Tue May 30, 2023 04:34 AM

    Hi,
    CPU is reported in two ways:
    1) CPU statistics for the server or virtual machine - 100% represents all the CPUs in the server or virtual machine.
    2) CPU statistics for processes - 100% represents a CPU or something called CPU core.

    nmon has always reported CPU this way and for good reasons.

    Go to https://nmon.sourceforge.net/pmwiki.php?n=Site.NmonFAQ and read Question 26.

    I hope this answers your question.

    Please note the nmon Analyser is not an IBM product and is not supported by IBM.
    The download site is now https://nmon.sourceforge.net/pmwiki.php?n=Site.Nmon-Analyser

    Which includes: 

    • The nmon Analyser is not officially supported by IBM and no warranty is given or implied. Use it at your own risk.


    ------------------------------
    Nigel Griffiths
    ------------------------------



  • 6.  RE: The raw nmon data about to "%CPU Used (The percentage of the processor that is used in the last interval.)" How nmon calcuate for each interval time?

    Posted Tue May 30, 2023 05:13 AM

    Dear Nigel Griffiths,

     

    Thank you so much sir for response for our customer as customer requires.

     

    I am afraid the answer for question 26, is could not be used to reference or meet our customer question.

    May I bother you again, could you please review me explain below and customer question again.

     

    Customer question is :  

    How NMON analyzer calculated the TOP(%CPU) and CPU_ALL(CPU%)?

              Because the values of %CPU in TOP and CPU% in CPU_ALL are much differ.

     

     

    Here is the detail.

    1. User the "nmon analyser v69_2.xlsm" to generate graph from raw nmon data. Then save in excel file.
    2. On TOP worksheet, there 2 columns customer is needs to know and clarify, Col-B is "PID" and Col-C is "%CPU" as shown in graphic below.

     

     

    1. On CPU_ALL worksheet, there 1 column customer is needs to know and clarify, Col-J is "CPU%" as shown in graphic below.

     

     

    1. Then customer compared value between TOP (%CPU) and CPU_ALL (CPU%) are much differ.  And customer would like to know how those values calculated or collected?

     

     

     

    Best Regards,

     

     

    Charin Kumjudpai

    388 SP Building, Phayathai,

     

    Phayathai, Bangkok 10400

    --------------------------------------------------

    Thailand

     

    Unreasonable Effectiveness 

    OR

    Reasonable Ineffectiveness

    --------------------------------------------------

     

    Phone:

    +662-298-3509

     

     

    Mobile:

    +668-1-701-9346

     

     

    Email:

    charin@th.ibm.com

     

     

     

     

     

     

     

     

     

     

     

     

     

     






  • 7.  RE: The raw nmon data about to "%CPU Used (The percentage of the processor that is used in the last interval.)" How nmon calcuate for each interval time?

    Posted Wed May 31, 2023 04:47 AM

    Hi
    Process stats are captured using the getproces64() system call.

    As previously stated 100% for each CPU in the VM. I see the VM has 64 CPUs to the maximum for a VERY threaded application using all CPUs is 6400%

    CPU Utilisation stats are captured using the libperfstat functions.

    As previously stated 100% is for all the CPU in the VM.

    Read this article for details of capturing AIX performance stats with works example code in the C language.

    Check the AIX manuals for details.

    Please get your customer to read https://www.ibm.com/docs/en/aix/7.3?topic=n-nmon-command
    But note that I agree that the units for these stats are not very clear.

    As the developer of nmon, I think you just have to trust what I say.

    On the CPU_ALL picture above note that the CPU User% + CPU Sys% =  CPU Busy% = CPU%
    The top line is 4.1 + 4.4 = 8.5

    I think the Analyser does slightly different things for different virtual machine types: shared CPU, dedicated CPU and donating CPU modes/


    The nmon Analyser is an Excel spreadsheet with its Microsoft Visual BASIC code that is fully available for users to read and learn.
    The nmon Analyser is not supported as the developer retired.  It was a personal time project and shared "at your own risk" warnings.

    I do not know Microsoft Visual BASIC so there is no point in asking me.



    ------------------------------
    Nigel Griffiths
    ------------------------------



  • 8.  RE: The raw nmon data about to "%CPU Used (The percentage of the processor that is used in the last interval.)" How nmon calcuate for each interval time?

    Posted Wed May 31, 2023 07:51 AM

    Dear Nigel Griffiths,

     

    I would like to say, " THANK YOU SO MUCH SIR."  For reply my email with the answered our customer question.

     

     

    Best Regards,

     

     

    Charin Kumjudpai

    388 SP Building, Phayathai,

     

    Phayathai, Bangkok 10400

    --------------------------------------------------

    Thailand

     

    Unreasonable Effectiveness 

    OR

    Reasonable Ineffectiveness

    --------------------------------------------------

     

    Phone:

    +662-298-3509

     

     

    Mobile:

    +668-1-701-9346

     

     

    Email:

    charin@th.ibm.com