Windows Azure Throttling
Windows Azure Throttling 
TalentSoft 
Julien PLEE 
Responsable R&D 
TalentSoft 
jplee@talentsoft.com, @julplee
AZURE THROTTLING 
What is throttling? 
#talentsoft TalentSoft
Windows Azure Sql Database Case 
• Multi-Tenant 
• Resource Management 
– Resource Governance 
– Resource Limits 
– Engine Throttling 
• Affects multiples services 
• Sql Database Network 
Topology 
#talentsoft TalentSoft
Windows Azure Sql Database 
Une seule base 
de données 
logique 
#talentsoft TalentSoft 
Plusieurs réplicas 
physiques 
Primaire 
unique 
Plusieurs cibles 
secondaires 
Réplica 3 Réplica 2 Réplica 1
Soft Throttling 
• Throttles the activities of a 
subset of Sql Databases that 
consume most resources 
Hard Throttling 
• Final Stage. 
• No more connections are 
#talentsoft TalentSoft 
allowed until resources are 
freed up 
Engine Throttling 
40501: The service is currently busy. Retry the request after 10 seconds. 
Incident ID: <ID>. Code: <code>.
Resource Governance 
• Worker Threads and Sessions limits 
• Depends on Web/Business/Premium mode 
• Error code differs from Engine Throttling 
(10928) 
#talentsoft TalentSoft
Resource Limits 
• Database Size 
• Transaction Duration 
• Transaction Lock Count 
• tempdb 
• Transaction Log Length 
• Memory Usage 
#talentsoft TalentSoft
AZURE THROTTLING 
#talentsoft TalentSoft
AZURE THROTTLING 
How to solve problems? 
#talentsoft TalentSoft
Azure Throttling & Transient Fault Handling 
Solutions 
• Entity Framework 6 
• Enterprise Library 5.0 Integration Pack for 
Windows Azure 
• More money: Sql Database Premium 
#talentsoft TalentSoft
Sql Database Premium 
Reservation 
Size 
CPU Cores 
Worker 
Threads 
Active 
Sessions 
#talentsoft TalentSoft 
Disk IO 
(IOPS) 
Memory 
(GB) 
P1 1 200 2000 150 8 
P2 2 400 4000 300 16
AZURE THROTTLING 
Manage throttling 
#talentsoft TalentSoft
Hello Talent Case: TransactionInterceptor.cs 
public void Intercept(IInvocation invocation) 
{ 
... 
if (Transaction.Current == null) 
{ 
RetryPolicy policy = new RetryPolicy<SqlDatabaseTransientErrorDetectionStrategy>(...); 
var transactionOptions = ... 
policy.ExecuteAction( 
() => 
{ 
using (var transactionScope = new TransactionScope(...)) 
{ 
invocation.Proceed(); 
transactionScope.Complete(); 
} 
}); 
} 
} 
#talentsoft TalentSoft
Microsoft Azure Throttling

Microsoft Azure Throttling

  • 1.
  • 2.
    Windows Azure Throttling TalentSoft Julien PLEE Responsable R&D TalentSoft jplee@talentsoft.com, @julplee
  • 3.
    AZURE THROTTLING Whatis throttling? #talentsoft TalentSoft
  • 4.
    Windows Azure SqlDatabase Case • Multi-Tenant • Resource Management – Resource Governance – Resource Limits – Engine Throttling • Affects multiples services • Sql Database Network Topology #talentsoft TalentSoft
  • 5.
    Windows Azure SqlDatabase Une seule base de données logique #talentsoft TalentSoft Plusieurs réplicas physiques Primaire unique Plusieurs cibles secondaires Réplica 3 Réplica 2 Réplica 1
  • 6.
    Soft Throttling •Throttles the activities of a subset of Sql Databases that consume most resources Hard Throttling • Final Stage. • No more connections are #talentsoft TalentSoft allowed until resources are freed up Engine Throttling 40501: The service is currently busy. Retry the request after 10 seconds. Incident ID: <ID>. Code: <code>.
  • 7.
    Resource Governance •Worker Threads and Sessions limits • Depends on Web/Business/Premium mode • Error code differs from Engine Throttling (10928) #talentsoft TalentSoft
  • 8.
    Resource Limits •Database Size • Transaction Duration • Transaction Lock Count • tempdb • Transaction Log Length • Memory Usage #talentsoft TalentSoft
  • 9.
  • 10.
    AZURE THROTTLING Howto solve problems? #talentsoft TalentSoft
  • 11.
    Azure Throttling &Transient Fault Handling Solutions • Entity Framework 6 • Enterprise Library 5.0 Integration Pack for Windows Azure • More money: Sql Database Premium #talentsoft TalentSoft
  • 12.
    Sql Database Premium Reservation Size CPU Cores Worker Threads Active Sessions #talentsoft TalentSoft Disk IO (IOPS) Memory (GB) P1 1 200 2000 150 8 P2 2 400 4000 300 16
  • 13.
    AZURE THROTTLING Managethrottling #talentsoft TalentSoft
  • 14.
    Hello Talent Case:TransactionInterceptor.cs public void Intercept(IInvocation invocation) { ... if (Transaction.Current == null) { RetryPolicy policy = new RetryPolicy<SqlDatabaseTransientErrorDetectionStrategy>(...); var transactionOptions = ... policy.ExecuteAction( () => { using (var transactionScope = new TransactionScope(...)) { invocation.Proceed(); transactionScope.Complete(); } }); } } #talentsoft TalentSoft