Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Josef Albert asked how to see current CPU usage per session, not CPU time since session start. Vladimir Kolobrodov suggested watching onstat -g ath for running threads and mapping them via onstat -g ses 0, or onstat -g cpu. Alexandre Marini and Art Kagel pointed to onstat -g top (14.10), e.g. onstat -g top session cpu. Andreas Legner suggested repeating onstat -g ses running.
Auto-generated by Claude from the posts below — may be imperfect; read the full thread.
Josef Albert — source: IBM Community (ConnectedCommunity.org) Informix forum
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
------------------------------
#Informix
↪ replying to Josef Albert
Vladimir Kolobrodov — source: IBM Community (ConnectedCommunity.org) Informix forum
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
------------------------------
↪ replying to Vladimir Kolobrodov
Alexandre Marini — source: IBM Community (ConnectedCommunity.org) Informix forum
You can use the new
Onstat -g top
(Available on 14.10 version)
Alexandre Marini
↪ replying to Josef Albert
Art Kagel — source: IBM Community (ConnectedCommunity.org) Informix forum
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
------------------------------
↪ replying to Josef Albert
Andreas Legner — source: IBM Community (ConnectedCommunity.org) Informix forum
onstat -g ses runningor, if you want to show to support:
onstat -g ses RunningRepeat this to determine those session running the most.
------------------------------
Andreas Legner
------------------------------
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.