Improving the availability of your website

1,024 views

Published on

In this session we will focus on the new Async support introduced in ASP.NET MVC4 to increase the number of concurent users for your web applications and get rid of the HTTP 503 error messages.

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,024
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
49
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Improving the availability of your website

  1. 1. Improving the Availabilityof Your Website inASP.NET MVC4GABRIEL ENEAMICROSOFT MVP – ASP.NET/IISTECHNICAL LEAD – MAXCODE@DOTNET18 / GABRIELENEA.BLOGSPOT.COMCODECAMP IASI, 10 NOV 2012
  2. 2. How ASP.NET Requests AreProcessed by the Thread Pool?
  3. 3. How Requests Are Processed bythe Thread Pool free IIS, ASP.NET Requests, Thread Pool, .NET Fx
  4. 4. How Requests Are Processed bythe Thread Pool R e q u e s t free IIS, ASP.NET Requests, Thread Pool, .NET Fx
  5. 5. How Requests Are Processed bythe Thread Pool R e q u e s t busy free IIS, ASP.NET Requests, Thread Pool, .NET Fx
  6. 6. How Requests Are Processed bythe Thread Pool R e q u e s t busy IIS, ASP.NET Requests, Thread Pool, .NET Fx Web Services (long running operations)
  7. 7. How Requests Are Processed bythe Thread Pool R e q u e Request Queue s t busy IIS, ASP.NET Requests, Thread Pool, .NET Fx Web Services
  8. 8. How Requests Are Processed bythe Thread Pool R e q u e Request Queue s t busy IIS, ASP.NET Requests, Thread Pool, .NET Fx Web Services
  9. 9. How Requests Are Processed bythe Thread Pool 3 0 5 R e q u e Request Queue HTTP 503 Error s Server Too Busy t busy IIS, ASP.NET Requests, Thread Pool, .NET Fx Web Services
  10. 10. How Requests Are Processed bythe Thread Pool R e q u e st 3 0 5 R e q u e Request Queue HTTP 503 Error s Server Too Busy t free IIS, ASP.NET Requests, Thread Pool, .NET Fx Web Services
  11. 11. How Requests Are Processed bythe Thread Pool
  12. 12. What Can We Do to Improve theAvailability?
  13. 13. What Can We Do to Improve theAvailability?
  14. 14. Using Asynchronous methods R e q u e s t free IIS, ASP.NET Requests, Thread Pool, .NET Fx busy Web Services
  15. 15. .NET Asynchronous Operations patterns
  16. 16. .NET Asynchronous Operationspatterns  Synchronous code  .NET 1.0: Asynchronous Programming Model (APM) pattern
  17. 17. .NET Asynchronous Operationspatterns  Synchronous code  .NET 2.0: Event-based Asynchronous Pattern (EAP)
  18. 18. .NET Asynchronous Operationspatterns  Synchronous code  .NET 4.0: Task-based Asynchronous Pattern (TAP)
  19. 19. .NET Asynchronous Operationspatterns Synchronous code   .NET 1.0: compare  .NET 4.0:  .NET 2.0  .NET 4.5  async, await
  20. 20. ASP.NET MVCAsynchronous Operations Support
  21. 21. ASP.NET MVC - AsynchronousOperations Support  MVC3  AsyncController  AsyncManager  MVC4  Task-based asynchronous action methods
  22. 22. DEMO
  23. 23. DEMO  Bingoogle – Dual Search Engine  ASP.NET MVC3 -> MVC4
  24. 24. Guidelines:When to use synchronous orasynchronous action methods?
  25. 25. When to use synchronous actionmethods?  The operations are simple or short-running  Simplicity is more important than efficiency  The operations are CPU-bound
  26. 26. When to use asynchronous actionmethods? (1)  Asynchronous methods available and using .NET 4.5  The operations are network-bound or I/O-bound  Parallelism is more important than simplicity of code
  27. 27. When to use asynchronous actionmethods? (2)  You want to provide a mechanism that lets users cancel a long-running request  Switching threads out weights the cost of the context switch  Testing shows that the blocking operations are a bottleneck in site performance
  28. 28. Server Configuration for HighConcurrency/Latency Web Service Calls
  29. 29. Server Configuration for HighConcurrency/Latency Web Service Calls  aspnet.config <configuration> <system.web> <applicationPool maxConcurrentRequestsPerCPU="5000" maxConcurrentThreadsPerCPU="0"  HTTP.sys queue limit requestQueueLimit="5000" /> </system.web> </configuration>
  30. 30. Improving the Availability of YourWebsite in ASP.NET MVC4 Questions?
  31. 31. Resources Ask Google or start with..  MSDN - Asynchronous Programming with Async and Await  www.asp.net - Using Asynchronous Methods in ASP.NET MVC 4  Channel9 - Mads Torgersen: Inside C# Async
  32. 32. Improving the Availability of YourWebsite in ASP.NET MVC4 Please fill the evaluation formGABRIEL ENEAMICROSOFT MVP – ASP.NET/IISTECHNICAL LEAD – MAXCODE@DOTNET18 / GABRIELENEA.BLOGSPOT.COM
  33. 33. Diamond SponsorsPlatinum Sponsors Gold SponsorsTraining Partners Media Partners Other Partners

×