SlideShare a Scribd company logo
More Cache for Less Cash 
Michael S. Collier 
@MichaelCollier 
DevLink 2014 – August 27, 2014
Today’s Agenda 
• Why Cache? 
• Cache Options in Azure 
• Demos 
• Monitoring and Scaling 
• Pricing and Features 
3
Why Cache? 
4 
Azure Load 
Balancer 
Web Tier 
Business Tier 
Data Tier
Why Cache? 
5 
Azure Load 
Balancer 
Web Tier 
Business Tier 
Cache Cache Tier 
Data Tier
What is Azure Cache Service? 
A distributed, in-memory, 
flexible cache for all data 
types that can be used to 
speed up Azure 
applications and reduce 
database load. 
Basically, cache helps your app 
6 
become faster. 
Windows Azure Cache
A Cache Story 
Shared Cache 
• Cloud Services 
• Shared – quotas 
• Lacked feature parity 
• Multiple size options 
• Expensive 
• Performance challenged 
• Throttling 
• Deprecated August 2014 
In-Role Cache 
• Cloud Services 
• Co-located (free) 
• Dedicated ($$) 
• Feature parity 
• Good performance 
• Not multi-tenant 
Cache Service 
• Cloud Services, Web Sites, 
or VMs 
• Feature parity 
• Managed infrastructure 
• Price/capacity tiers 
• Good performance (1ms 
read) 
7
A Cache Story 
Shared Cache 
• Cloud Services 
• Shared – quotas 
• Lacked feature parity 
• Multiple size options 
• Expensive 
• Performance challenged 
• Throttling 
• Deprecated August 2014 
In-Role Cache 
• Cloud Services 
• Co-located (free) 
• Dedicated ($$) 
• Feature parity 
• Good performance 
• Not multi-tenant 
Cache Service 
• Cloud Services, Web Sites, 
or VMs 
• Feature parity 
• Managed infrastructure 
• Price/capacity tiers 
• Good performance (1ms 
read) 
8
A Cache Story 
Shared Cache 
• Cloud Services 
• Shared – quotas 
• Lacked feature parity 
• Multiple size options 
• Expensive 
• Performance challenged 
• Throttling 
• Deprecated August 2014 
In-Role Cache 
• Cloud Services 
• Co-located (free) 
• Dedicated ($$) 
• Feature parity 
• Good performance 
• Not multi-tenant 
Cache Service 
• Cloud Services, Web Sites, 
or VMs 
• Feature parity 
• Managed infrastructure 
• Price/capacity tiers 
• Good performance (1ms 
read) 
9
A Cache Story 
Shared Cache 
• Cloud Services 
• Shared – quotas 
• Lacked feature parity 
• Multiple size options 
• Expensive 
• Performance 
challenged 
• Throttling 
• Deprecated August 
2014 
In-Role Cache 
• Cloud Services 
• Co-located (free) 
• Dedicated ($$) 
• Feature parity 
• Good performance 
• Not multi-tenant 
Cache Service 
• Cloud Services, Web 
Sites, or VMs 
• Feature parity 
• Managed 
infrastructure 
• Price/capacity tiers 
• Good performance 
(1ms read) 
Redis Cache 
• TBD 
• TBD 
• TBD 
• TBD 
http://aka.ms/MigrateFromSharedCaching 
10
In-Role Cache (Co-located) 
11 
Source: Windows Azure Training Kit
In-Role Cache (Dedicated) 
12 
Source: Windows Azure Training Kit
In-Role Cache (Dedicated) 
13 
Source: Windows Azure Training Kit
In-Role Cache 
• Based on the AppFabric Cache engine 
• Released w/ Oct. 2012 release of Azure SDK 1.8 
• Cache part of your Cloud Service application 
• No quotas or throttling 
• Isolation, flexibility, and control 
• High performance 
• Features: named cache, regions, tagging, HA, local, notifications 
• Pro: You manage as part of your application 
• Con: You manage it; only available to Cloud Service roles in 
same deployment 
14
Create and Configure In-Role Cache 
Configure a Role in the Cloud Service to host the cache 
15
Configure the Cache Clients 
• Use NuGet to configure the cache clients 
• Microsoft.WindowsAzure.Caching 
• Settings placed in web.config or app.config 
• Modify to point to the cache server role 
<dataCacheClients> 
<dataCacheClient name="default"> 
16 
<!--To use the in-role flavor of Windows Azure Cache, set identifier to be the cache cluster role name --> 
<!--To use the Windows Azure Cache Service, set identifier to be the endpoint of the cache cluster --> 
<autoDiscover isEnabled="true" identifier="MyScores.Web" /> 
<!--<localCache isEnabled="true" sync="TimeoutBased" objectCount="100000" ttlValue="300" />--> 
</dataCacheClient> 
</dataCacheClients> 
Role Name
17 
DEMO TIME!!!
Recap 
1. Select “Enable Caching” in Azure role 
configuration 
2. Install NuGet package 
(Microsoft.WindowsAzure.Caching) 
3. Set role name in web.config 
4. Get/Set data 
18
Monitoring the Cache 
Diagnostic 
Level 
Data Collected 
0 Critical/catastrophic server logs only 
1 Data to help in assessing usage patterns, cache health, and potential errors. 
Default. 
2 Fine grain data for all requests and important system information 
3 Diagnostic data with more verboseness and system information 
4 Highest verbosity logs for all requests and system information 
Provides a single setting for cache servers and clients 
Configures levels for logs, traces, performance counters & crash dumps 
Full details at http://aka.ms/CacheDiagnostics 
19
Monitoring the Cache 
• Set cache diagnostic level in configuration or portal 
• Level (1-4) controls verbosity, perf counters, & 
crash dumps. 
• Start at 1 and increase as needed 
<Role name="WorkerRole1"> 
20 
<Instances count="1" /> 
<ConfigurationSettings> 
<!– Cache Server --> 
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel“ value="1" /> 
<!– Cache Client--> 
<Setting name="Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel" value="1" /> 
</ConfigurationSettings> 
</Role> 
Full details at http://mcollier.net/AzureCacheDiag
Monitoring the Cache 
public class WebRole : RoleEntryPoint 
{ 
public override bool OnStart() 
{ 
21 
// Enable cache diagnostics 
DiagnosticMonitorConfiguration dmConfig = 
DiagnosticMonitor.GetDefaultInitialConfiguration(); 
// Configure collection of cache diagnostic data. 
CacheDiagnostics.ConfigureDiagnostics(dmConfig); 
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", 
dmConfig); 
return base.OnStart(); 
} 
}
Considerations 
• Unable to create DataCache in RoleEntryPoint 
• Max object size is 8MB post serialized 
• Default serializer is NetDataContractSerializer 
• Cost only for role instances 
• Only accessible from within same Cloud Service 
• Deployment will impact the cache (instances recycle) 
22
What’s the Azure Managed Cache Service? 
23 
App1 VM VM 
App2 
Shared Azure 
Website Stamp 
VM 
IaaS VMs 
Cloud Services 
Azure Managed Cache Service 
1. SLA backed 
2. Microsoft Managed 
3. Scalable & Resilient
Create and Configure the Cache Service 
• Based on AppFabric Cache engine 
• Create via PowerShell only  
• Manage in Azure management portal 
• Choose an offering 
• Basic (128MB to 1GB in 128MB units, 1 named cache) 
• Standard (1GB to 10GB in 1GB units, notifications, and 10 named caches) 
• Premium (5GB to 150GB in 5GB units, notifications, HA, and 10 named caches) 
• Locate in same region as client for best perf and cost 
24
Create and Configure the Cache Service 
PS C:> New-AzureManagedCache -Name devlinkcache ` 
25 
-Location "East US" ` 
-Sku Basic ` 
-Memory 128MB
26 
DEMO TIME!!!
Recap 
1. Create Managed Cache via PowerShell 
2. Install NuGet package 
(Microsoft.WindowsAzure.Caching) 
3. Set cache service endpoint & key in web.config 
4. Get/Set data 
27
Monitoring the Cache 
28
Scaling the Cache 
29 
Dynamically scale without loosing any existing data
High Availability 
30 
Client Primary 
Secondary 
Read / Write 
Write 
Premium only 
Doubles required memory 
Increased latency & decreased throughput
Pricing Details 
31 
Basic Standard Premium 
Price Per Unit 
(Preview) 
$25/month 
(prorated hourly) 
$100/month 
(prorated hourly) 
$400/month 
(prorated hourly) 
Cache Size 128 MB 1 GB 5 GB 
Scale Up to 8 units Up to 10 units Up to 30 units 
Named Caches 1 10 10 
High Availability    
Notifications    
See http://mcollier.net/AzureCachePricing
Benefits of the Azure Managed Cache Service 
• Use from any app types (VM, Web Site, Mobile Service, Cloud Service) 
• Each instance deployed within dedicated VMs (fast, predictable 
performance) 
• No quotas or throttling 
• Store up to 150GB per cache instance 
• Avg. retrieval time of 1ms. Insert in about 1.2ms 
• Highly available / distributed across multiple servers 
• Managed service – focus on apps not infrastructure 
• Same .NET cache API used with in-role cache for Cloud Services 
• Support for ASP.NET Session State and Page Output Caching 
• Unique cache service instance for each app, or share across apps 
32
Azure Redis Cache (Preview) 
• Secure, dedicated Redis cache 
• Hosting and monitoring by Microsoft 
• 250MB – 26GB (Preview) 
• Tiers 
• Basic – single node; dev/test and non-critical workloads 
• Standard – provides master/slave replication 
33
Azure Redis Cache (Preview) 
34
Monitoring and Alerts 
• Set metrics and 
timeframe to monitor 
• Pin to dashboard 
• Alert when threshold 
reached 
35
36 
DEMO TIME!!!
Recap 
1. Create Redis Cache via portal 
2. Add Redis C# client (e.g. StackExchange.Redis) 
3. Obtain Redis endpoint and password from portal 
4. Determine formatter for .NET objects 
5. Get/Set data 
37
Common Architecture 
38 
Web Roles 
Storage Table 
3. Write 
1. Read 
Windows Azure Cache 
2. Read
Common Architecture 
39 
Windows Azure Load Balancer Web Roles Worker Roles 
SQL Database 
(Azure) 
Read 
Azure Cache 
Read 
Preload the cache 
Carefully choose expiration 
and eviction settings
Common Architecture 
40 
Azure Load Balancer Web Roles Storage Queue Worker Roles 
Storage Table SQL Database 
(Azure) 
Azure Cache 
Write Read 
Write 
Read 
Write
Cloud Service Fundamentals - Caching 
• Factory implementation 
• Custom BinarySerializer class 
• protobuf-net 
• Fast and small 
http://mcollier.net/AzureCSF 
41
What Cache? 
• Azure Shared Cache – out of service on September 1, 2014 
42 
New 
Development 
Need GA and 
SLA
Where to Cache? 
43 
Mix cache solutions for price / manageability / features 
Azure Load Balancer Web Roles 
Azure Cache 
Read 
• Data shared by other 
services/apps 
• General application 
data 
In-role 
cache 
• Session / Page Output Cache 
• FREE!
Summary 
• In-Role Cache 
• Cloud Services only 
• Co-located (free) or Dedicated ($$$) 
• Isolated cache-related workload 
• Cache Service 
• Microsoft managed service, dedicated tenant, SLA backed 
• Cloud Services, Web Sites, and VMs 
• Full parity with in-role cache (SDK) 
• Redis Cache 
• Microsoft managed Redis Cache 
• Master/Slave replication in Standard tier 
• Normal Redis features/functionality 
44
More Resources 
• Azure Cache Options Overview 
• http://msdn.microsoft.com/en-us/library/azure/gg278356.aspx 
• Which Azure Cache Offering is right for me? 
• http://msdn.microsoft.com/en-us/library/azure/dn766201.aspx 
• Cloud Service Fundamentals – Caching Basics 
• http://azure.microsoft.com/blog/2013/10/03/cloud-service-fundamentals-caching-basics/ 
• Capacity Planning Spreadsheet (In-Role Cache) 
• http://msdn.microsoft.com/en-us/library/hh914129 
• Lap around Azure Redis Cache 
• http://azure.microsoft.com/blog/2014/06/04/lap-around-azure-redis-cache-preview/ 
45
Ask your questions

More Related Content

PPTX
Inside Azure Diagnostics (DevLink 2014)
Michael Collier
 
PPTX
More Cache for Less Cash
Michael Collier
 
PPTX
Automating Your Microsoft Azure Environment (DevLink 2014)
Michael Collier
 
PPTX
Windows Azure Mobile Services - The Perfect Partner
Michael Collier
 
PPTX
Inside Azure Diagnostics
Michael Collier
 
PPTX
Programming Azure Active Directory (DevLink 2014)
Michael Collier
 
PPTX
Automating Your Azure Environment
Michael Collier
 
PPTX
What's New for the Windows Azure Developer? Lots! (July 2013)
Michael Collier
 
Inside Azure Diagnostics (DevLink 2014)
Michael Collier
 
More Cache for Less Cash
Michael Collier
 
Automating Your Microsoft Azure Environment (DevLink 2014)
Michael Collier
 
Windows Azure Mobile Services - The Perfect Partner
Michael Collier
 
Inside Azure Diagnostics
Michael Collier
 
Programming Azure Active Directory (DevLink 2014)
Michael Collier
 
Automating Your Azure Environment
Michael Collier
 
What's New for the Windows Azure Developer? Lots! (July 2013)
Michael Collier
 

What's hot (15)

PPTX
Using Windows Azure for Solving Identity Management Challenges
Michael Collier
 
PDF
Using Windows Azure for Solving Identity Management Challenges (Visual Studio...
Michael Collier
 
PPTX
Windows Azure: Lessons From the Field
Michael Collier
 
PDF
Infrastructure as Code for Beginners
David Völkel
 
PPTX
10 Ways to Gaurantee Your Azure Project will Fail
Michael Collier
 
PPTX
Inside Azure Resource Manager
Michael Collier
 
PDF
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
Amazon Web Services Korea
 
PPTX
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
MSDEVMTL
 
PDF
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
MUG-Lyon Microsoft User Group
 
PDF
Tips and Tricks For Faster Asp.NET and MVC Applications
Sarvesh Kushwaha
 
PPTX
WebLogic authentication debugging
Maarten Smeets
 
PPTX
Create HDInsight Cluster in Azure Portal (February 2015)
Cindy Gross
 
PPT
Make Web, Not War - Installfest: Extend Your Web Server, Rodney Buike
Make Web Not War
 
PPTX
Iac d.damyanov 4.pptx
Dimitar Damyanov
 
PDF
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
Using Windows Azure for Solving Identity Management Challenges
Michael Collier
 
Using Windows Azure for Solving Identity Management Challenges (Visual Studio...
Michael Collier
 
Windows Azure: Lessons From the Field
Michael Collier
 
Infrastructure as Code for Beginners
David Völkel
 
10 Ways to Gaurantee Your Azure Project will Fail
Michael Collier
 
Inside Azure Resource Manager
Michael Collier
 
ECS & ECR Deep Dive - 김기완 솔루션즈 아키텍트 :: AWS Container Day
Amazon Web Services Korea
 
Stephane Lapointe, Frank Boucher & Alexandre Brisebois: Les micro-services et...
MSDEVMTL
 
Global Windows Azure Bootcamp : Cedric Derue playing with php on azure. (spon...
MUG-Lyon Microsoft User Group
 
Tips and Tricks For Faster Asp.NET and MVC Applications
Sarvesh Kushwaha
 
WebLogic authentication debugging
Maarten Smeets
 
Create HDInsight Cluster in Azure Portal (February 2015)
Cindy Gross
 
Make Web, Not War - Installfest: Extend Your Web Server, Rodney Buike
Make Web Not War
 
Iac d.damyanov 4.pptx
Dimitar Damyanov
 
AWS와 Docker Swarm을 이용한 쉽고 빠른 컨테이너 오케스트레이션 - AWS Summit Seoul 2017
Amazon Web Services Korea
 
Ad

Viewers also liked (11)

PPTX
Era of APIs: Why do we need an API strategy?
Bala Iyer
 
PPTX
Real-time analysis using an in-memory data grid - Cloud Expo 2013
ScaleOut Software
 
PDF
Back your App with MySQL & Redis, the Cloud Foundry Way- Kenny Bastani, Pivotal
Redis Labs
 
PPTX
REDIS caching explained
Dan Rinzel
 
PPTX
Caching solutions with Redis
George Platon
 
PDF
Scaling Your Cache And Caching At Scale
Alex Miller
 
PPTX
Redis Use Patterns (DevconTLV June 2014)
Itamar Haber
 
PDF
Real World Use Cases and Success Stories for In-Memory Data Grids (TIBCO Acti...
Kai Wähner
 
PDF
Impact Mapping LEGO Game - Agile Business Day 2016
Fabio Armani
 
PDF
Highly scalable caching service on cloud - Redis
Krishna-Kumar
 
PDF
BPF: Tracing and more
Brendan Gregg
 
Era of APIs: Why do we need an API strategy?
Bala Iyer
 
Real-time analysis using an in-memory data grid - Cloud Expo 2013
ScaleOut Software
 
Back your App with MySQL & Redis, the Cloud Foundry Way- Kenny Bastani, Pivotal
Redis Labs
 
REDIS caching explained
Dan Rinzel
 
Caching solutions with Redis
George Platon
 
Scaling Your Cache And Caching At Scale
Alex Miller
 
Redis Use Patterns (DevconTLV June 2014)
Itamar Haber
 
Real World Use Cases and Success Stories for In-Memory Data Grids (TIBCO Acti...
Kai Wähner
 
Impact Mapping LEGO Game - Agile Business Day 2016
Fabio Armani
 
Highly scalable caching service on cloud - Redis
Krishna-Kumar
 
BPF: Tracing and more
Brendan Gregg
 
Ad

Similar to More Cache for Less Cash (DevLink 2014) (20)

PPTX
IaaS azure_vs_amazon
Udaiappa Ramachandran
 
PPTX
AppFabric Velocity
Dennis van der Stelt
 
PPTX
What's New for the Windows Azure Developer? Lots!!
Michael Collier
 
PPTX
Cloud computing 3702
Jess Coburn
 
PPTX
Road to cloud-iaas
Hatem Al Sum
 
PPTX
Windows Azure Caching
Pavel Revenkov
 
PDF
Building scalbale cloud native apps with .NET 8
GillesMathieu10
 
PDF
Azure appfabric caching intro and tips
Sachin Sancheti - Microsoft Azure Architect
 
PPTX
Nuts and bolts of running a popular site in the aws cloud
David Veksler
 
PPTX
Kudu voodoo slideshare
Aidan Casey
 
PPTX
SharePoint 2013 Performance Analysis - Robi Vončina
SPC Adriatics
 
PPTX
Architectures, Frameworks and Infrastructure
harendra_pathak
 
PDF
Azure Databricks – Customer Experiences and Lessons Denzil Ribeiro Madhu Ganta
Databricks
 
PDF
TechBeats #2
applausepoland
 
PDF
DrupalSouth 2015 - Performance: Not an Afterthought
Nick Santamaria
 
PPTX
Building a Just-in-Time Application Stack for Analysts
Avere Systems
 
PDF
Moving to the cloud; PaaS, IaaS or Managed Instance
Thomas Sykes
 
PDF
VMworld 2013: Maximize Database Performance in Your Software-Defined Data Center
VMworld
 
PPTX
WindowsAzureSDK1.7
Saravanan G
 
PDF
Azure-Backup-Presentation-Chico-7-22-2019-1.pdf
bhavyanm2
 
IaaS azure_vs_amazon
Udaiappa Ramachandran
 
AppFabric Velocity
Dennis van der Stelt
 
What's New for the Windows Azure Developer? Lots!!
Michael Collier
 
Cloud computing 3702
Jess Coburn
 
Road to cloud-iaas
Hatem Al Sum
 
Windows Azure Caching
Pavel Revenkov
 
Building scalbale cloud native apps with .NET 8
GillesMathieu10
 
Azure appfabric caching intro and tips
Sachin Sancheti - Microsoft Azure Architect
 
Nuts and bolts of running a popular site in the aws cloud
David Veksler
 
Kudu voodoo slideshare
Aidan Casey
 
SharePoint 2013 Performance Analysis - Robi Vončina
SPC Adriatics
 
Architectures, Frameworks and Infrastructure
harendra_pathak
 
Azure Databricks – Customer Experiences and Lessons Denzil Ribeiro Madhu Ganta
Databricks
 
TechBeats #2
applausepoland
 
DrupalSouth 2015 - Performance: Not an Afterthought
Nick Santamaria
 
Building a Just-in-Time Application Stack for Analysts
Avere Systems
 
Moving to the cloud; PaaS, IaaS or Managed Instance
Thomas Sykes
 
VMworld 2013: Maximize Database Performance in Your Software-Defined Data Center
VMworld
 
WindowsAzureSDK1.7
Saravanan G
 
Azure-Backup-Presentation-Chico-7-22-2019-1.pdf
bhavyanm2
 

Recently uploaded (20)

PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PDF
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Responsible AI and AI Ethics - By Sylvester Ebhonu
Sylvester Ebhonu
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
How-Cloud-Computing-Impacts-Businesses-in-2025-and-Beyond.pdf
Artjoker Software Development Company
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Security features in Dell, HP, and Lenovo PC systems: A research-based compar...
Principled Technologies
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Advances in Ultra High Voltage (UHV) Transmission and Distribution Systems.pdf
Nabajyoti Banik
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
Get More from Fiori Automation - What’s New, What Works, and What’s Next.pdf
Precisely
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 

More Cache for Less Cash (DevLink 2014)

  • 1. More Cache for Less Cash Michael S. Collier @MichaelCollier DevLink 2014 – August 27, 2014
  • 2. Today’s Agenda • Why Cache? • Cache Options in Azure • Demos • Monitoring and Scaling • Pricing and Features 3
  • 3. Why Cache? 4 Azure Load Balancer Web Tier Business Tier Data Tier
  • 4. Why Cache? 5 Azure Load Balancer Web Tier Business Tier Cache Cache Tier Data Tier
  • 5. What is Azure Cache Service? A distributed, in-memory, flexible cache for all data types that can be used to speed up Azure applications and reduce database load. Basically, cache helps your app 6 become faster. Windows Azure Cache
  • 6. A Cache Story Shared Cache • Cloud Services • Shared – quotas • Lacked feature parity • Multiple size options • Expensive • Performance challenged • Throttling • Deprecated August 2014 In-Role Cache • Cloud Services • Co-located (free) • Dedicated ($$) • Feature parity • Good performance • Not multi-tenant Cache Service • Cloud Services, Web Sites, or VMs • Feature parity • Managed infrastructure • Price/capacity tiers • Good performance (1ms read) 7
  • 7. A Cache Story Shared Cache • Cloud Services • Shared – quotas • Lacked feature parity • Multiple size options • Expensive • Performance challenged • Throttling • Deprecated August 2014 In-Role Cache • Cloud Services • Co-located (free) • Dedicated ($$) • Feature parity • Good performance • Not multi-tenant Cache Service • Cloud Services, Web Sites, or VMs • Feature parity • Managed infrastructure • Price/capacity tiers • Good performance (1ms read) 8
  • 8. A Cache Story Shared Cache • Cloud Services • Shared – quotas • Lacked feature parity • Multiple size options • Expensive • Performance challenged • Throttling • Deprecated August 2014 In-Role Cache • Cloud Services • Co-located (free) • Dedicated ($$) • Feature parity • Good performance • Not multi-tenant Cache Service • Cloud Services, Web Sites, or VMs • Feature parity • Managed infrastructure • Price/capacity tiers • Good performance (1ms read) 9
  • 9. A Cache Story Shared Cache • Cloud Services • Shared – quotas • Lacked feature parity • Multiple size options • Expensive • Performance challenged • Throttling • Deprecated August 2014 In-Role Cache • Cloud Services • Co-located (free) • Dedicated ($$) • Feature parity • Good performance • Not multi-tenant Cache Service • Cloud Services, Web Sites, or VMs • Feature parity • Managed infrastructure • Price/capacity tiers • Good performance (1ms read) Redis Cache • TBD • TBD • TBD • TBD http://aka.ms/MigrateFromSharedCaching 10
  • 10. In-Role Cache (Co-located) 11 Source: Windows Azure Training Kit
  • 11. In-Role Cache (Dedicated) 12 Source: Windows Azure Training Kit
  • 12. In-Role Cache (Dedicated) 13 Source: Windows Azure Training Kit
  • 13. In-Role Cache • Based on the AppFabric Cache engine • Released w/ Oct. 2012 release of Azure SDK 1.8 • Cache part of your Cloud Service application • No quotas or throttling • Isolation, flexibility, and control • High performance • Features: named cache, regions, tagging, HA, local, notifications • Pro: You manage as part of your application • Con: You manage it; only available to Cloud Service roles in same deployment 14
  • 14. Create and Configure In-Role Cache Configure a Role in the Cloud Service to host the cache 15
  • 15. Configure the Cache Clients • Use NuGet to configure the cache clients • Microsoft.WindowsAzure.Caching • Settings placed in web.config or app.config • Modify to point to the cache server role <dataCacheClients> <dataCacheClient name="default"> 16 <!--To use the in-role flavor of Windows Azure Cache, set identifier to be the cache cluster role name --> <!--To use the Windows Azure Cache Service, set identifier to be the endpoint of the cache cluster --> <autoDiscover isEnabled="true" identifier="MyScores.Web" /> <!--<localCache isEnabled="true" sync="TimeoutBased" objectCount="100000" ttlValue="300" />--> </dataCacheClient> </dataCacheClients> Role Name
  • 17. Recap 1. Select “Enable Caching” in Azure role configuration 2. Install NuGet package (Microsoft.WindowsAzure.Caching) 3. Set role name in web.config 4. Get/Set data 18
  • 18. Monitoring the Cache Diagnostic Level Data Collected 0 Critical/catastrophic server logs only 1 Data to help in assessing usage patterns, cache health, and potential errors. Default. 2 Fine grain data for all requests and important system information 3 Diagnostic data with more verboseness and system information 4 Highest verbosity logs for all requests and system information Provides a single setting for cache servers and clients Configures levels for logs, traces, performance counters & crash dumps Full details at http://aka.ms/CacheDiagnostics 19
  • 19. Monitoring the Cache • Set cache diagnostic level in configuration or portal • Level (1-4) controls verbosity, perf counters, & crash dumps. • Start at 1 and increase as needed <Role name="WorkerRole1"> 20 <Instances count="1" /> <ConfigurationSettings> <!– Cache Server --> <Setting name="Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel“ value="1" /> <!– Cache Client--> <Setting name="Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel" value="1" /> </ConfigurationSettings> </Role> Full details at http://mcollier.net/AzureCacheDiag
  • 20. Monitoring the Cache public class WebRole : RoleEntryPoint { public override bool OnStart() { 21 // Enable cache diagnostics DiagnosticMonitorConfiguration dmConfig = DiagnosticMonitor.GetDefaultInitialConfiguration(); // Configure collection of cache diagnostic data. CacheDiagnostics.ConfigureDiagnostics(dmConfig); DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", dmConfig); return base.OnStart(); } }
  • 21. Considerations • Unable to create DataCache in RoleEntryPoint • Max object size is 8MB post serialized • Default serializer is NetDataContractSerializer • Cost only for role instances • Only accessible from within same Cloud Service • Deployment will impact the cache (instances recycle) 22
  • 22. What’s the Azure Managed Cache Service? 23 App1 VM VM App2 Shared Azure Website Stamp VM IaaS VMs Cloud Services Azure Managed Cache Service 1. SLA backed 2. Microsoft Managed 3. Scalable & Resilient
  • 23. Create and Configure the Cache Service • Based on AppFabric Cache engine • Create via PowerShell only  • Manage in Azure management portal • Choose an offering • Basic (128MB to 1GB in 128MB units, 1 named cache) • Standard (1GB to 10GB in 1GB units, notifications, and 10 named caches) • Premium (5GB to 150GB in 5GB units, notifications, HA, and 10 named caches) • Locate in same region as client for best perf and cost 24
  • 24. Create and Configure the Cache Service PS C:> New-AzureManagedCache -Name devlinkcache ` 25 -Location "East US" ` -Sku Basic ` -Memory 128MB
  • 26. Recap 1. Create Managed Cache via PowerShell 2. Install NuGet package (Microsoft.WindowsAzure.Caching) 3. Set cache service endpoint & key in web.config 4. Get/Set data 27
  • 28. Scaling the Cache 29 Dynamically scale without loosing any existing data
  • 29. High Availability 30 Client Primary Secondary Read / Write Write Premium only Doubles required memory Increased latency & decreased throughput
  • 30. Pricing Details 31 Basic Standard Premium Price Per Unit (Preview) $25/month (prorated hourly) $100/month (prorated hourly) $400/month (prorated hourly) Cache Size 128 MB 1 GB 5 GB Scale Up to 8 units Up to 10 units Up to 30 units Named Caches 1 10 10 High Availability    Notifications    See http://mcollier.net/AzureCachePricing
  • 31. Benefits of the Azure Managed Cache Service • Use from any app types (VM, Web Site, Mobile Service, Cloud Service) • Each instance deployed within dedicated VMs (fast, predictable performance) • No quotas or throttling • Store up to 150GB per cache instance • Avg. retrieval time of 1ms. Insert in about 1.2ms • Highly available / distributed across multiple servers • Managed service – focus on apps not infrastructure • Same .NET cache API used with in-role cache for Cloud Services • Support for ASP.NET Session State and Page Output Caching • Unique cache service instance for each app, or share across apps 32
  • 32. Azure Redis Cache (Preview) • Secure, dedicated Redis cache • Hosting and monitoring by Microsoft • 250MB – 26GB (Preview) • Tiers • Basic – single node; dev/test and non-critical workloads • Standard – provides master/slave replication 33
  • 33. Azure Redis Cache (Preview) 34
  • 34. Monitoring and Alerts • Set metrics and timeframe to monitor • Pin to dashboard • Alert when threshold reached 35
  • 36. Recap 1. Create Redis Cache via portal 2. Add Redis C# client (e.g. StackExchange.Redis) 3. Obtain Redis endpoint and password from portal 4. Determine formatter for .NET objects 5. Get/Set data 37
  • 37. Common Architecture 38 Web Roles Storage Table 3. Write 1. Read Windows Azure Cache 2. Read
  • 38. Common Architecture 39 Windows Azure Load Balancer Web Roles Worker Roles SQL Database (Azure) Read Azure Cache Read Preload the cache Carefully choose expiration and eviction settings
  • 39. Common Architecture 40 Azure Load Balancer Web Roles Storage Queue Worker Roles Storage Table SQL Database (Azure) Azure Cache Write Read Write Read Write
  • 40. Cloud Service Fundamentals - Caching • Factory implementation • Custom BinarySerializer class • protobuf-net • Fast and small http://mcollier.net/AzureCSF 41
  • 41. What Cache? • Azure Shared Cache – out of service on September 1, 2014 42 New Development Need GA and SLA
  • 42. Where to Cache? 43 Mix cache solutions for price / manageability / features Azure Load Balancer Web Roles Azure Cache Read • Data shared by other services/apps • General application data In-role cache • Session / Page Output Cache • FREE!
  • 43. Summary • In-Role Cache • Cloud Services only • Co-located (free) or Dedicated ($$$) • Isolated cache-related workload • Cache Service • Microsoft managed service, dedicated tenant, SLA backed • Cloud Services, Web Sites, and VMs • Full parity with in-role cache (SDK) • Redis Cache • Microsoft managed Redis Cache • Master/Slave replication in Standard tier • Normal Redis features/functionality 44
  • 44. More Resources • Azure Cache Options Overview • http://msdn.microsoft.com/en-us/library/azure/gg278356.aspx • Which Azure Cache Offering is right for me? • http://msdn.microsoft.com/en-us/library/azure/dn766201.aspx • Cloud Service Fundamentals – Caching Basics • http://azure.microsoft.com/blog/2013/10/03/cloud-service-fundamentals-caching-basics/ • Capacity Planning Spreadsheet (In-Role Cache) • http://msdn.microsoft.com/en-us/library/hh914129 • Lap around Azure Redis Cache • http://azure.microsoft.com/blog/2014/06/04/lap-around-azure-redis-cache-preview/ 45

Editor's Notes

  • #5: SQL DB can often be a limiting factor in WA applications. Can get slow and throttle as pressure increases
  • #8: Similar feature parity with Windows Server AppFabric Cache (on-premises)
  • #9: Similar feature parity with Windows Server AppFabric Cache (on-premises)
  • #10: Similar feature parity with Windows Server AppFabric Cache (on-premises)
  • #11: Similar feature parity with Windows Server AppFabric Cache (on-premises)
  • #15: A region is a subgroup for cached items. Regions also support the annotation of cached items with additional descriptive strings called tags. Regions support the ability to perform search operations on any tagged items in that region.
  • #18: Add In-Role Cache to an existing Cloud Service Show adding package via NuGet Show pre-deployed version in management portal. Show metrics. Install-package Microsoft.WindowsAzure.Caching
  • #20: http://msdn.microsoft.com/en-us/library/windowsazure/hh914135.aspx
  • #21: Server – added by Visual Studio Client – added by NuGet package http://msdn.microsoft.com/en-us/library/windowsazure/jj136940.aspx http://msdn.microsoft.com/en-us/library/windowsazure/hh914135.aspx
  • #23: Unable to create DataCache in RoleEntryPoint “Server collection cannot be empty” WA Cache settings not automatically available in the web.cong in context of RoleEntryPoint Programmatic only http://msdn.microsoft.com/en-us/library/windowsazure/jj852128.aspx
  • #24: Scale Units for Cloud Services
  • #27: Change site to use new cache service In cloud – have one Web Site and one Cloud Service using the same cache
  • #30: Scale cache units w/o losing data. Changing offerings will cause cache data loss.
  • #33: Ability to use the Cache Service from any app type (VM, Web Site, Mobile Service, Cloud Service) Each Cache Service instance is deployed within dedicated VMs that are separated/isolated from other customers – which means you get fast, predictable performance. There are no quotas or throttling behaviors with the Cache Service – you can access your dedicated Cache Service instances as much or as hard as you want. Each Cache Service instance you create can store (as of today’s preview) up to 150GB of in-memory data objects or content. You can dynamically increase or shrink the memory used by a Cache Service instance without having to redeploy your apps. Web Sites, VMs and Cloud Service can retrieve objects from the Cache Service on average in about 1ms end-to-end (including the network round-trip to the cache service and back). Items can be inserted into the cache in about ~1.2ms end-to-end (meaning the Web Site/VM/Cloud Service can persist the object in the remote Cache Service and gets the ACK back in 1.2ms end-to-end). Each Cache Service instance is run as a highly available service that is distributed across multiple servers. This means that your Cache Service will remain up and available even if a server on which it is running crashes or if one of the VM instances needs to be upgraded for patching. The VMs that the cache service instances run within are managed as a service by Windows Azure – which means we handle patching and service lifetime of the instances. This allows you to focus on building great apps without having to worry about managing infrastructure details. The new Cache Service supports the same .NET Cache API that we use today with the in-role cache option that we support with Cloud Services. So code you’ve already written against that is compatible with the new managed Cache Service. The new Cache Service comes with built-in provider support for ASP.NET Session State and ASP.NET Output Page Caching. This enables you to easily scale-out your ASP.NET applications across multiple web servers and still share session state and/or cached page output regardless of which customer hit which server. The new Cache Service supports the ability to either use a separate Cache Service instance for each of your apps, or instead share a single Cache Service instance across multiple apps at once (which enables easy data sharing as well as app partitioning). This can be very useful for scenarios where you want to partition your app up across several deployment units.
  • #39: Basic – cache-aside pattern
  • #40: Pre-load the cache
  • #41: Architecture diagram – read from cache; other process updates cache data Reference - http://blog.cynapta.com/2013/11/building-cynapta-services-part-ii-architecture-drilldown/
  • #42: http://blogs.msdn.com/b/windowsazure/archive/2013/10/03/cloud-service-fundamentals-caching-basics.aspx
  • #43: 1 Medium Cloud Service instance (3.5 GB RAM): $119/month 2 GB Standard cache (2, 1GB units): $100/month 3 A7 dedicated instances (56 GB RAM each): $3,147/month 150GB Premium cache (30, 5GB units): $6,000/month
  • #46: Cache (Preview) Features - http://msdn.microsoft.com/en-us/library/windowsazure/dn386143.aspx
  • #52: 1 Medium Cloud Service instance (3.5 GB RAM): $119/month 2 GB Standard cache (2, 1GB units): $100/month 3 A7 dedicated instances (56 GB RAM each): $3,147/month 150GB Premium cache (30, 5GB units): $6,000/month