45
Ionut Antiu www.get-jukebox.com @johnnyantiu

How to scale to 100k users using Windows Azure

Embed Size (px)

Citation preview

Page 1: How to scale to 100k users using Windows Azure

Ionut Antiu

www.get-jukebox.com

@johnnyantiu

Page 2: How to scale to 100k users using Windows Azure

1. What are we talking about

2. What is Style Jukebox

3. What were the challenges

4. Wrap up

Page 3: How to scale to 100k users using Windows Azure

Style Jukebox is a High Fidelity cloud-music streaming service that helps you keep all your music – be it bought, self-produced,

or imported from CDs or other media, always backed up and synced across all your devices.

Page 4: How to scale to 100k users using Windows Azure

TRACTION

125,000+ registered users

52,000+ MAU

Peak of 13,000 users DAU

4,5+ million songs stored in the Cloud

50,000 – 100,000 songs listened daily

Page 5: How to scale to 100k users using Windows Azure

Low latency

Scalability

High Availability

OBJECTIVES

Page 6: How to scale to 100k users using Windows Azure

What is the basic Cloud architecture?

Page 7: How to scale to 100k users using Windows Azure

“LE SERVER”

Database SQL Storage

API

LE CLIENT APP LE CLIENT APP LE CLIENT APP

Page 8: How to scale to 100k users using Windows Azure

“LE SERVER”

API

LE CLIENT APP LE CLIENT APP LE CLIENT APP

STORAGE

Windows Azure Storage Blobs

DATABASE

SQL Azure

Page 9: How to scale to 100k users using Windows Azure

Scale Up Scale Out

Database, API, Content bandwidth, Website

Page 10: How to scale to 100k users using Windows Azure

Scale Up

One operation that cannot be divided requires more compute power

(Audio/Video encoding, Your own DB, etc.)

Basic A11 Core AMD CPU1,75 GB RAMEUR 41/month*

G5, 32 coresIntel Xeon448 GB RAM6 TB EUR 4865/month*

Page 11: How to scale to 100k users using Windows Azure

Scale Out

Used for API, Website, etc.

Ex: Each machine can have a limited number of connected users

Basic A11 Core AMD CPU1,75 GB RAMEUR 41/month*

4xBasic A11 Core AMD CPU1,75 GB RAMEUR 41/month*

Page 12: How to scale to 100k users using Windows Azure

SYNC SERVICE

API (GetSongURL, Login)

LE CLIENT APP LE CLIENT APP LE CLIENT APP

STORAGE

Windows Azure Storage Blobs

DATABASE

SQL Azure

BLOCK SERVICE

API (DownloadSong, UploadSong)

Page 13: How to scale to 100k users using Windows Azure

SYNC SERVICE

API (GetSongURL, Login)

LE CLIENT APP LE CLIENT APP LE CLIENT APP

STORAGE

Windows Azure Storage Blobs

DATABASE

SQL Azure

BLOCK SERVICE

API (DownloadSong, UploadSong)

MEMCACHE

Redis

Memcache Worker

Page 14: How to scale to 100k users using Windows Azure

The Memcache Worker predicts and prepares the results

Memcache Hit Ratio 86-91%

Reduced time of response with 80% to an average of 250ms

Page 15: How to scale to 100k users using Windows Azure

SYNC SERVICE

API (GetSongURL, Login)

LE CLIENT APP LE CLIENT APP LE CLIENT APP

STORAGE

Windows Azure Storage Blobs

DATABASE

SQL Azure

BLOCK SERVICE

API (DownloadSong, UploadSong)

MEMCACHE

Redis

Memcache Worker

CDN

Windows Azure CDN

CDN Worker

Page 16: How to scale to 100k users using Windows Azure

SYNC SERVICE

API (GetSongURL, Login)

LE CLIENT APP LE CLIENT APP LE CLIENT APP

STORAGE

Windows Azure Storage Blobs

DATABASE

SQL Azure

BLOCK SERVICE

API (DownloadSong, UploadSong)

MEMCACHE

Redis

Memcache Worker

CDN

Windows Azure CDN

CDN Worker

STORAGE

Upload Buffer

Upload Processing

Page 17: How to scale to 100k users using Windows Azure

SYNC SERVICE

API (GetSongURL, Login)

LOAD BALANCER

LE CLIENT APP LE CLIENT APP LE CLIENT APP

STORAGE

Windows Azure Storage Blobs

DATABASE

SQL Azure

BLOCK SERVICE

API (DownloadSong, UploadSong)

LOAD BALANCER

MEMCACHE

Redis

Memcache Worker

CDN

Windows Azure CDN

CDN Worker

STORAGE

Upload Buffer

Upload Processing

Download Processing

Page 18: How to scale to 100k users using Windows Azure

Load Balancer

Integrated in the Azure Cloud Services

Makes sure all instances have the same loadAuto-Scale creates new instances or removes automatically

Page 19: How to scale to 100k users using Windows Azure
Page 20: How to scale to 100k users using Windows Azure

SYNC SERVICE

API (GetSongURL, Login)

LOAD BALANCER

LE CLIENT APP LE CLIENT APP LE CLIENT APP

STORAGE

Windows Azure Storage Blobs

DATABASE

SQL Azure

BLOCK SERVICE

API (DownloadSong, UploadSong)

LOAD BALANCER

MEMCACHE

Redis

Memcache Worker

CDN

Windows Azure CDN

CDN Worker

STORAGE

Upload Buffer

Upload Processing

Download Processing

TRAFFIC MANAGER

Page 21: How to scale to 100k users using Windows Azure

SYNC SERVICE – WEST US

API (GetSongURL, Login)

DATABASE - AMSTERDAM

SQL Azure

Page 22: How to scale to 100k users using Windows Azure

SYNC SERVICE – WEST US

API (GetSongURL, Login)

DATABASE - AMSTERDAM

SQL Azure

~ 9,000 km * 3 calls = ~ 30,000 km

30,000 km : 300,000km/s = 100 ms

Page 23: How to scale to 100k users using Windows Azure

LE CLIENT APP LE CLIENT APP LE CLIENT APP

TRAFFIC MANAGER

SYNC – WEST US

API x VMs

LOAD BALANCER

BLOCK – WEST US

API x VMs

LOAD BALANCER

SYNC – WEST EU

API x VMs

LOAD BALANCER

BLOCK – WEST EU

API x VMs

LOAD BALANCER

CDN

Windows Azure CDN

STORAGE

Windows Azure Storage Blobs

MAIN DATABASE – WEST EU

SQL Azure

MEMCACHE – WEST EU

Redis

SLAVE DATABASE – WEST US

SQL Azure

MEMCACHE 2 – WEST US

Redis

STORAGE

Upload Buffer

Page 24: How to scale to 100k users using Windows Azure

Traffic Manager

stylejukebox.trafficmanager.net

4 VM machinesin West Europe

4 VM machinesin West US

Closest location to the userLoad balancing

Fail-overWorks for Websites, Cloud Services

Page 25: How to scale to 100k users using Windows Azure

Azure Datacenters

Page 26: How to scale to 100k users using Windows Azure

How to test?

Page 27: How to scale to 100k users using Windows Azure
Page 28: How to scale to 100k users using Windows Azure
Page 29: How to scale to 100k users using Windows Azure
Page 30: How to scale to 100k users using Windows Azure

Test 1

1,000 concurrent users1 core machine

Page 31: How to scale to 100k users using Windows Azure
Page 32: How to scale to 100k users using Windows Azure
Page 33: How to scale to 100k users using Windows Azure
Page 34: How to scale to 100k users using Windows Azure

Test 2

1,000 concurrent users4 core machine

$ 0,4 more per hour

Page 35: How to scale to 100k users using Windows Azure
Page 36: How to scale to 100k users using Windows Azure
Page 37: How to scale to 100k users using Windows Azure

Autoscale applies to Cloud Services and Websites

1 core machine can handle 200 connections simultaneous

4 core machine can handle 1,000 connections simultaneous

Page 38: How to scale to 100k users using Windows Azure

Monitoring

Page 39: How to scale to 100k users using Windows Azure

NewRelic

Page 40: How to scale to 100k users using Windows Azure
Page 41: How to scale to 100k users using Windows Azure
Page 42: How to scale to 100k users using Windows Azure
Page 43: How to scale to 100k users using Windows Azure

Always prepare for things to go wrong

Ex: Routers on the Internet

Page 44: How to scale to 100k users using Windows Azure

Low latency

Scalability

High Availability

OBJECTIVES

Page 45: How to scale to 100k users using Windows Azure

Ionut Antiu

www.get-jukebox.com

@johnnyantiu