35

Running a Global Massively Scalable Web Application on Microsoft

Embed Size (px)

Citation preview

Page 1: Running a Global Massively Scalable Web Application on Microsoft
Page 2: Running a Global Massively Scalable Web Application on Microsoft

Running a Global Massively Scalable Web Application on Windows Azure Websites

Andrew WestgarthDEV-B341

Page 3: Running a Global Massively Scalable Web Application on Microsoft

Setting expectations and context

Architecting for scale – a web app journey to scalability

Scaling ‘real-world’ applications

Agenda

Page 4: Running a Global Massively Scalable Web Application on Microsoft

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

Page 5: Running a Global Massively Scalable Web Application on Microsoft

Who uses Azure Websites?

Page 6: Running a Global Massively Scalable Web Application on Microsoft

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

Page 7: Running a Global Massively Scalable Web Application on Microsoft

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

Page 8: Running a Global Massively Scalable Web Application on Microsoft

Scale Up– aka Vertical Scaling

Increase resources capacity within existing node

Scaling OptionsScale Out – aka Horizontal Scaling

Increase resources capacity by adding nodes

Page 9: Running a Global Massively Scalable Web Application on Microsoft

Architecting for ScaleA web app’s journey towards

scalability

Page 10: Running a Global Massively Scalable Web Application on Microsoft

Level 1 Level 2 Boss Level # of users

>100,000

RPS

>10,000

RPS

>100RPS

A web app’s journey towards scalability

Page 11: Running a Global Massively Scalable Web Application on Microsoft

Architecting for ScaleLevel 1: Beginners

Page 12: Running a Global Massively Scalable Web Application on Microsoft

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

Page 13: Running a Global Massively Scalable Web Application on Microsoft

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

Page 14: Running a Global Massively Scalable Web Application on Microsoft

Architecting for ScaleLevel 2: Experts

Page 15: Running a Global Massively Scalable Web Application on Microsoft

Level 2 – Horizontally Scalable Photo Gallery

Website

DB

<code>

Content

Session

Page 16: Running a Global Massively Scalable Web Application on Microsoft

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:

Page 17: Running a Global Massively Scalable Web Application on Microsoft

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

Page 18: Running a Global Massively Scalable Web Application on Microsoft

Configure Auto ScaleOptimize Website CodeOptimize SQLAdd Cache LayerUse CDN for content, *.js & *.cssLeverage other services

Level 2 – Horizontally Scalable Photo GalleryOther improvements:

Page 19: Running a Global Massively Scalable Web Application on Microsoft

Level 1 Level 2 Boss Level # of users

>100,000

RPS

>10,000

RPS

>100RPS

A web app’s journey towards scalability

Page 20: Running a Global Massively Scalable Web Application on Microsoft

Architecting for ScaleLevel 3: Like a BOSS!

Page 21: Running a Global Massively Scalable Web Application on Microsoft

Level 3 – Globally Scalable Photo GalleryWhen bad things happen to good datacenters

West US

My SiteReplica

(A)

East US

My SiteReplica

(B)

Page 22: Running a Global Massively Scalable Web Application on Microsoft

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

Page 23: Running a Global Massively Scalable Web Application on Microsoft

Level 3 – Globally Scalable Photo GalleryArchitecture:

East US

Website

Webjob

West US

Website

Webjob

Page 24: Running a Global Massively Scalable Web Application on Microsoft

Level 3 – Globally Scalable Photo GalleryArchitecture:

East US

Website

Webjob

West US

Website

Webjob

Page 25: Running a Global Massively Scalable Web Application on Microsoft

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

Page 26: Running a Global Massively Scalable Web Application on Microsoft

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

Page 27: Running a Global Massively Scalable Web Application on Microsoft

Level 1 Level 2 Boss Level # of users

>100,000

RPS

>10,000

RPS

>100RPS

A web app’s journey towards scalability

Page 28: Running a Global Massively Scalable Web Application on Microsoft

Architecting for ScaleMassive Scale WordPress

Page 30: Running a Global Massively Scalable Web Application on Microsoft

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

Page 31: Running a Global Massively Scalable Web Application on Microsoft

You can always reach me here:Twitter: @apwestgarthEmail: [email protected]

Don’t go! I have more questions!

Page 32: Running a Global Massively Scalable Web Application on Microsoft

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

Page 33: Running a Global Massively Scalable Web Application on Microsoft

http://www.visualstudio.comhttp://blogs.msdn.com/b/developer-tools/http://msdn.microsoft.com/vstudio

DEV Track Resources

visualstudio

@visualstudio

visualstudio

Page 34: Running a Global Massively Scalable Web Application on Microsoft

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!

Page 35: Running a Global Massively Scalable Web Application on Microsoft

© 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.