scaling out .net
DESCRIPTION
Scale Out your .NET applications by leveraging IIS7, AppFabric, Web Farm Framework, and Web Deploy. Jax Code Camp 2011.TRANSCRIPT
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
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
Reasons to scale out
» Increases Reliability
» Increases Performance
» Provides Elastic Scalability
So why isn’t everyone doing it?
Scale Out Challenges
» Design Considerations
» Management Complexities
» Maintenance Challenges
Components of a scaled out architecture
» Load Balancing˃ Network Load Balancing˃ Queued Processing˃ Workflow Distribution
» Distributed Caching
» 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
» Network Load Balancing˃ NLB: Network Load Balancer˃ ARR: Application Request Routing˃ F5 BigIP Local Traffic Manager
Increase Reliability & PerformanceLoad Balancing Options
» Workflow Distribution˃ Windows Server AppFabric
Increase Reliability & PerformanceLoad Balancing Options
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
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
» Using caching to decrease load on
centralized database resources
» Load balanced web servers required
shared session
Increase Reliability & PerformanceCaching
» 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
» 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
The Solution…
» 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
» 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
» 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
» 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
» Web Farm Framework 2.0
Management & MaintenanceSolutions
control
Primary
control
synchronize
deploy
Management & Maintenance Solutions: Monitoring via
AppFabric
» Windows Server AppFabric Dashboard
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
» 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
» Automate using:
» Automation tools cover:• AppFabric• IIS7• Web Farm Farmwork
Powershell
API
Management & Maintenance Solutions: Task Automation
Questions?
» 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