SlideShare uma empresa Scribd logo
1 de 33
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
How ASP.NET Requests Are
Processed by the Thread Pool?
How Requests Are Processed by
the Thread Pool



 free
                            IIS, ASP.NET Requests,
                            Thread Pool, .NET Fx
How Requests Are Processed by
the Thread Pool
  R
  e
  q
  u
  e
  s
  t




 free
                            IIS, ASP.NET Requests,
                            Thread Pool, .NET Fx
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
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)
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
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
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
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
How Requests Are Processed by
the Thread Pool
What Can We Do to Improve the
Availability?
What Can We Do to Improve the
Availability?
Using Asynchronous methods

  R
  e
  q
  u
  e
  s
  t




        free
                              IIS, ASP.NET Requests,
                              Thread Pool, .NET Fx
 busy




               Web Services
.NET Asynchronous Operations patterns
.NET Asynchronous Operations
patterns
    Synchronous code




    .NET 1.0: Asynchronous Programming Model (APM) pattern
.NET Asynchronous Operations
patterns
    Synchronous code




    .NET 2.0: Event-based Asynchronous Pattern (EAP)
.NET Asynchronous Operations
patterns
    Synchronous code




    .NET 4.0: Task-based Asynchronous Pattern (TAP)
.NET Asynchronous Operations
patterns      Synchronous code
                 




    .NET 1.0:                               compare

                        .NET 4.0:




    .NET 2.0           .NET 4.5
                             async, await
ASP.NET MVC
Asynchronous Operations Support
ASP.NET MVC - Asynchronous
Operations Support


    MVC3
        AsyncController
        AsyncManager
    MVC4
        Task-based asynchronous action methods
DEMO
DEMO



    Bingoogle – Dual Search Engine
    ASP.NET MVC3 -> MVC4
Guidelines:
When to use synchronous or
asynchronous action methods?
When to use synchronous action
methods?


    The operations are simple or short-running
    Simplicity is more important than efficiency
    The operations are CPU-bound
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
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
Server Configuration for High
Concurrency/Latency Web Service Calls
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>
Improving the Availability of Your
Website in ASP.NET MVC4

                 Questions?
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
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
Diamond Sponsors




Platinum Sponsors                    Gold Sponsors


Training Partners   Media Partners          Other Partners

Mais conteúdo relacionado

Mais procurados

Alfresco search services: Now and Then
Alfresco search services: Now and ThenAlfresco search services: Now and Then
Alfresco search services: Now and ThenAngel Borroy López
 
How Shopify Scales Rails
How Shopify Scales RailsHow Shopify Scales Rails
How Shopify Scales Railsjduff
 
New Oracle Infrastructure2
New Oracle Infrastructure2New Oracle Infrastructure2
New Oracle Infrastructure2markleeuw
 
0-60 with Goliath: Building High Performance Ruby Web-Services
0-60 with Goliath: Building High Performance Ruby Web-Services0-60 with Goliath: Building High Performance Ruby Web-Services
0-60 with Goliath: Building High Performance Ruby Web-ServicesIlya Grigorik
 
Choosing a Web Architecture for Perl
Choosing a Web Architecture for PerlChoosing a Web Architecture for Perl
Choosing a Web Architecture for PerlPerrin Harkins
 
Learn to love networking on iOS
Learn to love networking on iOSLearn to love networking on iOS
Learn to love networking on iOSPaolo Tagliani
 
Async event based web server
Async event based web serverAsync event based web server
Async event based web serverGi Woong Lee
 

Mais procurados (8)

Alfresco search services: Now and Then
Alfresco search services: Now and ThenAlfresco search services: Now and Then
Alfresco search services: Now and Then
 
How Shopify Scales Rails
How Shopify Scales RailsHow Shopify Scales Rails
How Shopify Scales Rails
 
New Oracle Infrastructure2
New Oracle Infrastructure2New Oracle Infrastructure2
New Oracle Infrastructure2
 
0-60 with Goliath: Building High Performance Ruby Web-Services
0-60 with Goliath: Building High Performance Ruby Web-Services0-60 with Goliath: Building High Performance Ruby Web-Services
0-60 with Goliath: Building High Performance Ruby Web-Services
 
Choosing a Web Architecture for Perl
Choosing a Web Architecture for PerlChoosing a Web Architecture for Perl
Choosing a Web Architecture for Perl
 
Alfresco Search Internals
Alfresco Search InternalsAlfresco Search Internals
Alfresco Search Internals
 
Learn to love networking on iOS
Learn to love networking on iOSLearn to love networking on iOS
Learn to love networking on iOS
 
Async event based web server
Async event based web serverAsync event based web server
Async event based web server
 

Destaque

CodeCamp Iasi 10 march 2012 - websockets-with-atmosphere
CodeCamp Iasi 10 march 2012 - websockets-with-atmosphereCodeCamp Iasi 10 march 2012 - websockets-with-atmosphere
CodeCamp Iasi 10 march 2012 - websockets-with-atmosphereCodecamp Romania
 
Asynchronous Programming in ASP.NET
Asynchronous Programming in ASP.NETAsynchronous Programming in ASP.NET
Asynchronous Programming in ASP.NETChris Dufour
 
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...Doug Jones
 
DDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet
DDD Sydney 2011 - Getting out of Sync with IIS and Riding a CometDDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet
DDD Sydney 2011 - Getting out of Sync with IIS and Riding a CometRichard Banks
 
Tiberiu Covaci - Fast, Faster: Async Asp.net
Tiberiu Covaci - Fast, Faster: Async Asp.netTiberiu Covaci - Fast, Faster: Async Asp.net
Tiberiu Covaci - Fast, Faster: Async Asp.netCodecamp Romania
 

Destaque (6)

CodeCamp Iasi 10 march 2012 - websockets-with-atmosphere
CodeCamp Iasi 10 march 2012 - websockets-with-atmosphereCodeCamp Iasi 10 march 2012 - websockets-with-atmosphere
CodeCamp Iasi 10 march 2012 - websockets-with-atmosphere
 
What is new in ASP.NET Core
What is new in ASP.NET CoreWhat is new in ASP.NET Core
What is new in ASP.NET Core
 
Asynchronous Programming in ASP.NET
Asynchronous Programming in ASP.NETAsynchronous Programming in ASP.NET
Asynchronous Programming in ASP.NET
 
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
JavaScript: The Good Parts Or: How A C# Developer Learned To Stop Worrying An...
 
DDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet
DDD Sydney 2011 - Getting out of Sync with IIS and Riding a CometDDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet
DDD Sydney 2011 - Getting out of Sync with IIS and Riding a Comet
 
Tiberiu Covaci - Fast, Faster: Async Asp.net
Tiberiu Covaci - Fast, Faster: Async Asp.netTiberiu Covaci - Fast, Faster: Async Asp.net
Tiberiu Covaci - Fast, Faster: Async Asp.net
 

Semelhante a Improving the availability of your website

10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps FasterBrij Mishra
 
Difference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvcDifference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvcUmar Ali
 
Connected Web Systems
Connected Web SystemsConnected Web Systems
Connected Web SystemsDamir Dobric
 
Ajp notes-chapter-06
Ajp notes-chapter-06Ajp notes-chapter-06
Ajp notes-chapter-06Ankit Dubey
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performancerudib
 
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns FrameworksMike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns Frameworksukdpe
 
Introduction to ASPNET Core
Introduction to ASPNET CoreIntroduction to ASPNET Core
Introduction to ASPNET CorePuja Pramudya
 
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSPTechCon
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMAashish Jain
 
Asp.net Core Introduction.
Asp.net Core Introduction.Asp.net Core Introduction.
Asp.net Core Introduction.Talha Shahzad
 
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect Toolbox
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect ToolboxWebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect Toolbox
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect ToolboxWebCamp
 
Understanding the Single Thread Event Loop
Understanding the Single Thread Event LoopUnderstanding the Single Thread Event Loop
Understanding the Single Thread Event LoopTorontoNodeJS
 
