free diagnostic tools for progress - midwest user group · 2015-09-11 · 2015‐09‐09 1 hacksaws...
TRANSCRIPT
2015‐09‐09
1
Hacksaws and X-Acto Knives
PAUL KOUFALIS
Free Diagnostic Tools for Progress
© 2015 White Star Software2 Hacksaws & X-Actos
Which One Do You Use?
© 2015 White Star Software3 Hacksaws & X-Actos
More to Life than “COMPILE XREF”
Often the limit of developers’ testing
“Look Mom! No “WHOLE-INDEX” !!
Where do we start?
2015‐09‐09
2
© 2015 White Star Software4 Hacksaws & X-Actos
Where Is the Problem?
Server or Operating System?
Database?
Client?
Bad Code?
Wait…that’s why you’re here!
Hint: Usually it’s bad code (shhh!!!)
© 2015 White Star Software5 Hacksaws & X-Actos
Server
Let’s pretend for 5 sec that the code is good
Do you use any of the following:• Virtualization?
• NAS or “NetApp”?
• SAN (to a lesser degree)?
• Windows?
These technologies trade performance for ease of management
© 2015 White Star Software6 Hacksaws & X-Actos
Physical Server
Often not memory or CPU
Typically disk• A symptom of bad code or configuration
See my presentation “Understanding Operating System Performance Metrics”
http://wss.com/en/resources/presentations
2015‐09‐09
3
© 2015 White Star Software7 Hacksaws & X-Actos
Virtualization
Libor Laubacher did an excellent PPT on virtualization
Best practices
Stuff to avoid at all costs
http://media.progress.com/exchange/2014/slides/track2_openedge-in-virtualized-environment.pdf
© 2015 White Star Software8 Hacksaws & X-Actos
Must Be the Database!
Three tools available:
Promon ($DLC/bin/promon)
ProTop (http://dbappraise.com/protop.html)
Virtual System Tables
© 2015 White Star Software9 Hacksaws & X-Actos
Promon
PROS
Included in $DLC so always available
Well known by all
CONS
Built for 80X25 screen
Have to switch around screens all the time
A lot of hidden options
Does not contain all the needed info
2015‐09‐09
4
© 2015 White Star Software10 Hacksaws & X-Actos
Promon – Activity: Summary
© 2015 White Star Software11 Hacksaws & X-Actos
Promon – Activity: Buffer Cache
© 2015 White Star Software12 Hacksaws & X-Actos
Promon – Checkpoints
2015‐09‐09
5
© 2015 White Star Software13 Hacksaws & X-Actos
Promon – Checkpoints w/ Hidden Options
© 2015 White Star Software14 Hacksaws & X-Actos
ProTop
PROS
More information dense on larger screen
Combines promon, _proutil, VST, etc. data in one place
All information easily available
CONS
Have to download and install
Limited with old Progress versions
© 2015 White Star Software15 Hacksaws & X-Actos
ProTop – Initial View
2015‐09‐09
6
© 2015 White Star Software16 Hacksaws & X-Actos
ProTop – User View
© 2015 White Star Software17 Hacksaws & X-Actos
ProTop – Shows Promon “Hidden” Metrics
© 2015 White Star Software18 Hacksaws & X-Actos
Virtual System Tables
Pros
Available to everyone
Cons
Have to write 4GL code
Version dependant
Not all information available
2015‐09‐09
7
© 2015 White Star Software19 Hacksaws & X-Actos
Virtual System Tables
Most interesting VST from developer P.O.V.:• _UserTableStat
• _UserIndexStat
Monitor what your code is really doing
Look in Appendix A of the DB Admin Guide and Reference
© 2015 White Star Software20 Hacksaws & X-Actos
What about the Client Session?
SOOOOO often overlooked
Temp file I/O can be ENORMOUS
Often invisible because Progress creates temp-files “unlinked”• I.e. they do not appear in directory listing
• Must use the “-t” parameter to see them
© 2015 White Star Software21 Hacksaws & X-Actos
Client Temp Files
DBI: Temp table data
LBI: Local before image• WORKFILES
• Sub-transactions and variables w/out “NO-UNDO”
SRT: Sorting of data returned from DB
RCD: R-code segments
DBI and RCD are often the culprits
2015‐09‐09
8
© 2015 White Star Software22 Hacksaws & X-Actos
Large DBI Files
Creating large TEMP-TABLES
Do not fit in client memory
Solution: Increase client memory
Parameter -Bt <# blocks>
Temp-table block size: use –tmpbsize
CAREFUL not to overcommit memory
© 2015 White Star Software23 Hacksaws & X-Actos
Large RCD Files
Use “-yd” startup parameter to see rcd usage
Output includes data on read/write to rcd
Increase –mmax to reduce r-code swapping
Trade memory usage for I/O reduction• Disk I/O is MUCH more expensive than
memory
© 2015 White Star Software24 Hacksaws & X-Actos
-yd and R-Code Swapping-----------------------------------------
Program access statistics: Times Bytes
Reads from temp file: 0 0
Writes to temp file: 0 0
Loads of .r programs: 0 0
Saves of compilation .r's: 0 0
Compilations of .p's: 10 25524
Checks of files with stat: 16438 0
Memory usage summary: Current Max Used Limit (Bytes)
Stack usage (-s): 112 8320 40960
Local buffer usage: 1952 6752
R-code Execution Buffer: 26768 26768 3170304
2015‐09‐09
9
© 2015 White Star Software25 Hacksaws & X-Actos
Large SRT Files
Large non-indexed sorts
Database returns records in index order
Client must sort
© 2015 White Star Software26 Hacksaws & X-Actos
Bad Code
Finally – the REAL problem
Often server/DB/client issues are really symptoms of BAD CODE
Find and fix before deploying in PROD
© 2015 White Star Software27 Hacksaws & X-Actos
Profiler
Unsupported tool introduced in V9
Available in $DLC/src/samples
Use the PROFILER handle• Ex.: PROFILER:ENABLED = TRUE.
Outputs time spent in each line of code
2015‐09‐09
10
© 2015 White Star Software28 Hacksaws & X-Actos
Profiler
© 2015 White Star Software29 Hacksaws & X-Actos
Profiler - Output
© 2015 White Star Software30 Hacksaws & X-Actos
Profiler – GUI Example Program
2015‐09‐09
11
© 2015 White Star Software31 Hacksaws & X-Actos
-zqil
Cool tool
Tells you which index AND how deep
CAREFUL: writes to db.lg
Example index #1784:
pu usrw_index1 16 3 + usrw_domain
+ usrw_key1
+ usrw_key2
© 2015 White Star Software32 Hacksaws & X-Actos
-zqil
for each usrw_wkfl: INDEX 1784 0 0
where usrw_domain = "qp“: INDEX 1784 1 1
and usrw_key1 = “x”: INDEX 1784 2 2
and usrw_key1 > “x”: INDEX 1784 2 1
and usrw_key1 < “x”: INDEX 1784 1 2
and usrw_key1 = “x” INDEX 1784 3 2
and usrw_key2 > “y”:
and usrw_key1 > “x” INDEX 1784 2 1
and usrw_key2 > “y”:
© 2015 White Star Software33 Hacksaws & X-Actos
LOG-MANAGER
One of my favourites
ASSIGN LOG-MANAGER:LOGFILE-NAME = "logmgr.log"
LOG-MANAGER:LOGGING-LEVEL = 3
LOG-MANAGER:LOG-ENTRY-TYPES =
"4GLMessages,4GLTrace,QryInfo".
QryInfo especially useful
2015‐09‐09
12
© 2015 White Star Software34 Hacksaws & X-Actos
LOG-MANAGER OUTPUT
for each usrw_wkfl where usrw_domain = "x"
and usrw_key1 = "y":
Type: FOR Statement
Client Sort: N
Scrolling: N
Table: /data/eb21/db/mfgdemo.usrw_wkfl
Indexes: usrw_index1
© 2015 White Star Software35 Hacksaws & X-Actos
LOG-MANAGER OUTPUT
for each usrw_wkfl where usrw_domain = "x"
and usrw_key1 = "y"
by usrw_key5:
Type: FOR Statement
Client Sort: Y
Scrolling: N
Table: /data/eb21/db/mfgdemo.usrw_wkfl
Indexes: usrw_index1
Entries in result list: 6
Time to build result list (ms): 0
DB Blocks accessed to build result list: 16
DB Reads to build result list:
Table: /data/eb21/db/mfgdemo.usrw_wkfl : 0
Index: usrw_wkfl.usrw_index1 : 0
Records from server: 6
Useful: 6
Failed: 0
Select By Client: N
Fields: usrw_key5
© 2015 White Star Software36 Hacksaws & X-Actos
Bad Code!
The following query returns ZERO records:for each usrw_wkfl where usrw_domain = "x"
and usrw_key1 > "y"
and usrw_key2 > "z"
by usrw_key5:
Yet it reads 63798 DB blocksTime to build result list (ms): 155
DB Blocks accessed to build result list:
/data/eb21/db/mfgdemo : 63798
Records from server: 0
Useful: 0
Failed: 0
Select By Client: N
Fields: usrw_key2
2015‐09‐09
13
© 2015 White Star Software37 Hacksaws & X-Actos
Client Statement Cache
Promon – R&D – 1 – 18• CAREFUL: Has been known to crash DB in
older versions of Progress
Shows you program and line#
Example:
633 : StartVqapi us/gp/gpapist.p
© 2015 White Star Software38 Hacksaws & X-Actos
Promon
© 2015 White Star Software39 Hacksaws & X-Actos
ProTop
ProTop shows it directly in main view
2015‐09‐09
14
© 2015 White Star Software40 Hacksaws & X-Actos
Or in User View
© 2015 White Star Software41 Hacksaws & X-Actos
Remember…
Poor performance metrics are often symptoms of bad code
Always ask “why is this number = x ?”
Easier to buy more hardware than fix software• Has limits
© 2015 White Star Software42 Hacksaws & X-Actos
Questions?
2015‐09‐09
15
© 2015 White Star Software43 Hacksaws & X-Actos
The #1 FREE OpenEdge Database Monitoring Tool
http://dbappraise.com/protop.html
Try ProTop Free
© 2015 White Star Software44 Hacksaws & X-Actos
Paul Koufalis? Who is Paul Koufalis?
Progress DBA and UNIX sysadmin for over 20 years
Wide range of clients– Small 10 person offices
– Mfg/distributors with 1500+ users
Each have their own set of challenges
© 2015 White Star Software45 Hacksaws & X-Actos
The oldest and most respected independent DBA consulting firm in the world
Four of the world’s top OpenEdge DBAs
Author of ProTop, the #1 FREE OpenEdge Database Monitoring Tool• http://dbappraise.com/protop.html
Who is White Star Software?