SSQQLL AAnnyywwhheerree 1111 PPeerrffoorrmmaannccee AAnnaallyyssiiss GGlleennnn PPaauulllleeyy Director, Engineering Sybase iAnywhere httpp:////iablogg.syybase.com//ppaulleyy AAggeennddaa • Overview • Demonstration of automatic application profiling • Details about application profiling • Architecture • User interface • DDeemmoonnssttrraattiioonn ooff mmaannuuaall aapppplliiccaattiioonn pprrooffiilliinngg • How to set it up • Other tools for troubleshooting performance • Advanced manual diagnostic analysis • Troubleshooting specific performance problems • Questions? 2 OOuurr pprroobblleemm • Users are compplainingg about slowness on our apppplication – what should we do? • We will use a “sabotaged” version of SalesSim •• SSiimmuullaatteess tthhee ssaalleess, sshhiippppiinngg, aanndd ffiinnaannccee ddeeppaarrttmmeennttss ooff aa ccoommppaannyy • How do we use the new profiling features of SQL Anywhere 10 to find the boat anchors and restore/improve performance? 3 AApppplliiccaattiioonn pprrooffiilliinngg • Combines in one tool most of the functionalityy pprovided byy: • Request logging • Procedure profiling •• GGrraapphhiiccaall ppllaann ccaappttuurriinngg • Index consultant • Statistics monitoring • Many usage scenarios: • Debugging application logic • TTrroouubblleesshhoooottiinngg ssppeecciiffiicc ppeerrffoorrmmaannccee pprroobblleemm • Leave running in background permanently 4 AApppplliiccaattiioonn pprrooffiilliinngg wwiizzaarrdd • SA Pluggin for Syybase Central includes the Apppplication Profilingg Wizard • Handle all details of setting up a profile and analyzing it •• DDeetteecctt ccoommmmoonn pprroobblleemmss aauuttoommaattiiccaallllyy Schema o Indexes o Server and connection options o Application structure o • Make suggggestions for impprovingg yyour apppplication • Simplest way to use application profiling capabilities 5 MMaannuuaall aapppplliiccaattiioonn pprrooffiilliinngg • Usingg the apppplication pprofilingg tool manuallyy allows for more flexibility in controlling what data is analyzed • High level steps: • Create and start a tracing database • Configure a tracing session • Run your application • Close (“detach”) the tracing session and save the trace data • Analyze the tracing session using the application profiling mode in the SQQL Anyywhere ppluggin 6 DDiiaaggnnoossttiicc ttrraacciinngg • Enggine in version 10 and upp includes functionalityy to record many types of database events: • Connections •• SSQQLL ssttaatteemmeennttss • Query execution plans • Blocked connections • Deadlocks • Performance counters • AAllll ttyyppeess ooff ddaattaa ccaann bbee ttrraacceedd ffrroomm ssoouurrcceess bbootthh iinntteerrnnaall aanndd external to the server 7 DDiiaaggnnoossttiicc aarrcchhiitteeccttuurree • Traced data can ggo to anyy database • To local database for ease of use • To a non‐local database for performance and to avoid bloat •• FFoorr bbeesstt rreessuullttss, uussee aa ddeeddiiccaatteedd ddaattaabbaassee • Traced data stored in temporary tables • New feature in version 10: shared temporary tables • No I/O overhead • At end of logging session, data automatically saved to permanent storagge ((base tables)) 8 DDiiaaggnnoossttiicc aarrcchhiitteeccttuurree Profiling Data Production Server Profiling Server Profile Production Profile database Database database 9 SSppeecciiffyyiinngg wwhhaatt ttoo ttrraaccee • Trace onlyy for a sppecified list of objjects: • Users • Connections •• PPrroocceedduurreess, ttrriiggggeerrss, ffuunnccttiioonnss, eevveennttss • Trace only under certain circumstances • When a statement is “expensive” • When a query differs from its estimated cost • Every n milliseconds •• LLiimmiitt vvoolluummee ooff ttrraaccee tthhaatt iiss ssttoorreedd • By disk space • By length of time 10
Description: