Written by

Chanakya Jayabalan

Share

  

Category

see all categories
intranet as a service

What is traffic decoration and how you can use it to best avoid throttling in SharePoint online

SharePoint online uses throttling at different levels to ensure reliability & meet performance requirements the SharePoint online service. Throttling is a means by which any over use of resources is disallowed by SharePoint whenever a script or code gets executes. As the infrastructure for the Office365 is maintained by Microsoft this becomes inevitable to ensure the availability of the platform. This throttling is done at a user level & these limits are not defined.

What really happens when you get throttled? 

1. Any page that you hit in the browser you get redirected to the throttle error page under layouts named throttle.html

2. Any requests that you send to SharePoint online through code fails and returns with a HTTP status code 429 which is too many requests.
3. If the user continues doing the operations further then the system will end up blocking the process completely with a 503 service unavailable error.

There are multiple ways including reducing the number of requests in your code, reduce the number of frequent calls & using incremental back off technique where you basically use ExecuteQueryWithIncrementalRetry instead of Execute Query.
Leaderboard_CDR

Traffic Decoration

There are few throttle scenarios which are maintained to ensure high availability. One factor used in prioritization of the traffic is traffic decoration. Well decorated traffic is always given higher priority than the one which is not.

How do you decorate your traffic

To decorate your traffic, you pass a user agent string along with your request to SharePoint Online be it CSOM or REST API. The user agent is built using a defined format that includes ISV or NONISV flag, the company name & the app if or app title. Below are the format of the two options of user agents
 
1. ISV Application  – ISV|CompanyName|AppName/Version
2. Enterprise Application  – NONISV|CompanyName|AppName/Version

If you are calling any SharePoint APIs, do pass the user agent as part of your request. If you are building javascript libraries to be used in your application, then have your httprequests include the user agent string. And wherever possible, you need to register your application and use the app id/title in your user strings.
 
While including such user strings SharePoint online can understand the requests are from various apps and prioritise these requests for you.
Chanakya Jayabalan

Written by Chanakya Jayabalan

Chanakya holds an MS from BITS, Pilani has over a decade of experience in Microsoft digital platforms both on-premises & on cloud, helping customers in the journey to make their digital transformation possible. His work involves architecting enterprise scale digital platforms & integrations by making right technology choices & solutions.