Satisfy Your Technical Curiosity Profiling and Optimizing.NET Applications Ingo Rammer

Slides:



Advertisements
Similar presentations
Advanced Oracle DB tuning Performance can be defined in very different ways (OLTP versus DSS) Specific goals and targets must be set => clear recognition.
Advertisements

XIr2 Recommended Performance Tuning Andy Erthal BI Practice Manager.
Copyright © SoftTree Technologies, Inc. DB Tuning Expert.
Database Management3-1 L3 Database Management Santa R. Susarapu Ph.D. Student Virginia Commonwealth University.
1 G2 and ActiveSheets Paul Roe QUT Yes Australia!
Big Data Working with Terabytes in SQL Server Andrew Novick
A comparison of MySQL And Oracle Jeremy Haubrich.
1 Real-time End-to-End Transaction Visibility into Distributed and Mainframe Applications Steve Saville Mainframe Technical Account Manager – Compuware.
Introduction to Database Processing with ADO.NET.
Chapter 3 Database Management
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Communicating with the Outside. Hardware [Processor(s), Disk(s), Memory] Operating System Concurrency ControlRecovery Storage Subsystem Indexes Query.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Passage Three Introduction to Microsoft SQL Server 2000.
 Visual Studio has great support for building ASP.NET web applications  Real web application development involves more than just copying the files created.
Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried.
WEB329 ASP.NET: A Lap Around the New Enhancements for Web Developers in Microsoft Visual Studio 2005 Omar Khan Lead Program Manager Web Platform and Tools.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
DNN Performance & Scalability Planning, Evaluating & Improving : Part 2.
Introduction and simple using of Oracle Logistics Information System Yaxian Yao
Connect Learn Share Performance Optimization for Microsoft Dynamics CRM Presented by: Walter Grow Austin Jones.
What is Architecture  Architecture is a subjective thing, a shared understanding of a system’s design by the expert developers on a project  In the.
Global NetWatch Copyright © 2003 Global NetWatch, Inc. Factors Affecting Web Performance Getting Maximum Performance Out Of Your Web Server.
Marc Ziss Z Consulting Code Name 'Oryx' Web application scaffolding Easy to dynamically display pages based on the data model of.
Best Western Green Bay CHEMS 2013 SYSTEM ARCHITECTURE.
Why does my perfectly working App Crash and Burn in Production? Matt Kramer Project Manager, STL Boeing Scalability Test Lab cell.
© Dennis Shasha, Philippe Bonnet – 2013 Communicating with the Outside.
Ideas to Improve SharePoint Usage 4. What are these 4 Ideas? 1. 7 Steps to check SharePoint Health 2. Avoid common Deployment Mistakes 3. Analyze SharePoint.
1 Data Bound Controls II Chapter Objectives You will be able to Use a Data Source control to get data from a SQL database and make it available.
AUTOMATION OF WEB-FORM CREATION - KINNERA ANGADI – MS FINAL DEFENSE GUIDANCE BY – DR. DANIEL ANDRESEN.
1099 Why Use InterBase? Bill Todd The Database Group, Inc.
Applications hitting a wall today with SQL Server Locking/Latching Scale-up Throughput or latency SLA Applications which do not use SQL Server.
Data Management Console Synonym Editor
1 Performance Optimization In QTP Execution Over Video Automation Testing Speaker : Krishnesh Sasiyuthaman Nair Date : 10/05/2012.
Caching Chapter 12. Caching For high-performance apps Caching: storing frequently-used items in memory –Accessed more quickly Cached Web Form bypasses:
ASP.NET State Management. Slide 2 Lecture Overview Client state management options Cookies Server state management options Application state Session state.
Windows Forms in Visual Studio 2005 Mike Pelton Systems Engineer Microsoft Ltd
By Shanna Epstein IS 257 September 16, Cnet.com Provides information, tools, and advice to help customers decide what to buy and how to get the.
“Load Testing Early and Often” By Donald Doane Presentation to the Rockville MDCFUG.
Online Music Store. MSE Project Presentation III
Srik Raghavan Principal Lead Program Manager Kevin Cox Principal Program Manager SESSION CODE: DAT206.
Mauricio Featherman, Ph.D. Washington St. University
Advanced Debugging with Visual Studio Ingo Rammer | thinktecture | Please note: this session is a „classic“
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Copyright 2007, Information Builders. Slide 1 Machine Sizing and Scalability Mark Nesson, Vashti Ragoonath June 2008.
© 2003 Prentice Hall, Inc.3-1 Chapter 3 Database Management Information Systems Today Leonard Jessup and Joseph Valacich.
Performance Testing Test Complete. Performance testing and its sub categories Performance testing is performed, to determine how fast some aspect of a.
1 Copyright © 2005, Oracle. All rights reserved. Following a Tuning Methodology.
4/26/2017 Use Cloud-Based Load Testing Service to Find Scale and Performance Bottlenecks Randy Pagels Sr. Developer Technology Specialist © 2012 Microsoft.
SQL Query Analyzer. Graphical tool that allows you to:  Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)
Aniruddha Deswandikar & Govind Kanshi Microsoft Technology Center, Bangalore SESSION CODE: ##### Building performant Web applications.
Dynamicpartnerconnections.com Development for performance Oleksandr Katrusha, Program manager
October 15-18, 2013 Charlotte, NC Accelerating Database Performance Using Compression Joseph D’Antoni, Solutions Architect Anexinet.
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
Does the Optimistic Concurrency resolve your blocking problems Margarita Naumova, SQL Master Academy.
The best of WF 4.0 and AppFabric Damir Dobric MVP-Connected System Developer Microsoft Connected System Division Advisor Visual Studio Inner Circle member.
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
1 Copyright © 2008, Oracle. All rights reserved. Repository Basics.
Introduction to Database Processing with ADO.NET
SharePoint 2010 Performance and Capacity Planning Best Practices
How to tune your applications before moving your database to Microsoft Azure SQL Database (MASD) OK, you've jumped into your Azure journey by creating.
Introduction to Database Processing with ADO.NET
DBMS & TPS Barbara Russell MBA 624.
Tools for Performance, Load Testing, Stress Testing Using Telerik Test Studio Pavel Pankov QA Lead Automated Testing Team Telerik QA Academy.
Visual Studio 2005 “Personalized productivity”
Transactions, Locking and Query Optimisation
DAT381 Team Development with SQL Server 2005
Performance And Scalability In Oracle9i And SQL Server 2000
DEV315 Best Practices for running IIS 6.0 and ASP.NET
Presentation transcript:

