I have a server with poor performance.I have checked the TOP and found that one of the process was taking 90% CPU time.I was unable to track that session with PID.I guess that might be unix process.Is there anyway we track the session using the PID of the process from top command.
as i was thinking about that...it's not a good solution. Becasue thread from one session can run on several virtual processors(of course not at the same time). So I think if you have more VP of the same class... there is no direct way how to assign informix session to the operating system process number.
Thanks for your reply,I have tried to find out but I could not trace that session bacause there were many VP's running in the same class.But if we can exactly figure out that session(which is taking 95% CPU time from top)that would really help me..
This code, are not exactly a shell, I just write the logic to get the thread where use more CPU.
The Idea above is repeat the commant "onstat -g act" 60 times and see who appear more time...
but, remember , you will get the thread number, you still need identificate the session id of this thread what can be do with this SQL:
select us_tid as tid , us_sid as sid , us_name as user from sysuserthreads
ceinma is right...and just for info,
you can idenfificate the session id from "onstat -g act" output also by comparing column "address" in "onstat - u" with column "rstcb" in "onstat -g act" (if they are user threads) ....as i mentioned before. So you don't have to use system tables.