How to calculate CPU % used for Instance in Statspack report ?
Sample Statspack report :
Database DB Id Instance Inst Num Startup Time Release RAC
~~~~~~~~ ----------- ------------ -------- --------------- ----------- ---
11223344 ABCD 1 11-Aug-22 11:34 12.1.0.2.0 NO
Host Name Platform CPUs Cores Sockets Memory (G)
~~~~ ---------------- ---------------------- ----- ----- ------- ------------
test01 Solaris Operating Syst 4 4 2 320.0
Snapshot Snap Id Snap Time Sessions Curs/Sess Comment
~~~~~~~~ ---------- ------------------ -------- --------- ------------------
Begin Snap: 113 11-Dec-22 02:00:05 44 1.1
End Snap: 114 11-Dec-22 03:00:10 50 1.1
Elapsed: 60.08 (mins) Av Act Sess: 1.1
DB time: 63.19 (mins) DB CPU: 63.11 (mins)
Top 5 Timed Events Avg %Total
~~~~~~~~~~~~~~~~~~ wait Call
Event Waits Time (s) (ms) Time
----------------------------------------- ------------ ----------- ------ ------
LGWR worker group idle 2,592 7,632 2945 34.4
CPU time 3,698 16.7
heartbeat redo informer 3,604 3,605 1000 16.3
lreg timer 1,261 3,604 2858 16.3
AQPC idle 120 3,601 30010 16.2
CPU Time used 3698 s
Total CPU : NUM_cpu * elapsed_time *60
num_cpu can be found from operating system statistics
4*60.08*60= 14419.2s for 3600s DB time
total % of cpu used by Oracle process : 3698/14419 *100 = 25.64 %
Database only used approx. 26% of cpu
calculate cpu consumption from OS perspective :
==========================================================
OS Statistics DB/Inst: test/test Snaps: 113-114
-> ordered by statistic type (CPU use, Virtual Memory, Hardware Config), Name
Statistic Total
------------------------- ----------------------
BUSY_TIME 411,086
IDLE_TIME 1,030,890
SYS_TIME 30,330
USER_TIME 380,756
OS_CPU_WAIT_TIME 784,200
RSRC_MGR_CPU_WAIT_TIME 0
PHYSICAL_MEMORY_BYTES 343,560,974,336
NUM_CPUS 4
NUM_CPU_CORES 4
NUM_CPU_SOCKETS 2
TCP_RECEIVE_SIZE_DEFAULT 256,000
TCP_RECEIVE_SIZE_MAX 1,048,576
TCP_SEND_SIZE_DEFAULT 49,152
TCP_SEND_SIZE_MAX 1,048,576
Host CPU (CPUs: 4 Cores: 4 Sockets: 2)
~~~~~~~~ Load Average
Begin End User System Idle WIO WCPU
------- ------- ------- ------- ------- ------- --------
1.20 1.33 26.41 2.10 71.49 0.00 54.38
= user+ System
26.41 + 2.10 = 28.51
Instance CPU
~~~~~~~~~~~~ % Time (seconds)
-------- --------------
Host: Total time (s): 14,419.8
Host: Busy CPU time (s): 4,110.9
% of time Host is Busy: 28.5
Instance: Total CPU time (s): 3,846.6
% of Busy CPU used for Instance: 93.6
Instance: Total Database time (s): 3,889.2
%DB time waiting for CPU (Resource Mgr): 0.0
16 cpu * 30/100 = 5 cpu
%Busy_time = { busy_time/(busy_time+Idele_time)*100
411086
+1030890
==========
1441976
= (411086/1441976) *100 = 28.50
Busy_time= SYS_time + USER_TIME
30330
+ 380756
==============
411086
% SYS time = (sys_time/busy_time ) *100 = (30330/411086) *100 = 7.3 out of %Busy_time : 28.51
% User time= (user_time/busy_time) * 100 = 92.62 out of %Busy_time : 28.51
No comments:
Post a Comment