running a global massively scalable web application on microsoft
TRANSCRIPT
Running a Global Massively Scalable Web Application on Windows Azure Websites
Andrew WestgarthDEV-B341
Setting expectations and context
Architecting for scale – a web app journey to scalability
Scaling ‘real-world’ applications
Agenda
Why Architect for the cloud?
2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 20200%
50%
100%
150%
200%
250%
% o
f 201
0 Ap
p Po
rtfo
lio
Who uses Azure Websites?
Web Appsblogs.office.com, blog.surface.com, Skype & Bing dev center, Nokia, more… Examples: mobile apps, web APIs, facebook games, many more...
Ready for businessExtremely low to ‘no perceived’ downtime (99.95% - 99.99%)Performance and (global) low latency‘Easy’ to manage: DevOps, test, deploy, configure, monitor & analytics
Massive ScaleMany tens of millions of requests per day (100M or higher)Peak Request per Second of many thousands (5K – 10K RPS)
Massive Scale & Ready For Business Web Apps
Losing Business
Downtime
Slow Site
The ability of a system, (a web site)to handle a growing amount of work (http traffic) in a capable manner, (doesn’t go belly up) or its ability to be enlarged to accommodate that growth
Scalability is:
Source:http://en.wikipedia.org/wiki/Scalability
Scale Up– aka Vertical Scaling
Increase resources capacity within existing node
Scaling OptionsScale Out – aka Horizontal Scaling
Increase resources capacity by adding nodes
Architecting for ScaleA web app’s journey towards
scalability
Level 1 Level 2 Boss Level # of users
>100,000
RPS
>10,000
RPS
>100RPS
A web app’s journey towards scalability
Architecting for ScaleLevel 1: Beginners
Website
Level 1 – Photo Gallery (untouched)
DB
<code>
Content
•Database stored on local disk•Session state stored in local memory•Images stored on local disk*•Statefull Application
*Local disk should be treated as a shared resource in Azure Websites
Session
Level 1 – Photo Gallery (untouched)Scale Testing Results:
Scale Count
Scale Size
Test Duratio
n
Max User
Count
Avg Pages/Se
cAvg Page Time (sec)
Avg RPS (Visual Studio)
WebSites RPS
Failed Tests
Total Tests
Failed Tests (%)
1 MED 15 2 0.27 1.16 1.77 1 0 77 0.0
1 MED 15 20 1.9 6.5 14.2 18 0 559 0.0
1 MED 15 50 3.48 10.4 39.5 45 1 980 0.1
1 MED 15 80 5.58 12.5 51.5 55 0 1639 0
1 MED 15 120 4.95 22.5 47.8 50 19 1446 1.3
Architecting for ScaleLevel 2: Experts
Level 2 – Horizontally Scalable Photo Gallery
Website
DB
<code>
Content
Session
Move database to cloud (SQL Azure)Move site content to blob (Azure Storage)Make site stateless
Non-Sticky Session
Horizontal scale Web Tier
Level 2 – Horizontally Scalable Photo GalleryStrategy:
Level 2 – Horizontally Scalable Photo GalleryScale Testing Results
Scale Count
Scale Size
Test Duratio
nMax User
Count
Avg Pages/S
ec
Avg Page Time (sec)
Avg RPS (Visual Studio)
WAWS RPS
Failed Tests
Total Tests
Failed Tests (%)
1 LARGE 15 20 2.91 0.13 23.4 21 0 849 0.0
1 LARGE 15 100 14.4 0.15 232 77 0 4,247 0.0
1 LARGE 15 200 29.2 0.14 966 155 0 8,563 0.0
1 LARGE 15 300 43.6 0.24 2,535 231 0 12,839 0.0
1 LARGE 15 1,000 141 0.67 8,135 735 0 20,591 0.0
3 LARGE 20 1,500 198 1.37 19,855 1297 1 32,763 0.0
3 LARGE 25 2,000 242 2.12 24,896 1547 870 53,496 1.6
Configure Auto ScaleOptimize Website CodeOptimize SQLAdd Cache LayerUse CDN for content, *.js & *.cssLeverage other services
Level 2 – Horizontally Scalable Photo GalleryOther improvements:
Level 1 Level 2 Boss Level # of users
>100,000
RPS
>10,000
RPS
>100RPS
A web app’s journey towards scalability
Architecting for ScaleLevel 3: Like a BOSS!
Level 3 – Globally Scalable Photo GalleryWhen bad things happen to good datacenters
West US
My SiteReplica
(A)
East US
My SiteReplica
(B)
Gaps:Web app is ‘local’ to a single regionImages stored in ‘local’ data centerDatabase in ‘local’ data center
Goals:Active / Active replication across regions
Benefits:Bigger ScaleLower LatencyHigher Uptime and DR
Level 3 – Globally Scalable Photo GalleryMoving towards a global presence
Level 3 – Globally Scalable Photo GalleryArchitecture:
East US
Website
Webjob
West US
Website
Webjob
Level 3 – Globally Scalable Photo GalleryArchitecture:
East US
Website
Webjob
West US
Website
Webjob
Copy images to remote regionsUse queue (CQRS*) to update DBAsynchronous data processing with WebJobsAdd Traffic Manager Controlled and synchronized deployment (Site Slots)
Level 3 – Globally Scalable Photo GalleryStrategy:
* Command Query Responsibility Segregation adds latency and app complexity
West US
Website
Webjob
Using a queue to sync DB access leads to eventual consistency Syncing database works for ‘most’ scenarios Active / Active state is app dependent
Level 3 – Globally Scalable Photo GalleryWords of Caution:
West US
Website
Webjob
Level 1 Level 2 Boss Level # of users
>100,000
RPS
>10,000
RPS
>100RPS
A web app’s journey towards scalability
Architecting for ScaleMassive Scale WordPress
Scaling a standard Azure website to 380k queries per minute
Architecture for weblogs.asp.net on Azure Websites
Recommended Reading
Azure Websites can scale to answer all you business scale needs.With Azure Websites your websites is always running (no perceived downtime…)Azure Websites has rich core functionalityIt is easy to develop and maintain my Azure Website
Summary
You can always reach me here:Twitter: @apwestgarthEmail: [email protected]
Don’t go! I have more questions!
ResourcesLearning
Microsoft Certification & Training Resourceswww.microsoft.com/learning
Developer Network
http://developer.microsoft.com
TechNetResources for IT Professionals
http://microsoft.com/technet
Sessions on Demandhttp://channel9.msdn.com/Events/TechEd
http://www.visualstudio.comhttp://blogs.msdn.com/b/developer-tools/http://msdn.microsoft.com/vstudio
DEV Track Resources
visualstudio
@visualstudio
visualstudio
TechEd Mobile app for session evaluations is currently offline
SUBMIT YOUR TECHED EVALUATIONSFill out an evaluation viaCommNet Station/PC: Schedule BuilderLogIn: europe.msteched.com/catalog
We value your feedback!
© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.