SharePoint 2013 Apps, Load Testing and Resources throttling

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,000 Milliseconds 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>
[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(

Finally, I hope that this post save you some time while you are doing your load testing for the SP2013 APPs

Posted in SharePoint 2013 | Tagged , , | Leave a comment

Using the Azure instance behind your Office 365 tenant Workaround

lately CHRIS O’BRIEN write a great blog post about how to use your Azure Active Directory instance behind your office 365 tenant and he mentioned that the only work around is to subscribe and from his blog:

Using the Azure instance behind your Office 365 tenant
“Sign up for Windows Azure”
Yes, it’s counter-intuitive. As I mentioned earlier, the Azure instance already exists so why do we need to “sign-up”? Well, you just do – for now at least. I did hear a Microsoft speaker at SPC mention this experience as a side-note, and that they will probably improve things soon. The main thing to understand is that you have to supply payment details before this Azure instance can be accessed – because then it becomes a true pay-as-you-go instance.

but I discovered a workaround for this and its very easy.

1- Go to any of your Azure subscription and choose the directory tab then choose create yes create

2- Then here is the workaround now you need to choose use existing account


3- you will logout then log in with your Office 365 account then your AD will be added to be managed by this Azure instance

I hope that will save you the time you will need to sign up for Azure just to manage your Office 365 AD

Posted in Office 365 | Tagged , | Leave a comment

SharePoint and .NET Advanced Troubleshooting and Debugging Presentation

I want to share with you my new presentation SharePoint and .NET Advanced Troubleshooting and Debugging if you are a SharePoint Admin or developer you will find the tools in the presentation very handy

Posted in SharePoint | Tagged | 1 Comment

How to make SharePoint 2013 Distributed Cache service Semi High Available


The Distributed Cache service provides caching features in SharePoint Server 2013. The Distributed Cache service is built on Windows Server AppFabric, which implements the AppFabric Caching service. Windows Server AppFabric installs with the prerequisites for SharePoint Server 2013. This is how Microsoft defined the Distributed Cache service but what is depend on the Distributed Cache service ?

Table: Different caches that depend on the Distributed Cache service

Name Cache name Description

Login Token Cache


This cache stores the security token issued by a Secure Token Service for use by any web server in the server farm. Any web server that receives a request for resources can access the security token from the cache, authenticate the user, and provide access to the resources requested.

Feed Cache


This cache stores activities and conversations for use by the feeds on a user’s My Site.

Last Modified Time Cache


This cache stores time stamp information for all Feed Cache entities

OneNote Throttling


Access Cache


Search Query Web Part


Security Trimming Cache


App Token Cache


View State Cache


as you can see the Distributed Cache service is very important to your SP2013 farm and without it SP will not functional will.

Dedicated or Collocated Mode

The Distributed Cache service can run in dedicated or collocated mode. When running in dedicated mode, the Distributed Cache service is started and all other services are stopped on the server. In collocated mode, the Distributed Cache service is running along with other services on the server. lately Steve Peschka write a great blog post about that you need to run yours Distributed Cache service on the dedicated mode and informed us that this is a best practice Dedicating Servers to Distributed Cache in SharePoint 2013

Appfabric Cache is High Available but Distributed Cache service is not

Even if the Distributed Cache service is built upon the Appfabric Cache but its not high available which mean that if your server host DCS goes down all your cache will go. This is why you need to run
Stop-SPDistributedCacheServiceInstance –Graceful
with the –Graceful parameter if you want to stop the service in one of the its servers so the cache can be copied to other server hosting the DCS in your farm

Capacity planning for the Distributed Cache service

The following table lists different memory and architecture recommendations for the Distributed Cache service, depending on the total number of users.

Deployment size Small farm Medium farm Large farm

Total number of users

< 10,000

< 100,000

< 500,000

Recommended cache size for the Distributed Cache service

1 GB

2.5 GB

12 GB

Total memory allocation for the Distributed Cache service (double the recommended cache size above)

2 GB

5 GB

24 GB

Recommended architectural configuration

Dedicated server or co-located on a front-end server

Dedicated server

Dedicated server

Minimum cache hosts per farm




So How to make it Semi High Available

even if the above table mentioned that the minimum cache hosts per farm is 1 server my recommendation is that you need at least 2 servers runs only the DCS ( in Dedicated Mode) so if one if it goes down your farm can still be working with the other server.

finally the below diagram show how the office division implement their SP2013 farm


as you can see they use 2 servers with 14 GB RAM each.

Posted in SharePoint 2013 | Tagged , | 5 Comments

SharePoint 2010 with Service Pack 2 ISO and Server 2012 Support

SharePoint 2010 with Service Pack 2 ISO now available on MSND


And now you can run the installer over Windows Server 2012


Posted in SharePoint 2010 | Tagged , | Leave a comment

My SPChat at about SharePoint 2010/2013 on Azure Infrastructure Services

If you have any question related to:

- How you can use Azure Infrastructure Services (IaaS) to host your SharePoint 2010/2013 farm?
– How you can implement High-availability and what’s the best practice?

Please join my SPChat at August 23, 2013 from 5pm to 6pm GMT (7PM to 8PM Egypt,Cairo Time).

here is the SPChat link:

Posted in Azure Infrastructure Services | Tagged , , | Leave a comment

Completely Offline Installation of SharePoint 2013


Sometimes when we need to install SharePoint we fail due to that there is no internet connection or our servers behind a firewall and we can’t access internet. So in this blog we will see how we can do a complete SharePoint 2013 (and you can do the same with 2010) installation.

But firstly why SharePoint installation need internet ?!. It needs internet for the below items :

1- SharePoint prerequisites prerequisiteinstaller.exe

2- The missing Windows patches

3- Workflow manager

4- And if this is a Dev. environment you will also need internet for VS SharePoint tools

Download my offline packages as need in your environment




SP2013Prerequisite package

I made this with the help of this great TechNet gallery project by (Craig Lussier)

So what’s in this package?


- MissingWindowsPatches : The missing windows patches for Server 2012 and 2008 R2

- SP2013PreReqFiles: The required offline files for prerequisiteinstaller.exe and .Netframework 4.0 and Windows6.1-KB2506143-x64 (PowerShell 3) you will only need the last two at Server 2008 R2 as its installed by default on Server 2012 and you will need to install it manually on Server 2008 R2 and after that complete the steps below


Okay, as we will need to run a PowerShell file you will need to set the execution policy for your PowerShell environment.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned


you also will need to use the below PowerShell script to configure your IIS manually at Windows Server 2012. Why? during the configuration the prerequisiteinstaller.exe need to download some component from framework 3.5 so this manual step overcome this

Import-Module ServerManager

Add-WindowsFeature NET-WCF-HTTP-Activation45,NET-WCF-TCP-Activation45,NET-WCF-Pipe-Activation45 -Source D:\<Your server 2012 installation path>\Sources\sxs

Add-WindowsFeature Net-Framework-Features,Web-Server,Web-WebServer,Web-Common-Http,Web-Static-Content,Web-Default-Doc,Web-Dir-Browsing,Web-Http-Errors,Web-App-Dev,Web-Asp-Net,Web-Net-Ext,Web-ISAPI-Ext,Web-ISAPI-Filter,Web-Health,Web-Http-Logging,Web-Log-Libraries,Web-Request-Monitor,Web-Http-Tracing,Web-Security,Web-Basic-Auth,Web-Windows-Auth,Web-Filtering,Web-Digest-Auth,Web-Performance,Web-Stat-Compression,Web-Dyn-Compression,Web-Mgmt-Tools,Web-Mgmt-Console,Web-Mgmt-Compat,Web-Metabase,Application-Server,AS-Web-Support,AS-TCP-Port-Sharing,AS-WAS-Support, AS-HTTP-Activation,AS-TCP-Activation,AS-Named-Pipes,AS-Net-Framework,WAS,WAS-Process-Model,WAS-NET-Environment,WAS-Config-APIs,Web-Lgcy-Scripting,Windows-Identity-Foundation,Server-Media-Foundation,Xps-Viewer -Source D:\<Your server 2012 installation path>\Sources\sxs

and this all documented here:

After that you will need to run the Install-SP2013PreReqFiles.ps1 at the package path



Then install the missing Windows Server Patch for Server 2012 or 2008 R2


At this stage you are ready to install SP2013.


You will need this if you will install workflow in SP2013


This is the offline installation package of Web platform installer for SP WorkflowManager you just need to open an elevated command prompt and navigate to the bin folder and run the Install.bat file


After that you can configure the WorkFlow Manager


If you are installing workflow in a Multi-server farm and you need to host the workflow in its server you will need to install the workflow client on all the SP server, to get the client msi file navigate to:



At the end you need to install the latest WF patches

ServiceBus-KB2799752-x64-EN.exe then install WorkflowManager-KB2799754-x64-EN.exe



If your machine is a Dev. machine your will need the SharePoint VS tools. So after installing VS2012 and the latest Update 3 we will do exactly as we did with workflow


we will open an elevated command prompt and navigate to the bin folder and run the Install.bat file



As you can see if you follow the above steps you can install SP2013 completely with Workflow and Visual studio tools for SharePoint 2013 without internet connection.

Posted in SharePoint 2013 | Tagged , | 4 Comments