PHP on Windows 2008
PHP on Windows 2008PHP on Windows 2008
PHP on Windows 2008jorke
 
Rest presentation
Rest  presentationRest  presentation
Rest presentationsrividhyau
 
Building Asynchronous Microservices with Armeria
Building Asynchronous Microservices with ArmeriaBuilding Asynchronous Microservices with Armeria
Building Asynchronous Microservices with ArmeriaLINE Corporation
 

Semelhante a Improving the availability of your website (20)

10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster10 tips to make your ASP.NET Apps Faster
10 tips to make your ASP.NET Apps Faster
 
Difference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvcDifference between asp.net web api and asp.net mvc
Difference between asp.net web api and asp.net mvc
 
Connected Web Systems
Connected Web SystemsConnected Web Systems
Connected Web Systems
 
Ajp notes-chapter-06
Ajp notes-chapter-06Ajp notes-chapter-06
Ajp notes-chapter-06
 
ASP.NET MVC Performance
ASP.NET MVC PerformanceASP.NET MVC Performance
ASP.NET MVC Performance
 
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns FrameworksMike Taulty MIX10 Silverlight 4 Patterns Frameworks
Mike Taulty MIX10 Silverlight 4 Patterns Frameworks
 
www.ppt
www.pptwww.ppt
www.ppt
 
Introduction to ASPNET Core
Introduction to ASPNET CoreIntroduction to ASPNET Core
Introduction to ASPNET Core
 
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechConSharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
SharePoint Data Anywhere and Everywhere by Chris Beckett - SPTechCon
 
ASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOMASP, ASP.NET, JSP, COM/DCOM
ASP, ASP.NET, JSP, COM/DCOM
 
Asp.net Core Introduction.
Asp.net Core Introduction.Asp.net Core Introduction.
Asp.net Core Introduction.
 
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect Toolbox
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect ToolboxWebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect Toolbox
WebCamp 2016: PHP.Алексей Петров.PHP at Scale: System Architect Toolbox
 
IIS 6.0 and asp.net
IIS 6.0 and asp.netIIS 6.0 and asp.net
IIS 6.0 and asp.net
 
Understanding the Single Thread Event Loop
Understanding the Single Thread Event LoopUnderstanding the Single Thread Event Loop
Understanding the Single Thread Event Loop
 
PHP on Windows 2008
PHP on Windows 2008PHP on Windows 2008
PHP on Windows 2008
 
ASP.NET Core
ASP.NET CoreASP.NET Core
ASP.NET Core
 
ASP.NET Core Overview
ASP.NET Core OverviewASP.NET Core Overview
ASP.NET Core Overview
 
Rest presentation
Rest  presentationRest  presentation
Rest presentation
 
Web api
Web apiWeb api
Web api
 
Building Asynchronous Microservices with Armeria
Building Asynchronous Microservices with ArmeriaBuilding Asynchronous Microservices with Armeria
Building Asynchronous Microservices with Armeria
 

Mais de Enea Gabriel

Moving forward with ASP.NET Core
Moving forward with ASP.NET CoreMoving forward with ASP.NET Core
Moving forward with ASP.NET CoreEnea Gabriel
 
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014Enea Gabriel
 
Applying EF Code First at Your Job
Applying EF Code First at Your JobApplying EF Code First at Your Job
Applying EF Code First at Your JobEnea Gabriel
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2Enea Gabriel
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstEnea Gabriel
 
Noutăţi în ASP.NET MVC 2
Noutăţi în ASP.NET MVC 2Noutăţi în ASP.NET MVC 2
Noutăţi în ASP.NET MVC 2Enea Gabriel
 
Introducere în ASP.NET MVC prin exemple
Introducere în ASP.NET MVC prin exempleIntroducere în ASP.NET MVC prin exemple
Introducere în ASP.NET MVC prin exempleEnea Gabriel
 
