If you are building a SharePoint 2013 Apps you will need at some point in your development lifecycle to do load testing for your app to see how it will behave under big user load especially if you are building LOB application that you expect to have a big load.
This is great but the problem with that is you may receive the below error at your testing tool at high user load:
HTTP/1.1 429 Too Many Requests
You may say okay it’s the http throttling then you go to the central administration site close it and retest then you get the same error again.
But if you dig more in the uls you will find the below error:
ResourceBudgetExceeded, sending throttled status code. Exception=Microsoft.SharePoint.SPResourceBudgetExceededException: ResourceBudgetExceeded at Microsoft.SharePoint.SPResourceTally.Check(Int32 value) at Microsoft.SharePoint.SPAggregateResourceTally.Check(SPResourceKind kind, Int32 value) at Microsoft.SharePoint.Client.SPClientServiceHost.OnBeginRequest()
Okay what is this?! this is another validation and throttling the SharePoint team added specially to the SP APPs and in the current situation it checks the time for the request that the app makes to the client.svc service (CSOM Calls) and if its bigger than 150,000Milliseconds your app CSOM request will be blocked and throttled.
So what can you do now?!:
1- You can review your app code and try to optimize it to bypass this throttling.
2- You can say okay I know that my performance lab has small resources and at production I will be in a good servers which will work faster and I just need to increase this 150 MS limit, okay no problem just use the below PowerShell:
$webapp = Get-SPWebApplication -Identity http://<URL of your on-premises farm> $webapp.AppResourceTrackingSettings.Rules.Add( [Microsoft.SharePoint.SPResourceKind]::ClientServiceRequestDuration, 300000, 300000)
3- What if you need to just disable it? this is also very easy:
$webapp = Get-SPWebApplication -Identity http://<URL of your on-premises farm> $rule = $webapp.AppResourceTrackingSettings.Rules.Get( [Microsoft.SharePoint.SPResourceKind]::ClientServiceRequestDuration) $rule.Remove()
Finally, I hope that this post save you some time while you are doing your load testing for the SP2013 APPs
Original Post: https://mahmoudhamed.wordpress.com/2014/05/06/sharepoint-2013-apps-load-testing-and-resources-throttling/