Informix

Expand all | Collapse all

CPU usage per session

  • 1.  CPU usage per session

    Posted Thu March 18, 2021 11:31 AM
    Hi,

    is there any way to get the cpu usage per session?

    I don't want the CPU time since the session starts like here:
    How to isolate High CPU usage for Informix

    I want to see the current cpu usage / session to find the sessions causing the cpu to run at 100%.
    Or is there any other way to determine these sessions?

    Joe

    ------------------------------
    Josef Albert
    ------------------------------


  • 2.  RE: CPU usage per session

    Posted Thu March 18, 2021 11:51 AM

    The session which burns CPU will have threads predominantly in "running" state. 

    It's very unlikely that single thread (session) will use 100% of ALL system's CPUs.

    Quick look at the overall picture in real time can be observed with something like this:

        onstat -g ath -r 1 | grep sqlexec | egrep 'Informix|running'

    or, if CPU is consumed not by user sessions -

        onstat -g ath -r 1 | egrep 'Informix|running'

    Once you identify continuously running threads - you can trace these to sessions using output from "onstat -g ses 0" - and that will likely to have current SQL for that session too.

    Any reason "onstat -g cpu" does not work for you as a starting point ?



    ------------------------------
    Vladimir Kolobrodov
    ------------------------------



  • 3.  RE: CPU usage per session

    Posted Thu March 18, 2021 12:35 PM
    You can use the new
    Onstat -g top
    (Available on 14.10 version)

    Alexandre Marini





  • 4.  RE: CPU usage per session

    Posted Thu March 18, 2021 12:35 PM
    Try:

    onstat -g top session cpu <nlines> <intrvl> <numruns>

    Similar to sar & mpstat

    ------------------------------
    Art S. Kagel, President and Principal Consultant
    ASK Database Management Corp.
    www.askdbmgt.com
    ------------------------------



  • 5.  RE: CPU usage per session

    Posted Thu March 18, 2021 12:40 PM
    onstat -g ses running

    or, if you want to show to support:

    onstat -g ses Running

    Repeat this to determine those session running the most.

    ------------------------------
    Andreas Legner
    ------------------------------