Magia testelor automate cu ASP.NET MVC
Magia testelor automate cu ASP.NET MVCMagia testelor automate cu ASP.NET MVC
Magia testelor automate cu ASP.NET MVCEnea Gabriel
 
Rute cu ASP.NET MVC
Rute cu ASP.NET MVCRute cu ASP.NET MVC
Rute cu ASP.NET MVCEnea Gabriel
 
Model View Controller și ASP.NET MVC + AJAX
Model View Controller și ASP.NET MVC + AJAXModel View Controller și ASP.NET MVC + AJAX
Model View Controller și ASP.NET MVC + AJAXEnea Gabriel
 

Mais de Enea Gabriel (11)

Moving forward with ASP.NET Core
Moving forward with ASP.NET CoreMoving forward with ASP.NET Core
Moving forward with ASP.NET Core
 
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
The future of ASP.NET / CodeCamp/Iasi 25 Oct 2014
 
Applying EF Code First at Your Job
Applying EF Code First at Your JobApplying EF Code First at Your Job
Applying EF Code First at Your Job
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
Elements of DDD with ASP.NET MVC & Entity Framework Code First v2
 
Elements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code FirstElements of DDD with ASP.NET MVC & Entity Framework Code First
Elements of DDD with ASP.NET MVC & Entity Framework Code First
 
Noutăţi în ASP.NET MVC 2
Noutăţi în ASP.NET MVC 2Noutăţi în ASP.NET MVC 2
Noutăţi în ASP.NET MVC 2
 
FII absolvent!
FII absolvent!FII absolvent!
FII absolvent!
 
Introducere în ASP.NET MVC prin exemple
Introducere în ASP.NET MVC prin exempleIntroducere în ASP.NET MVC prin exemple
Introducere în ASP.NET MVC prin exemple
 
Magia testelor automate cu ASP.NET MVC
Magia testelor automate cu ASP.NET MVCMagia testelor automate cu ASP.NET MVC
Magia testelor automate cu ASP.NET MVC
 
Rute cu ASP.NET MVC
Rute cu ASP.NET MVCRute cu ASP.NET MVC
Rute cu ASP.NET MVC
 
Model View Controller și ASP.NET MVC + AJAX
Model View Controller și ASP.NET MVC + AJAXModel View Controller și ASP.NET MVC + AJAX
Model View Controller și ASP.NET MVC + AJAX
 

Último

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Último (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
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
  • 2. How ASP.NET Requests Are Processed by the Thread Pool?
  • 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
  • 11. How Requests Are Processed by the Thread Pool
  • 12. What Can We Do to Improve the Availability?
  • 13. What Can We Do to Improve the Availability?
  • 14. Using Asynchronous methods R e q u e s t free IIS, ASP.NET Requests, Thread Pool, .NET Fx busy Web Services
  • 16. .NET Asynchronous Operations patterns  Synchronous code  .NET 1.0: Asynchronous Programming Model (APM) pattern
  • 17. .NET Asynchronous Operations patterns  Synchronous code  .NET 2.0: Event-based Asynchronous Pattern (EAP)
  • 18. .NET Asynchronous Operations patterns  Synchronous code  .NET 4.0: Task-based Asynchronous Pattern (TAP)
  • 19. .NET Asynchronous Operations patterns Synchronous code   .NET 1.0: compare  .NET 4.0:  .NET 2.0  .NET 4.5  async, await
  • 21. ASP.NET MVC - Asynchronous Operations Support  MVC3  AsyncController  AsyncManager  MVC4  Task-based asynchronous action methods
  • 22. DEMO
  • 23. DEMO  Bingoogle – Dual Search Engine  ASP.NET MVC3 -> MVC4
  • 24. Guidelines: When to use synchronous or asynchronous action methods?
  • 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
  • 28. Server Configuration for High Concurrency/Latency Web Service Calls
  • 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>
  • 30. Improving the Availability of Your Website in ASP.NET MVC4 Questions?
  • 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
  • 33. Diamond Sponsors Platinum Sponsors Gold Sponsors Training Partners Media Partners Other Partners