Your SlideShare is downloading. ×
0
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
ASP.NET Scalability - DDD7
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

ASP.NET Scalability - DDD7

1,466

Published on

Published in: Technology
1 Comment
0 Likes
Statistics
Notes
  • asp.net cache is a wonderful tool as far as performance and scalability of the app is concerned. but it has some drawback as well. due to its in process nature, it may end up with data integrity and performance issues. specially if you are running in a environment where you have multiple numbers of servers, then the classic asp.net cannot perform well. in situations like these you need to have a in-memory cache so that it can cache the data which is distributed over multiple servers, means you will have the scalable data all the time. here is a good read about the distributed cache and how it boosts the performance and scalability of the asp.net app

    http://www.alachisoft.com/ncache/asp-net-cache.html
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

No Downloads
Views
Total Views
1,466
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
15
Comments
1
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. “This One Goes Up To 11” or How to write scalable ASP.NET Phil Pursglove phil@philippursglove.com http://diaryofadotnetdeveloper.blogspot.com http://www.philippursglove.com/ScalableASPNET
  • 2. I am… • Senior .NET Developer • MCSD • VBUG East Anglia Co-ordinator • Used to write for VB Developer and SQL Server Pro
  • 3. Agenda • Increasing server performance – Caching • Output caching • Object caching • Donut caching • Velocity – Paging • Reducing network loads – Managing ViewState – Compression • Load Balancing
  • 4. What is Scalability? • “The ability to handle growing amounts of work in a graceful manner” Wikipedia • What affects scalability? • Everything you see this morning applies to .NET 2.0 and higher
  • 5. Increasing Server Performance
  • 6. Why Cache? • Because there’s a credit crunch! • Building a page is an expensive process – Database calls across servers – Web Service calls – AD lookups • Returning a stored page from a cache is much cheaper!
  • 7. Caching 1: OutputCache • Caches the rendered HTML from your page – Duration is in seconds – VaryByParam allows you to cache several versions – Location means you can cache on the web server, client, downstream machines or all of these – CacheProfiles mean you have fine config- based control
  • 8. Caching 2: Caching API • Store objects in memory and pull them out when you need them • For data objects, you have to use DataSets and DataTables, not DataReaders
  • 9. Caching 2: CacheDependency • Objects in the cache can be dependent on other objects – When the dependency changes, the cached item is removed – Not very useful in .NET 1.1 • .NET 2.0 introduced SqlCacheDependency – Cached objects can be dependent on SQL tables – Enable using the ASPNET_REGSQL tool
  • 10. Caching 3: Velocity • Velocity – Distributed cache • One logical cache split across several servers • PowerShell management console – CTP2 released at PDC – Doesn’t have dependencies – yet – The future: automatic caching?
  • 11. Caching 3: Velocity
  • 12. Caching 4: Donut Caching • aka Post-Cache Substitution • Inject dynamic content into a cached page before it is returned to the client – <asp:substitution> – Must use static methods with a HttpContext
  • 13. Paging • Default GridView paging behaviour reads the entire dataset every time – For 100 000 rows this probably isn’t so good • Write your own paging mechanism • For custom paging DataGrids are better than GridViews • In SQL 2005 the ROW_NUMBER function is your friend! • LINQ – Skip
  • 14. Reducing Network Loads
  • 15. ViewState 1 Viewstate Size in bytes HTML Table (built in-line) 52 HTML Table (built in code-behind) 52 DataList 6628 Repeater 6600 DataGrid 10592 GridView 10928
  • 16. ViewState 2 • Taming Viewstate – Can be disabled per-control – ZIP it up and put the zipped version on the page – Keep it on the web server
  • 17. Compression • All modern browsers will accept compressed content – Content is compressed on the server / decompressed by the browser – Can be enabled in IIS or – Use the HttpCompress library • JavaScript Compression – JSMin (http://tinyurl.com/jscriptmin) – jQuery is pre-minified for you
  • 18. Compression
  • 19. Load Balancing
  • 20. Load Balancing • Synchronise machineKey (in machine.config) • Don’t use basic Session state – SQL Server Session State – ASP.NET State Service – Velocity ASP.NET Session state
  • 21. Summary • Cache is King! • Paging is good for your pages! • Viewstate doesn’t have to be evil!
  • 22. Any Questions?
  • 23. Enjoy the day!
  • 24. Resources • DotNetRocks – http://www.dotnetrocks.com/default.aspx?showNum=24 – http://www.dotnetrocks.com/default.aspx?showNum=367 • Books – Essential ASP.NET by Fritz Onion – The ASP.NET 2.0 Cookbook by Michael Gittel & Geoffrey LeBlond – The ASP.NET Anthology by Scott Allen et al • MSDN White Paper on .NET Performance & Scalability – http://msdn.microsoft.com/en-us/library/ms998530.aspx
  • 25. Resources • Velocity – http://blogs.msdn.com/velocity – http://www.hanselman.com/blog/HanselminutesPodcast116DistributedCac hingWithMicrosoftsVelocity.aspx • Donut Caching – http://tinyurl.com/donutcaching • HttpCompress Library – http://www.blowery.org/code/HttpCompressionModule.html

×