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.
How to speed up .NET and
SQL Server web apps
Bart Read
Who am I?
• Bart Read, Consultant, Software Engineer
• .NET, SQL Server, performance tuning, project management
• Previous...
General Web Performance
http://www.bartread.com/2
014/06/03/web-
performance-how-fast-does-
website-need-to-be/
Tools of the Trade
.NET Performance & Memory Profilers
SSMS & SQL Profiler
Load Testing
SQL Server Monitoring Tools
Useful Ancillary Tools
Scenario 1
The Slow Support Centre
Customer Support Centre
(MS Dynamics)
Grant Fritchey’s FREE eBook on
execution plans:
http://www.red-
gate.com/community/books/s
ql-server-execution-plans-ed-2
Scenario 2
The Memory Leak in the eCommerce Site
eCommerce Site
(MS Dynamics)
Other technologies:
- NServiceBus
- Endeca
Solution (Nasty Hack)
container.Kernel.ReleasePolicy = new
NoTrackingReleasePolicy();
(Creating some technical debt for th...
Scenario 3
Locking, Blocking and Deadlocking
Locking, Blocking & Deadlocking
Concurrency
• Object level concurrency
• Row level concurrency
Transaction Isolation Levels
• Read Uncommitted
• Read Committed <- SQL Server default
• Repeatable Read
• Snapshot
• Seri...
Locking pattern
• Reads
• A -> B -> C -> D -> A -> B -> C -> D -> E -> A …
• Etc.
• Writes
• A –> B -> C -> D -> E -> A ->...
Solutions
• DEADLOCK_PRIORITY
• http://msdn.microsoft.com/en-us/library/ms186736.aspx
• SET DEADLOCK_PRIORITY LOW | NORMAL...
Other Scenarios
• Indexes
• Missing indexes
• Maintenance
• Statistics
• NTEXT (etc.) preventing online rebuilds
• http://...
Questions?
E: bart@bartread.com
W: www.bartread.com
B: www.bartread.com/blog
T: @bart_read
GH: https://github.com/bartread
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps
Upcoming SlideShare
Loading in …5
×

SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps

128 views

Published on

This is an older version of this talk, that I gave at SQL in the City, in London a couple of years back.

It's very much examples based and shows the tools and techniques you'll need to use to hunt down performance problems in .NET and SQL Server web applications.

I have more up to date versions of this talk and, in particular, would suggest you check out the extended edition that I tend to give at user groups. This includes a section on memory management, which doesn't fit into the 50-60 minutes normally allocated for a conference slot.

Published in: Software
  • Be the first to comment

  • Be the first to like this

SQL in the City, London, 2014: How to speed up .NET and SQL Server web apps

  1. 1. How to speed up .NET and SQL Server web apps Bart Read
  2. 2. Who am I? • Bart Read, Consultant, Software Engineer • .NET, SQL Server, performance tuning, project management • Previously worked for Red Gate • Contacts • E: bart@bartread.com • W: www.bartread.com • B: www.bartread.com/blog • T: @bart_read • GH: https://github.com/bartread
  3. 3. General Web Performance http://www.bartread.com/2 014/06/03/web- performance-how-fast-does- website-need-to-be/
  4. 4. Tools of the Trade
  5. 5. .NET Performance & Memory Profilers
  6. 6. SSMS & SQL Profiler
  7. 7. Load Testing
  8. 8. SQL Server Monitoring Tools
  9. 9. Useful Ancillary Tools
  10. 10. Scenario 1 The Slow Support Centre
  11. 11. Customer Support Centre (MS Dynamics)
  12. 12. Grant Fritchey’s FREE eBook on execution plans: http://www.red- gate.com/community/books/s ql-server-execution-plans-ed-2
  13. 13. Scenario 2 The Memory Leak in the eCommerce Site
  14. 14. eCommerce Site (MS Dynamics) Other technologies: - NServiceBus - Endeca
  15. 15. Solution (Nasty Hack) container.Kernel.ReleasePolicy = new NoTrackingReleasePolicy(); (Creating some technical debt for the future.)
  16. 16. Scenario 3 Locking, Blocking and Deadlocking
  17. 17. Locking, Blocking & Deadlocking
  18. 18. Concurrency • Object level concurrency • Row level concurrency
  19. 19. Transaction Isolation Levels • Read Uncommitted • Read Committed <- SQL Server default • Repeatable Read • Snapshot • Serializable ACID
  20. 20. Locking pattern • Reads • A -> B -> C -> D -> A -> B -> C -> D -> E -> A … • Etc. • Writes • A –> B -> C -> D -> E -> A -> B -> A -> B -> C -> D … • Etc.
  21. 21. Solutions • DEADLOCK_PRIORITY • http://msdn.microsoft.com/en-us/library/ms186736.aspx • SET DEADLOCK_PRIORITY LOW | NORMAL | HIGH • Read Committed Snapshot Isolation • http://www.brentozar.com/archive/2013/01/implementing-snapshot-or- read-committed-snapshot-isolation-in-sql-server-a-guide/ • Disciplined ordering of object access • Unit of Work Pattern • Martin Fowler • http://martinfowler.com/eaaCatalog/unitOfWork.html
  22. 22. Other Scenarios • Indexes • Missing indexes • Maintenance • Statistics • NTEXT (etc.) preventing online rebuilds • http://www.bartread.com/2014/09/17/convert-all-ntext-columns-to-nvarcharmax-sql- server/ • Stored procedures and cached execution plans • WITH RECOMPILE
  23. 23. Questions? E: bart@bartread.com W: www.bartread.com B: www.bartread.com/blog T: @bart_read GH: https://github.com/bartread

×