26
Scaling Out .NET Brian Ritchie Chief Architect Payformance Corporation Email: [email protected] Blog: http://weblog.asp.net/britchie Web: http://www.dotnetpowered.com Scale Out your .NET applications by leveraging IIS7, AppFabric, Web Farm Framework, and Web Deploy

Scaling Out .NET

Embed Size (px)

DESCRIPTION

Scale Out your .NET applications by leveraging IIS7, AppFabric, Web Farm Framework, and Web Deploy. Jax Code Camp 2011.

Citation preview

Page 1: Scaling Out .NET

Scaling Out .NET

Brian RitchieChief ArchitectPayformance Corporation

Email: [email protected]: http://weblog.asp.net/britchieWeb: http://www.dotnetpowered.com

Scale Out your .NET applications by leveraging IIS7, AppFabric, Web Farm Framework, and Web Deploy

Page 2: Scaling Out .NET

Who am I?

Brian Ritchie» Chief Architect at Payformance Corporation» Nearly 20 years of development experience» Developing on .NET since 1.0 Beta 1» Contributed to Mono and other open source

projects

Page 3: Scaling Out .NET

Reasons to scale out

» Increases Reliability

» Increases Performance

» Provides Elastic Scalability

Page 4: Scaling Out .NET

So why isn’t everyone doing it?

Page 5: Scaling Out .NET

Scale Out Challenges

» Design Considerations

» Management Complexities

» Maintenance Challenges

Page 6: Scaling Out .NET

Components of a scaled out architecture

» Load Balancing˃ Network Load Balancing˃ Queued Processing˃ Workflow Distribution

» Distributed Caching

Page 7: Scaling Out .NET

» Use load balancing to spread work across multiple machines

˃ Building out instead of building up uses lower cost

resources

˃ Elastic scaling for extra capacity

˃ Prevent single point of failure

Increase Reliability & PerformanceLoad Balancing

Page 8: Scaling Out .NET

» Network Load Balancing˃ NLB: Network Load Balancer˃ ARR: Application Request Routing˃ F5 BigIP Local Traffic Manager

Increase Reliability & PerformanceLoad Balancing Options

Page 9: Scaling Out .NET

» Workflow Distribution˃ Windows Server AppFabric

Increase Reliability & PerformanceLoad Balancing Options

Page 10: Scaling Out .NET

Increase Reliability & PerformanceLoad Balancing Options

» Queued Processing˃ Pick a queue: MSMQ, SQL Service Broker, SQL Table, etc.˃ Process it with a multi-threaded Always-On Services

Queue

WorkersEnqueue

Page 11: Scaling Out .NET

Effects of Queued Processing

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 210

10

20

30

40

50

60

70

80

90

100

NormalQueued

Page 12: Scaling Out .NET

» Using caching to decrease load on

centralized database resources

» Load balanced web servers required

shared session

Increase Reliability & PerformanceCaching

Page 13: Scaling Out .NET

» A Distributed Cache has these benefits:˃ In-Memory for Performance˃ Replicated for Reliability˃ ASP.NET providers for easy integration˃ Doesn’t add a single point of failure

» Options˃ Windows Server AppFabric Cache (“Velocity”)˃ MemCached

Increase Reliability & PerformanceDistribute Your Cache

Page 14: Scaling Out .NET

» A scaled out infrastructure presents its own set of challenges:˃ How do I provision resources easily?

˃ Do I need to manage each machine individually?

˃ How do I deploy application updates?

˃ How do I automate the manual tasks?

Management & MaintenanceChallenges

Page 15: Scaling Out .NET

The Solution…

Page 16: Scaling Out .NET

» IIS7+AppFabric: Application Platform˃ Unified application platform: web sites, web services, always-on services˃ Move your Windows Services to IIS7 with AppFabric to improve

management & deployment

Management & Maintenance Solutions:Application Platform

Page 17: Scaling Out .NET

» Web Deploy 2.1 ˃ Combines all build resources into one package and

