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? 
  • Any page that you hit in the browser you get redirected to the throttle error page under layouts named throttle.htm
  • Any requests that you send to SharePoint online through code fails and returns with a HTTP status code 429 which is too many requests.
  • 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 ExecuteQuery.

Traffic Decoration
There are few throttle scenarios which are maintained to ensure high availability. One factor used in prioritisation 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.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Create a website or blog at WordPress.com

Up ↑

%d bloggers like this: