728x90

Question

How to determine the number of concurrent users/sessions on Informix server?

Answer

Run this SQL command:

select sh_curmaxcons, sh_ovlmaxcons from sysmaster:sysshmvals;

sh_curmaxcons - updated as new connections are made, reset after a bounce. This means that the value will reset for each shut down and start up of the server. 

sh_ovlmaxcons - updated at each checkpoint, persists over bounces, and upgrades. The ovlmaxcons value is initialized the first time you INSTALL the server. Thereafter, the maximum # of connections is recorded in the sysmaster database. Even after an upgrade from 9.4 to 10.0, that value will not be reset or lost. 


위 쿼리는 인포믹스 9.4 버전 이상에서 적용된다.

인포믹스 포럼을 살펴보니 현재 세션 개수를 확인하는 쿼리는 다음과 같다. 모든 버전에서 확인 가능하다.

select count(*) concurrentsessions
from sysmaster:sysrstcb
where sysmaster:bitval(flags,1)>0 { only count busy threads }
and sysmaster:bitval(flags,'0x80000')!=0 { only count primary threads }
and sysmaster:bitval(flags,'0x200')==0 { remove daemon threads}
and sysmaster:bitval(flags,'0x40')==0 { remove log backup users }
and sysmaster:bitval(flags,'0x80')==0 { remove onmonitor users }
and sysmaster:bitval(flags,'0x2000')==0 { remove page cleaners}
and sysmaster:bitval(flags,'0x00000400')==0 { remove archive threads}
and sysmaster:bitval(flags,'0x00004000')==0 { remove recovery threads}
and sysmaster:bitval(flags,'0x00100000')==0 { remove idx blder }
and sysmaster:bitval(flags,'0x00200000')==0 { remove btree scanner }
and sysmaster:bitval(flags,'0x04000000')==0 { remove main loop}
and flags < '0x20000000';

http://www-01.ibm.com/support/docview.wss?uid=swg21440286

https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14696424

http://www.ibm.com/developerworks/forums/thread.jspa?messageID=14697676


728x90

+ Recent posts