makes deploying applications to the host server easy˃ Components• Command-line tools• Server-side service• MSBuild packaging support• Visual Studio configuration integration

Management & Maintenance Solutions:Deployment Automation

Page 18: Scaling Out .NET

» Web Deploy 2.1

Management & Maintenance Solutions:Deployment Automation

Build/Deploy Server

Deploy

IISServer

IIS MMC – Import Application

Package

Build Server(using MSBuild)

DeploymentPackage

IIS MMC – Export Application

Page 19: Scaling Out .NET

» Web Farm Framework 2.0˃ Centralized farm management˃ Easily provision resources˃ Distribute updates across the farm˃ Ease maintenance with rolling upgrades & automatic

load balancer control˃ Extensible: Plug-ins for managing 3rd party load

balancers

Management & MaintenanceSolutions

Page 20: Scaling Out .NET

» Web Farm Framework 2.0

Management & MaintenanceSolutions

control

Primary

control

synchronize

deploy

Page 21: Scaling Out .NET

Management & Maintenance Solutions: Monitoring via

AppFabric

» Windows Server AppFabric Dashboard

Page 22: Scaling Out .NET

Putting it all togetherwith a sample web farm

DEMO

Hardware load balancerBigIP F5

Web Farm• ASP.NET Web Application• IIS7• Web Farm Framework 2.0• Windows Server AppFabric• ASP.NET AppFabric Session Provider• Web Deploy

Cache Cluster• AppFabric Cache Service

Deployer• Web Deploy

Page 23: Scaling Out .NET

» System Center Operations Manager with Windows Server AppFabric Management Pack˃ AppFabric Event Collection service˃ AppFabric Workflow Management service˃ AppFabric Caching Service˃ AppFabric SQL monitoring databases˃ AppFabric SQL Workflow Instance Stores˃ AppFabric database connections˃ IIS Hosted WCF and WF services

Management & Maintenance Solutions: Monitoring via

Operations Manager

Page 24: Scaling Out .NET

» Automate using:

» Automation tools cover:• AppFabric• IIS7• Web Farm Farmwork

Powershell

API

Management & Maintenance Solutions: Task Automation

Page 25: Scaling Out .NET

Questions?

Page 26: Scaling Out .NET

» Web Farm Framework˃ Web Farm Framework

http://www.iis.net/download/WebFarmFramework˃ Scott Gu’s Introduce to WFF 2.0

http://weblogs.asp.net/scottgu/archive/2010/09/08/introducing-the-microsoft-web-farm-framework.aspx˃ WFF Documentation (including API & Powershell)

http://learn.iis.net/page.aspx/905/microsoft-web-farm-framework-20-for-iis-7/

» Windows AppFabric˃ AppFabric Architecture Guide

http://blogs.msdn.com/b/yasserabdelkader/archive/2010/09/12/release-of-windows-server-appfabric-architecture-guide.aspx˃ AppFabric Management Pack for Op Mgr 2007

http://blogs.technet.com/b/appfabric/archive/2010/06/14/appfabric-management-pack-available-for-operations-manager-2007.aspx˃ AppFabric Presentation

http://rstonkus.wordpress.com/2010/10/28/partner-conference-windows-server-appfabric/

» Other˃ Memcached ASP.NET Providers

http://memcachedproviders.codeplex.com/˃ SQL Table Queues

http://www.mssqltips.com/tip.asp?tip=1257˃ Azure Scalability using Queues

http://www.cloudbook.net/resources/stories/-azure-scalability--use-queues-as-your-bridges˃ Web Deploy Team Blog

http://blogs.iis.net/msdeploy/default.aspx˃ Application Request Routing

http://www.iis.net/download/ApplicationRequestRoutinghttp://learn.iis.net/page.aspx/486/http-load-balancing-using-application-request-routing/http://blogs.iis.net/mailant/archive/2010/03/25/how-iis-application-request-routing-arr-powers-elastic-scale-for-maximumasp.aspx

Learn More