Satisfy Your Technical Curiosity Profiling and Optimizing.NET Applications Ingo Rammer

Satisfy Your Technical Curiosity Ingo Rammer and Ingo Rammer and Support and consulting for software architects and developers Application Optimization and Tuning Developer-Coaching and -Mentoring Architecture and Code Reviews Prototyping and Architectural Consulting

Satisfy Your Technical Curiosity Scenario I Architecture Design Initial Coding and Load Testing

Satisfy Your Technical Curiosity Load Testing Pitfalls It’s important to test the right thing Double-check that network link and client CPUs are not overloaded Run test clients in the same LAN as the servers Two ways of testing with very different results Simulated user load (including think times, etc.) Maximum Request Load (no think time, just load) Include ramp-up time (“step user load”)

Satisfy Your Technical Curiosity Load Testing in Practice Track counters of multiple servers Test clients, Web servers, DB servers Liebig’s Law of the Minimum is applicable here as well “The scarcest resource will limit growth” After the resource is identified, take action

Satisfy Your Technical Curiosity Scenario II  Architecture  Design  Coding  Test  Deployment

Satisfy Your Technical Curiosity Users

Don‘t assume anything

Satisfy Your Technical Curiosity 1 st - Trace the Network Interactions The wire never lies Wireshark/Ethereal (Sniffing) TcpTrace (Explicit Port-Forwarding) Fiddler, ProxyTrace (HTTP Proxies) Caution: Some companies do not allow sniffing!

Satisfy Your Technical Curiosity Things you might find out Overhead you didn’t expect Authentication, sub-optimal bindings, … Roundtrips you didn’t expect Cookies Images (check your IE settings!) MarshalByRefObject-roundtrips General: Too many roundtrips, or too big Latency vs. Bandwidth

Satisfy Your Technical Curiosity 2 nd - Trace your SQL Most SQL today is generated DataSets and Adapters O/R Mappers Suboptimal SQL: main reason for scalability probs Today's databases are (unfortunately?) very good: Hide a lot of problems in single-user access during DEV

