Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
The 
most 
important 
trick 
of 
performance 
instrumentation 
Cary 
Millsap 
Accenture 
Enkitec 
Group 
and 
Method 
R 
C...
@CaryMillsap 
Performance is not an 
attribute of a system. 
2
ID USERNAME MODULE START_TIME R SLR 
-- -------- ------- -------------------------- ----- --- 
1 FCHANG OE BOOK 2014-09-15...
ID USERNAME MODULE R SLR FAST? 
-- -------- ------- ----- --- ----- 
1 FCHANG OE BOOK 2.019 2.0 N 
2 RSMITH OE SHIP 3.528 ...
@CaryMillsap 
Performance is an attribute of 
each individual experience 
with a system. 
5
EXPERIENCE 
• id 
• task-id 
• user-id 
• ip-address 
• start-time 
• end-time 
• ERROR-code 
• WORK-done 
TASK 
• id 
• n...
@CaryMillsap 
The “trick”... 
7
@CaryMillsap 
Each 
experience 
gets its own 
unique id. 
8
@CaryMillsap 
That’s 
it. 
9
@CaryMillsap 
Each 
experience 
gets its own 
unique id. 
10
@CaryMillsap 
You 
need 
to 
see 
this 
experience 
id 
in 
your 
session’s 
v$ 
data 
and 
your 
trace 
data. 
11 
❶ 
❷
@CaryMillsap 
Implementation? 
12
T 
UNDER CONSTRUCTION 
@CaryMillsap 13
dbms_application_info.set_module( 
module_name 
=> 'OE BOOK', 
action_name 
=> sys_guid() -- 32-char hex string 
); 
-- Yo...
conn.ModuleName = "OE BOOK"; 
conn.ActionName = Guid.NewGuid().toString(); 
// Your ‘book order’ code 
conn.ModuleName = "...
String metrics[] = new 
String[OraCxn.END_TO_END_STATE_INDEX_MAX]; 
metrics[END_TO_END_MODULE_INDEX] = "OE BOOK"; 
metrics...
17
setClientInfo method supports JDBC DMS metrics 
setEndToEndMetrics is deprecated 
DBOP tag can be associated with applicat...
19 
Oh, and... 
module and action lengths are limited by JDBC 
(Thanks Lasse Jenssen)
@CaryMillsap 
Postscript 
A 
UUID 
in 
canonical 
form 
is 
36 
characters 
long 
(32 
lowercase 
hexadecimal 
characters ...
@CaryMillsap 
What you get 
21
experience 
id 
(PK) 
USERNAME MODULE_NAME ACTION_NAME START_TIME 
-------- ----------- -------------------------------- -...
DBMS_MONITOR.SERV_MOD_ACT_TRACE_ENABLE( 
MODULE_NAME => 'OE BOOK', 
ACTION_NAME => ANY_ACTION // default 
) 
USERNAME MODU...
@CaryMillsap 
*** CLIENT ID:(10.17.21.198 FCHANG) ... 
*** MODULE NAME:(OE BOOK) ... 
*** ACTION NAME:(4a782ce58c4c4629905...
ACTION Trace file line 
------------- ----------------------------------------------------------- 
@CaryMillsap 
*** CLIEN...
$ mrskew --group='"$act $mod $client_id"' ... --top=10 *trc 
ACTION MODULE CLIENT_ID DURATION % CALLS MEAN MIN -----------...
$ mrskew --group='"$act $mod $client_id"' ... --top=10 *trc 
ACTION MODULE CLIENT_ID DURATION % CALLS MEAN MIN -----------...
@CaryMillsap 
Each 
experience 
gets its own 
unique id. 
28
@CaryMillsap 
...So you can 
measure and diagnose 
what people feel. 
29
@CaryMillsap 
...So you can 
measure and diagnose 
performance. 
30
@CaryMillsap 
For 
more... 
http://amzn.to/173bpzg 
31
@CaryMillsap 
Fin 
32
Upcoming SlideShare
Loading in …5
×

Most important "trick" of performance instrumentation

1,338 views

Published on

This is the material from my 10-minute TED-style talk 2014-09-29 at OakTable World held in conjunction with Oracle OpenWorld 2014 in San Francisco. It explains the importance of assigning a unique id to the Oracle Database code path associated with each performance experience that users can have with your system

Published in: Software
  • http://dbmanagement.info/Tutorials/PLSQL.htm
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Most important "trick" of performance instrumentation

  1. 1. The most important trick of performance instrumentation Cary Millsap Accenture Enkitec Group and Method R Corporation @CaryMillsap OakTable World 2014 ·∙ San Francisco, California 12:50p–1:00p Monday 29 September 2014 © 2014 Method R Corporation 1 TM MeTHOD R
  2. 2. @CaryMillsap Performance is not an attribute of a system. 2
  3. 3. ID USERNAME MODULE START_TIME R SLR -- -------- ------- -------------------------- ----- --- 1 FCHANG OE BOOK 2014-09-15T08:14:22.189533 2.019 2.0 2 RSMITH OE SHIP 2014-09-15T08:14:23.673849 3.528 5.0 3 DJOHNSON OE PICK 2014-09-15T08:15:01.938816 1.211 5.0 4 FFORBES OE BOOK 2014-09-15T08:17:23.815511 0.716 2.5 5 FCHANG OE BOOK 2014-09-15T08:17:24.032562 1.917 2.5 6 LBUMONT PA MTCH 2014-09-15T08:17:42.019328 1.305 2.0 @CaryMillsap 3 This thing called an experience... #define FAST (R ≤ SLR)
  4. 4. ID USERNAME MODULE R SLR FAST? -- -------- ------- ----- --- ----- 1 FCHANG OE BOOK 2.019 2.0 N 2 RSMITH OE SHIP 3.528 5.0 Y 3 DJOHNSON OE PICK 1.211 5.0 Y 4 FFORBES OE BOOK 0.716 2.5 Y 5 FCHANG OE BOOK 1.917 2.5 Y 6 LBUMONT PA MTCH 1.305 2.0 Y @CaryMillsap 4 This thing called an experience... #define FAST (R ≤ SLR)
  5. 5. @CaryMillsap Performance is an attribute of each individual experience with a system. 5
  6. 6. EXPERIENCE • id • task-id • user-id • ip-address • start-time • end-time • ERROR-code • WORK-done TASK • id • name • ... SQL • ID • Task-id • ... N 1 1 N @CaryMillsap 6
  7. 7. @CaryMillsap The “trick”... 7
  8. 8. @CaryMillsap Each experience gets its own unique id. 8
  9. 9. @CaryMillsap That’s it. 9
  10. 10. @CaryMillsap Each experience gets its own unique id. 10
  11. 11. @CaryMillsap You need to see this experience id in your session’s v$ data and your trace data. 11 ❶ ❷
  12. 12. @CaryMillsap Implementation? 12
  13. 13. T UNDER CONSTRUCTION @CaryMillsap 13
  14. 14. dbms_application_info.set_module( module_name => 'OE BOOK', action_name => sys_guid() -- 32-char hex string ); -- Your ‘book order’ code dbms_application_info.set_module( module_name => null, action_name => null ); @CaryMillsap 14 SQL, PL/SQL
  15. 15. conn.ModuleName = "OE BOOK"; conn.ActionName = Guid.NewGuid().toString(); // Your ‘book order’ code conn.ModuleName = ""; conn.ActionName = ""; @CaryMillsap ODP.NET 15
  16. 16. String metrics[] = new String[OraCxn.END_TO_END_STATE_INDEX_MAX]; metrics[END_TO_END_MODULE_INDEX] = "OE BOOK"; metrics[END_TO_END_ACTION_INDEX] = UUID.randomUUID().toString(); conn.setEndToEndMetrics(metrics, (short) 0); // Your ‘book order’ code metrics[END_TO_END_MODULE_INDEX] = ""; metrics[END_TO_END_ACTION_INDEX] = ""; conn.setEndToEndMetrics(metrics, (short) 0); @CaryMillsap 16 Java, ADF
  17. 17. 17
  18. 18. setClientInfo method supports JDBC DMS metrics setEndToEndMetrics is deprecated DBOP tag can be associated with application thread 18 New in 12.1
  19. 19. 19 Oh, and... module and action lengths are limited by JDBC (Thanks Lasse Jenssen)
  20. 20. @CaryMillsap Postscript A UUID in canonical form is 36 characters long (32 lowercase hexadecimal characters and 4 hyphens). However, v$session.action is VARCHAR2(32), so either we need to perform a more sophisticated transformation than toString upon the UUID (such as to remove the hyphens), or we have to choose another column in which to store it. We’re also investigating whether the new 12.1 begin_operation function and end_operation procedure in dbms_sql_monitor will accomplish our goal of assigning a unique id to each end-­‐user experience. The material at http:// docs.oracle.com/database/121/TGSQL/tgsql_monit.htm#TGSQL789 and http://docs.oracle.com/database/121/ARPLS/ d_sql_monitor.htm#ARPLS74779 looks promising. The combination of dbop_name and dbop_eid should be unique, but to meet my needs, these elements would have to render into the session’s trace data. These are the kinds of things we’re working on. 20
  21. 21. @CaryMillsap What you get 21
  22. 22. experience id (PK) USERNAME MODULE_NAME ACTION_NAME START_TIME -------- ----------- -------------------------------- ---------- FCHANG OE BOOK 4a782ce58c4c462990547500d2fd308d 2014-09-15 RSMITH OE SHIP 990a5426012841fa83c0cfa3690fad54 2014-09-15 DJOHNSON OE PICK 9d92d1cceb87405f94a04d0224e1c7c4 2014-09-15 FFORBES OE BOOK 2c920fc0fb91473ab4c141423e450715 2014-09-15 FCHANG OE BOOK 396f1348b5364d578e1815e74e910b43 2014-09-15 LBUMONT PA MTCH 7ddbf894941549e9b91b036947cb7328 2014-09-15 @CaryMillsap 22
  23. 23. DBMS_MONITOR.SERV_MOD_ACT_TRACE_ENABLE( MODULE_NAME => 'OE BOOK', ACTION_NAME => ANY_ACTION // default ) USERNAME MODULE_NAME ACTION_NAME START_TIME -------- ----------- -------------------------------- ---------- FCHANG OE BOOK 4a782ce58c4c462990547500d2fd308d 2014-09-15 RSMITH OE SHIP 990a5426012841fa83c0cfa3690fad54 2014-09-15 DJOHNSON OE PICK 9d92d1cceb87405f94a04d0224e1c7c4 2014-09-15 FFORBES OE BOOK 2c920fc0fb91473ab4c141423e450715 2014-09-15 FCHANG OE BOOK 396f1348b5364d578e1815e74e910b43 2014-09-15 LBUMONT PA MTCH 7ddbf894941549e9b91b036947cb7328 2014-09-15 @CaryMillsap 23
  24. 24. @CaryMillsap *** CLIENT ID:(10.17.21.198 FCHANG) ... *** MODULE NAME:(OE BOOK) ... *** ACTION NAME:(4a782ce58c4c462990547500d2fd308d) ... PARSE ... EXEC ... WAIT ... ... *** CLIENT ID:(10.17.22.57 FFORBES) ... *** MODULE NAME:(OE BOOK) ... *** ACTION NAME:(2c920fc0fb91473ab4c141423e450715) ... PARSE ... WAIT ... EXEC ... ... *** CLIENT ID:(10.17.22.241 FCHANG) ... *** MODULE NAME:(OE BOOK) ... *** ACTION NAME:(396f1348b5364d578e1815e74e910b43) ... EXEC ... WAIT ... FETCH ... ... 24
  25. 25. ACTION Trace file line ------------- ----------------------------------------------------------- @CaryMillsap *** CLIENT ID:(10.17.21.198 FCHANG) ... *** MODULE NAME:(OE BOOK) ... *** ACTION NAME:(4a782ce58c4c462990547500d2fd308d) ... PARSE ... EXEC ... WAIT ... ... *** CLIENT ID:(10.17.22.57 FFORBES) ... *** MODULE NAME:(OE BOOK) ... *** ACTION NAME:(2c920fc0fb91473ab4c141423e450715) ... PARSE ... WAIT ... EXEC ... ... *** CLIENT ID:(10.17.22.241 FCHANG) ... *** MODULE NAME:(OE BOOK) ... *** ACTION NAME:(396f1348b5364d578e1815e74e910b43) ... EXEC ... WAIT ... FETCH ... ... 25 4a782ce5... 4a782ce5... 4a782ce5... 4a782ce5... 2c920fc0... 2c920fc0... 2c920fc0... 2c920fc0... 396f1348... 396f1348... 396f1348... 396f1348...
  26. 26. $ mrskew --group='"$act $mod $client_id"' ... --top=10 *trc ACTION MODULE CLIENT_ID DURATION % CALLS MEAN MIN --------------------------------------------------------------- --------- ------ ------ -------- -------- c9a65ad7c62a4de9bb4ad118d9a5eda3 OE BOOK 10.17.23.41 AGREEN 3.162362 3.6% 604 0.005236 0.000000 b4748d88eea44d81a406e341ea36548f OE BOOK 10.17.22.14 GLAMB 3.115821 3.5% 604 0.005159 0.000000 f685757c77dd4b15a15d8ce811ee7390 OE BOOK 10.17.23.163 YJUSTICE 1.000578 1.1% 604 0.001657 0.000000 5d14953834e74063836678babf51e072 OE BOOK 10.17.22.227 USILVA 0.942317 1.1% 604 0.001560 0.000000 390c18ebfcd84e418b004c71bb3c0589 OE BOOK 10.17.21.63 WEVANS 0.914806 1.0% 604 0.001515 0.000000 2e5316d0cff448afa5f20de22c044409 OE BOOK 10.17.23.68 VMAYNARD 0.864778 1.0% 604 0.001432 0.000000 3db7b83fdad34b4289ca06cffaa5e711 OE BOOK 10.17.23.212 JSTRONG 0.786390 0.9% 604 0.001302 0.000000 f0135a649e124aefb8fb8069bb5bc16d OE BOOK 10.17.22.25 RHOPPER 0.780173 0.9% 604 0.001292 0.000000 93ff740851704d6dbcac5579e585dd61 OE BOOK 10.17.22.219 FWALLACE 0.758373 0.9% 604 0.001256 0.000000 ff784d033478490b899b5d04814a1ca8 OE BOOK 10.17.21.246 FROWLAND 0.750675 0.9% 604 0.001243 0.000000 2,275 others 75.188801 85.2% 10,915 0.006889 0.000000 -------------------------------------------------------------- --------- ------ ------ -------- -------- TOTAL (2,285) 88.265074 100.0% 16,955 0.005206 0.000000 @CaryMillsap 26
  27. 27. $ mrskew --group='"$act $mod $client_id"' ... --top=10 *trc ACTION MODULE CLIENT_ID DURATION % CALLS MEAN MIN -------------------------------------------------------------- --------- ------ ------ -------- -------- c9a65ad7c62a4de9bb4ad118d9a5eda3 OE BOOK 10.17.23.41 AGREEN 3.162362 3.6% 604 0.005236 0.000000 b4748d88eea44d81a406e341ea36548f OE BOOK 10.17.22.14 GLAMB 3.115821 3.5% 604 0.005159 0.000000 f685757c77dd4b15a15d8ce811ee7390 OE BOOK 10.17.23.163 YJUSTICE 1.000578 1.1% 604 0.001657 0.000000 5d14953834e74063836678babf51e072 OE BOOK 10.17.22.227 USILVA 0.942317 1.1% 604 0.001560 0.000000 390c18ebfcd84e418b004c71bb3c0589 OE BOOK 10.17.21.63 WEVANS 0.914806 1.0% 604 0.001515 0.000000 2e5316d0cff448afa5f20de22c044409 OE BOOK 10.17.23.68 VMAYNARD 0.864778 1.0% 604 0.001432 0.000000 3db7b83fdad34b4289ca06cffaa5e711 OE BOOK 10.17.23.212 JSTRONG 0.786390 0.9% 604 0.001302 0.000000 f0135a649e124aefb8fb8069bb5bc16d OE BOOK 10.17.22.25 RHOPPER 0.780173 0.9% 604 0.001292 0.000000 93ff740851704d6dbcac5579e585dd61 OE BOOK 10.17.22.219 FWALLACE 0.758373 0.9% 604 0.001256 0.000000 ff784d033478490b899b5d04814a1ca8 OE BOOK 10.17.21.246 FROWLAND 0.750675 0.9% 604 0.001243 0.000000 2,275 others 75.188801 85.2% 10,915 0.006889 0.000000 -------------------------------------------------------------- --------- ------ ------ -------- -------- TOTAL (2,285) 88.265074 100.0% 16,955 0.005206 0.000000 $ mrskew --where='$act eq "c9a65ad7c62a4de9bb4ad118d9a5eda3"' *trc CALL-NAME DURATION % CALLS MEAN MIN MAX --------------------------- -------- ------ ----- -------- -------- -------- SQL*Net message from client 3.161922 100.0% 201 0.015731 0.001619 0.135835 SQL*Net message to client 0.000440 0.0% 201 0.000002 0.000000 0.000027 FETCH 0.000000 0.0% 201 0.000000 0.000000 0.000000 EXEC 0.000000 0.0% 1 0.000000 0.000000 0.000000 --------------------------- -------- ------ ----- -------- -------- -------- TOTAL (4) 3.162362 100.0% 604 0.005236 0.000000 0.135835 @CaryMillsap 27
  28. 28. @CaryMillsap Each experience gets its own unique id. 28
  29. 29. @CaryMillsap ...So you can measure and diagnose what people feel. 29
  30. 30. @CaryMillsap ...So you can measure and diagnose performance. 30
  31. 31. @CaryMillsap For more... http://amzn.to/173bpzg 31
  32. 32. @CaryMillsap Fin 32

×