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.
Boost PC performance: How more available memory can improve productivity
Improving the availability of your website
1. Improving the Availability
of Your Website in
ASP.NET MVC4
GABRIEL ENEA
MICROSOFT MVP – ASP.NET/IIS
TECHNICAL LEAD – MAXCODE
@DOTNET18 / GABRIELENEA.BLOGSPOT.COM
CODECAMP IASI, 10 NOV 2012
3. How Requests Are Processed by
the Thread Pool
free
IIS, ASP.NET Requests,
Thread Pool, .NET Fx
4. How Requests Are Processed by
the Thread Pool
R
e
q
u
e
s
t
free
IIS, ASP.NET Requests,
Thread Pool, .NET Fx
5. How Requests Are Processed by
the Thread Pool
R
e
q
u
e
s
t
busy free
IIS, ASP.NET Requests,
Thread Pool, .NET Fx
6. How Requests Are Processed by
the Thread Pool
R
e
q
u
e
s
t
busy
IIS, ASP.NET Requests,
Thread Pool, .NET Fx
Web Services (long running operations)
7. How Requests Are Processed by
the Thread Pool
R
e
q
u
e Request Queue
s
t
busy
IIS, ASP.NET Requests,
Thread Pool, .NET Fx
Web Services
8. How Requests Are Processed by
the Thread Pool
R
e
q
u
e Request Queue
s
t
busy
IIS, ASP.NET Requests,
Thread Pool, .NET Fx
Web Services
9. How Requests Are Processed by
the 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. How Requests Are Processed by
the 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
25. When to use synchronous action
methods?
The operations are simple or short-running
Simplicity is more important than efficiency
The operations are CPU-bound
26. When to use asynchronous action
methods? (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. When to use asynchronous action
methods? (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
29. Server Configuration for High
Concurrency/Latency Web Service Calls
aspnet.config
<configuration>
<system.web>
<applicationPool
maxConcurrentRequestsPerCPU="5000"
maxConcurrentThreadsPerCPU="0" HTTP.sys queue limit
requestQueueLimit="5000" />
</system.web>
</configuration>
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. Improving the Availability of Your
Website in ASP.NET MVC4
Please fill the evaluation
form
GABRIEL ENEA
MICROSOFT MVP – ASP.NET/IIS
TECHNICAL LEAD – MAXCODE
@DOTNET18 / GABRIELENEA.BLOGSPOT.COM