Satisfy Your Technical Curiosity Invoicing Application Subset Invoice InvoiceId InvoiceDate CustomerId Status InvoiceItems InvoiceId Itemld ProductId ProductName Quantity Price Status SerialNumbers InvoiceID ItemId SerialNumber Status SerialNumberAudit AuditId EntryDate Username SerialNumber Description

Satisfy Your Technical Curiosity Invoicing - Requirements Cancel (Status=2) Copy

Satisfy Your Technical Curiosity Lessons Learned from SQL Profiling DataSets, DataAdapters and O/R Mappers are great tools Can simplify more than 80% - 90% of your generic database access code BUT: Please avoid them in high-load / high-throughput parts of your application

Satisfy Your Technical Curiosity Optimize Your SQL for Transactions “UPDATE” with Foreign Keys “INSERT INTO... SELECT” In the high-load areas of your application. Not everywhere!

Satisfy Your Technical Curiosity Database Locks Minimize duration and number of locks Dynamic SQL (with parameters) vs. Stored Procedures UPDATE only changed rows if possible SELECT only the rows you need, join only tables you need Possibility: changed isolation level (snapshot isolation or NOLOCK) in statistics if you have to report from OLTP data Don‘t use “Sequence-Tables” (better go for Autoincrement/Identity/Guid columns!)

Satisfy Your Technical Curiosity The #1 Reason for Deadlocks TableNameNextValue Customer1234 Employee34 Invoice InvoiceDetail Order OrderDetail SerialNumber Inventory45543

Satisfy Your Technical Curiosity Indexes help a bit... Use: Index (TableName) Not: Index (TableName, NextValue) SQL Server: An index is only locked when one or more of the contained fields are locked! Even snapshot isolation won’t help you here Please note: Oracle sequences behave differently. They always run without transaction locks.

Satisfy Your Technical Curiosity 3 rd - Memory Profiling CLR Profiler 2.0 (free tool) Shows how much memory each method allocates Not leaks, just allocations

Satisfy Your Technical Curiosity Memory Usage Important for multi-user applications Issue: Multiple GC-cycles during one request Generative GC Short-lived objects end up in generation 2 You can quickly check this in PerfMon, too!.NET CLR Memory/Gen #0 Collections, #1, #2 2,5 GB practical maximum for ASP.NET apps on 32 bit systems

Satisfy Your Technical Curiosity In-Process Profiling Often as a last step Reason: In-Proc affects “only” performance Reason 2: After eliminating memory hogs, code will usually be faster anyway Profiler Jetbrains’ DotTrace Redgate ANTS Automated QA AQTime Compuware DevPartner

Satisfy Your Technical Curiosity I code well, so where’s the scary part?

Satisfy Your Technical Curiosity The Scary Facts SqlDataSource Grid A23,926,450 Bytes Grid B17,147,255 Bytes Grid C 3,325,839 Bytes GridView2,583,207 Bytes ObjectDataSource GridView 169,551 Bytes Grid C916,769 Bytes Manual HTML Tables51,237 Bytes w/o ViewState43,897 Bytes

Satisfy Your Technical Curiosity Summary Don‘t assume anything Network – the wire never lies (auth overhead, roundtrips, …) Database – generated SQL Memory – multiple GCs for one request? In-Proc Performance – as the last step (scale up) Don‘t trust anyone It might not be your code, but it could be your job!

Satisfy Your Technical Curiosity

Resources Wireshark/Ethereal: Fiddler: TcpTrace, ProxyTrace: SQL Profiler: out of the box CLR Profiler 2.0: cryptic link, please google

Satisfy Your Technical Curiosity

2006 DSL, WLAN, MBits, … Ping to New York: 800 msec Download of 3,6 GB (Visual Studio): 6 Hours 6 Hours

Satisfy Your Technical Curiosity Early 90s 1200 baud acoustic coupler „Ping“ to New York: 1200 msec Download of 3,6 GB (Visual Studio): 347 Days 347 Days

Satisfy Your Technical Curiosity Early 90s Download 347 Days Walking km 5 km per hour 12 hours per day  333 Days

Satisfy Your Technical Curiosity 2006 Latency (Ping): 33% improvement Bandwidth: % improvement