RAC interconnect traffic
http://gjilevski.com/2011/08/02/oracle-cache-fusion-private-inter-connects-and-practical-performance-management-considerations-in-oracle-rac/
http://www.datadisk.co.uk/html_docs/rac/performance.htm
@/tmp/latchprofx.sql name,ksllwnam,ksllwlbl % % 100000
DEF _lhp_what="&1"
DEF _lhp_sid="&2"
DEF _lhp_name="&3"
DEF _lhp_samples="&4"
COL name FOR A35 TRUNCATE
COL latchprof_total_ms HEAD "Held ms" FOR 999999.999
COL latchprof_pct_total_samples head "Held %" format 999.99
COL latchprof_avg_ms HEAD "Avg hold ms" FOR 999999.999
COL dist_samples HEAD Gets
COL total_samples HEAD Held
COL ksllwnam FOR A40 TRUNCATE
COL ksllwlbl FOR A20 TRUNCATE
COL objtype FOR A20 TRUNCATE
COL object FOR A17 WRAP JUST RIGHT
COL hmode FOR A12 TRUNCATE
COL what FOR A17 WRAP
COL func FOR A40 TRUNCATE
BREAK ON lhp_name SKIP 1
DEF _IF_ORA_10_OR_HIGHER="--"
PROMPT
PROMPT -- LatchProfX 2.02
COL latchprof_oraversion NEW_VALUE _IF_ORA_10_OR_HIGHER
SET TERMOUT OFF
SELECT
DECODE(SUBSTR(BANNER, INSTR(BANNER, 'Release ')+8,1), 1, '', '--') latchprof_oraversion
FROM v$version WHERE ROWNUM=1;
SET TERMOUT ON
WITH
t1 AS (SELECT hsecs FROM v$timer),
samples AS (
SELECT /*+ ORDERED USE_NL(l.x$ksuprlat) USE_NL(s.x$ksuse) NO_TRANSFORM_DISTINCT_AGG */
&_lhp_what
&_IF_ORA_10_OR_HIGHER , COUNT(DISTINCT gets) dist_samples
, COUNT(*) total_samples
, COUNT(*) / &_lhp_samples total_samples_pct
FROM
(SELECT /*+ NO_MERGE */ 1 FROM DUAL CONNECT BY LEVEL <= &_lhp_samples) s,
(SELECT ksuprpid PID, ksuprsid SID, ksuprlnm NAME, ksuprlat LADDR, ksulawhr,
TO_CHAR(ksulawhy,'XXXXXXXXXXXXXXXX') object
&_IF_ORA_10_OR_HIGHER , ksulagts GETS
&_IF_ORA_10_OR_HIGHER , lower(ksuprlmd) HMODE
FROM x$ksuprlat) l,
(SELECT
indx
, ksusesqh sqlhash
, ksusesql sqladdr
&_IF_ORA_10_OR_HIGHER , ksusesph planhash
&_IF_ORA_10_OR_HIGHER , ksusesch sqlchild
&_IF_ORA_10_OR_HIGHER , ksusesqi sqlid
FROM x$ksuse) s,
(SELECT indx,
ksllwnam func, ksllwnam,
ksllwlbl objtype, ksllwlbl
FROM x$ksllw) w
WHERE
l.sid LIKE '&_lhp_sid'
AND l.ksulawhr = w.indx (+)
AND l.sid = s.indx
AND (LOWER(l.name) LIKE LOWER('%&_lhp_name%') OR LOWER(RAWTOHEX(l.laddr)) LIKE LOWER('%&_lhp_name%'))
GROUP BY
&_lhp_what
ORDER BY
total_samples DESC
),
t2 AS (SELECT hsecs FROM v$timer)
SELECT /*+ ORDERED */
&_lhp_what
, s.total_samples
&_IF_ORA_10_OR_HIGHER , s.dist_samples
-- , s.total_samples_pct
, s.total_samples / &_lhp_samples * 100 latchprof_pct_total_samples
, (t2.hsecs - t1.hsecs) * 10 * s.total_samples / &_lhp_samples latchprof_total_ms
-- , s.dist_events
&_IF_ORA_10_OR_HIGHER , (t2.hsecs - t1.hsecs) * 10 * s.total_samples / dist_samples / &_lhp_samples latchprof_avg_ms
FROM
t1,
samples s,
t2
WHERE ROWNUM <= 20
/
COL name CLEAR
COL hmode CLEAR
COL what CLEAR
COL func CLEAR
COL objtype CLEAR
http://www.datadisk.co.uk/html_docs/rac/performance.htm
@/tmp/latchprofx.sql name,ksllwnam,ksllwlbl % % 100000
DEF _lhp_what="&1"
DEF _lhp_sid="&2"
DEF _lhp_name="&3"
DEF _lhp_samples="&4"
COL name FOR A35 TRUNCATE
COL latchprof_total_ms HEAD "Held ms" FOR 999999.999
COL latchprof_pct_total_samples head "Held %" format 999.99
COL latchprof_avg_ms HEAD "Avg hold ms" FOR 999999.999
COL dist_samples HEAD Gets
COL total_samples HEAD Held
COL ksllwnam FOR A40 TRUNCATE
COL ksllwlbl FOR A20 TRUNCATE
COL objtype FOR A20 TRUNCATE
COL object FOR A17 WRAP JUST RIGHT
COL hmode FOR A12 TRUNCATE
COL what FOR A17 WRAP
COL func FOR A40 TRUNCATE
BREAK ON lhp_name SKIP 1
DEF _IF_ORA_10_OR_HIGHER="--"
PROMPT
PROMPT -- LatchProfX 2.02
COL latchprof_oraversion NEW_VALUE _IF_ORA_10_OR_HIGHER
SET TERMOUT OFF
SELECT
DECODE(SUBSTR(BANNER, INSTR(BANNER, 'Release ')+8,1), 1, '', '--') latchprof_oraversion
FROM v$version WHERE ROWNUM=1;
SET TERMOUT ON
WITH
t1 AS (SELECT hsecs FROM v$timer),
samples AS (
SELECT /*+ ORDERED USE_NL(l.x$ksuprlat) USE_NL(s.x$ksuse) NO_TRANSFORM_DISTINCT_AGG */
&_lhp_what
&_IF_ORA_10_OR_HIGHER , COUNT(DISTINCT gets) dist_samples
, COUNT(*) total_samples
, COUNT(*) / &_lhp_samples total_samples_pct
FROM
(SELECT /*+ NO_MERGE */ 1 FROM DUAL CONNECT BY LEVEL <= &_lhp_samples) s,
(SELECT ksuprpid PID, ksuprsid SID, ksuprlnm NAME, ksuprlat LADDR, ksulawhr,
TO_CHAR(ksulawhy,'XXXXXXXXXXXXXXXX') object
&_IF_ORA_10_OR_HIGHER , ksulagts GETS
&_IF_ORA_10_OR_HIGHER , lower(ksuprlmd) HMODE
FROM x$ksuprlat) l,
(SELECT
indx
, ksusesqh sqlhash
, ksusesql sqladdr
&_IF_ORA_10_OR_HIGHER , ksusesph planhash
&_IF_ORA_10_OR_HIGHER , ksusesch sqlchild
&_IF_ORA_10_OR_HIGHER , ksusesqi sqlid
FROM x$ksuse) s,
(SELECT indx,
ksllwnam func, ksllwnam,
ksllwlbl objtype, ksllwlbl
FROM x$ksllw) w
WHERE
l.sid LIKE '&_lhp_sid'
AND l.ksulawhr = w.indx (+)
AND l.sid = s.indx
AND (LOWER(l.name) LIKE LOWER('%&_lhp_name%') OR LOWER(RAWTOHEX(l.laddr)) LIKE LOWER('%&_lhp_name%'))
GROUP BY
&_lhp_what
ORDER BY
total_samples DESC
),
t2 AS (SELECT hsecs FROM v$timer)
SELECT /*+ ORDERED */
&_lhp_what
, s.total_samples
&_IF_ORA_10_OR_HIGHER , s.dist_samples
-- , s.total_samples_pct
, s.total_samples / &_lhp_samples * 100 latchprof_pct_total_samples
, (t2.hsecs - t1.hsecs) * 10 * s.total_samples / &_lhp_samples latchprof_total_ms
-- , s.dist_events
&_IF_ORA_10_OR_HIGHER , (t2.hsecs - t1.hsecs) * 10 * s.total_samples / dist_samples / &_lhp_samples latchprof_avg_ms
FROM
t1,
samples s,
t2
WHERE ROWNUM <= 20
/
COL name CLEAR
COL hmode CLEAR
COL what CLEAR
COL func CLEAR
COL objtype CLEAR
NAME KSLLWNAM KSLLWLBL Held Gets Held % Held ms Avg hold ms
----------------------------------- ---------------------------------------- -------------------- ---------- ---------- ------- ----------- -----------
ges resource hash list kjrmas1: lookup master node 86203 36070 86.20 29179.716 .809
ges resource hash list kjlrlr: remove lock from resource queue 15166 2751 15.17 5133.691 1.866
ges process parent latch kjata_fg 10625 10591 10.63 3596.563 .340
cache buffers chains kcbgcur_2 7195 7035 7.20 2435.508 .346
redo copy kcrfw_redo_gen: nowait latch 5798 5746 5.80 1962.623 .342
cache buffers chains kcbgtcr: fast path 4994 4976 4.99 1690.469 .340
ges process parent latch kjlrem: detach lock from group 4802 4733 4.80 1625.477 .343
ges resource hash list kjrref: find matched resource 4657 4175 4.66 1576.395 .378
enqueue hash chains ksqcmi: if lk mode requested 4561 4559 4.56 1543.899 .339
ges process parent latch kjatioc 4359 4353 4.36 1475.522 .339
ges process parent latch kjlalc: lock allocation from lmon 4329 2565 4.33 1465.367 .571
enqueue hash chains ksqgtl3 acquiring session 3476 3422 3.48 1176.626 .344
ges resource hash list kjakoca: search for resp by resname 3337 3038 3.34 1129.575 .372
enqueue hash chains ksqrcl resource addr 3119 3115 3.12 1055.782 .339
cache buffers chains kcbrls_2 2002 1929 2.00 677.677 .351
ges enqueue table freelist kjlalc: lock allocation 1567 584 1.57 530.430 .908
cache buffers chains kcbzwb 1537 1459 1.54 520.275 .357
ges process parent latch kjucll: closing lock 1386 1386 1.39 469.161 .339
flashback copy krfgdata1 1074 369 1.07 363.549 .985
cache buffers chains kcbget: fast exchange 1058 1049 1.06 358.133 .341
20 rows selected.
----------------------------------- ---------------------------------------- -------------------- ---------- ---------- ------- ----------- -----------
ges resource hash list kjrmas1: lookup master node 86203 36070 86.20 29179.716 .809
ges resource hash list kjlrlr: remove lock from resource queue 15166 2751 15.17 5133.691 1.866
ges process parent latch kjata_fg 10625 10591 10.63 3596.563 .340
cache buffers chains kcbgcur_2 7195 7035 7.20 2435.508 .346
redo copy kcrfw_redo_gen: nowait latch 5798 5746 5.80 1962.623 .342
cache buffers chains kcbgtcr: fast path 4994 4976 4.99 1690.469 .340
ges process parent latch kjlrem: detach lock from group 4802 4733 4.80 1625.477 .343
ges resource hash list kjrref: find matched resource 4657 4175 4.66 1576.395 .378
enqueue hash chains ksqcmi: if lk mode requested 4561 4559 4.56 1543.899 .339
ges process parent latch kjatioc 4359 4353 4.36 1475.522 .339
ges process parent latch kjlalc: lock allocation from lmon 4329 2565 4.33 1465.367 .571
enqueue hash chains ksqgtl3 acquiring session 3476 3422 3.48 1176.626 .344
ges resource hash list kjakoca: search for resp by resname 3337 3038 3.34 1129.575 .372
enqueue hash chains ksqrcl resource addr 3119 3115 3.12 1055.782 .339
cache buffers chains kcbrls_2 2002 1929 2.00 677.677 .351
ges enqueue table freelist kjlalc: lock allocation 1567 584 1.57 530.430 .908
cache buffers chains kcbzwb 1537 1459 1.54 520.275 .357
ges process parent latch kjucll: closing lock 1386 1386 1.39 469.161 .339
flashback copy krfgdata1 1074 369 1.07 363.549 .985
cache buffers chains kcbget: fast exchange 1058 1049 1.06 358.133 .341
20 rows selected.
Below views provide the current hardware configuration:
Then there are multiple views providing the amount of blocks (data, undo, …) exchanged between cluster instances:
If you are wondering the difference between CR and current blocks it is clearly explained in Oracle documentation:
The Global Cache Block Access Latency chart shows data for two different types of data block requests: current and consistent-read (CR) blocks. When you update data in the database, Oracle Database must locate the most recent version of the data block that contains the data, which is called the current block. If you perform a query, then only data committed before the query began is visible to the query. Data blocks that were changed after the start of the query are reconstructed from data in the undo segments, and the reconstructed data is made available to the query in the form of a consistent-read block.
As those table contains figures since the instance started it is not easily usable to get the interconnect traffic which is an amount of information over a period of time. I was also tempted to sum GC CR Block Received Per Second and GC Current Block Received Per Second from V$SYSMETRIC_HISTORY table.
But as explained around on Internet this would not take into account the size of messages exchanged by cluster instances. The formula can be finally find insprepins.sql file located in $ORACLE_HOME/rdbms/admin directory. This file is script to generate Statspack reports.
This can be verified in an AWR report…
The bad news is that figures are available in GV$SYSSTAT and GV$GES_STATISTICS (or GV$DLM_MISC if you have not executed$ORACLE_HOME/rdbms/admin/catclust.sql script). Means that we will have to subtract figures to compute the interconnect throughput.
Remark:
Even if Oracle takes 200 bytes as GCS/GES message size there could be a formula to compute it but nothing confirmed officially:
Even if Oracle takes 200 bytes as GCS/GES message size there could be a formula to compute it but nothing confirmed officially:
Last but not least the above formula does not take into account the MTU of network interface:
Conclusion could be that crosschecking figures at OS level (RX / TX) versus the ones of Oracle is anyway interesting…
Script
So all is turning around this query:
To compute interconnect transfer rate you have to execute the above query 2 times and divide the result by the elapsed time. In a more advanced script it gives:
If you want to recompute what you find in an AWR report you can use DBA_HIST_DLM_MISC and DBA_HIST_SYSSTAT hsitory tables.
Performance queries
Global Cache Service processes (LMS) statistics:
Latency of interconnect messages:
Interesting one coming from racdiag.sql script:
Comments
Post a Comment
Oracle DBA Information