Re: Which thread consumes the most CPU time?
Posted in 2005
Wait statistics tells you the time in microseconds that threads spent in
several different run states: running, ready to run, waiting for
buffers, etc.
To get the time for state running, you can use the sql that
roeferr@ig.com.br just sent (I modified it a little):
database sysmaster ;select
username,hostname,
syssessions.sid, sysopendb.odb_dbname[1,10],
sum(cumtime)/1000000 cpu_time
from syssessions, sysopendb, sysseswts
where
and syssessions.sid= sysopendb.odb_sessionid
and sysopendb.odb_iscurrent = 'Y'
and syssessions.sid=sysseswts.sid
and reason='running'
group by
syssessions.sid,username,hostname,connected,sysopendb.odb_dbname
-- having sum(cumtime)/1000000 > 1
order by 5 DESC;
Christian Eriksson wrote:
> What does wait statistics tell me? Is wait statistics covered in the manuals?
>
> Regards Christian Eriksson
>
> Michael Mueller <m.mueller01.delete_me@kay-mueller.de> wrote in message news:<42160A07.4090302@kay-mueller.de>...
>
>>Onstat -g act is probably the simplest.
>>
>>But you also can use wait statistics. Set "WSTATS 1" in onconfig and use
>>"onstat -g wst" or select from sysmaster:sysseswts.
>>
>>Michael
>>
>>Bill Dare wrote:
>>
>>>You have to monitor onstat -g act and see which sessions are active most
>>>often. A session is identified by the rstcb column. On a busy system
>>>with multiple CPUs this becomes quite a task. I have a shell script I
>>>use to monitor active threads and display a sorted list of the most
>>>active sessions. I use it when I have CPU usage problems. If you are on
>>>unix and want a copy, let me know.
>>>
>>>Bill
>>>
>>>
>>>
>>>
>>>>-----Original Message-----
>>>>From: owner-informix-list@iiug.org [SMTP:owner-informix-list@iiug.org]
>>>>On Behalf Of Christian Eriksson
>>>>Sent: Friday, February 18, 2005 4:56 AM
>>>>To: informix-list@iiug.org
>>>>Subject: Which thread consumes the most CPU time?
>>>>
>>>>Hi!
>>>>
>>>>I'm looking for some diagnostics in situations when the database
>>>>server's processes (oninit) starts to consume more CPU time.
>>>>
>>>>Is it possible to see which thread have consumed the most of the
>>>>Database Server's CPU time for, let's say, the last 10 minutes?
>>>>
>>>>Regards Christian Eriksson
>>>
>>>
>>>sending to informix-list