Thursday, February 12, 2015

You have reached the maximum resource usage limit

Our organization's O365 tenancy has a lot of Global Administrators.
Global admins have the ability to set among other things, SharePoint Site Collection Storage Quotas and the often misunderstood Server Resource Quota.

There has been misunderstood thought that by increasing this setting to some really big number, their site collection will have blazingly fast performance and every other site collection will chug along at their slow dial-up rate.

This is not at all true, and in fact you can really mess things up by setting these numbers too high.

Consider this:
A Site Collection is created and then assigned a huge number of resources. Then it is deleted.
This happens a few times and before long, your SharePoint Admin Center displays this ugly error and you are unable to manage resources on any of the collections.

You have reached the maximum resource usage limit. - Well dang!


And... you can't increase or decrease any site collection resource! Sort of a Catch 22, right? So you decide to start deleting site collections thinking this might help!




You would expect those resources to free up since you deleted them, right? But they just don’t and that mean ol' red bar stays red.

The deleted collection is in the Site Collection Recycle bin. Those resources are not reallocated just because you deleted it. They are still awaiting to be purged and those resources need to stay allocated until then.

 So what do you do?

PowerShell to the rescue!
Here is what we had to do to return our site back to normal.

First, query the site owners and ask if they have any sandboxed or custom code on their sites and need those extra resources to debug or step thought their code.
 If they do, understand their burden and pity them. Leave them to their debugging, and focus on the deleted sites and the sites where there is no custom code.

Then fire up a SharePoint Online or Azure PowerShell command prompt and connect to your admin portal,
connect spo-service http://contoso-admin.sharepoint.com 
…notice the -admin, it’s the URL of the admin portal.

Authenticate with a Global Admin account.

Open the admin console and look in the Site Collection recycle bin:

 

Grab the URL of a deleted site.
Then delete it, with extreme prejudice.
Remove-SPODeletedSite -Identity [URL of site in recycle bin]

Do this for each site in the recycle bin.

When that’s done, the ugly error "You have reached the maximum blah blah" and red bar ought to go away!

Nbow you need to attempt to set the resource quota for one of those collections that are set to some large number.
You might try reassigning it in the admin portal, but what fun is that? You still have that console open, so…
Set-SPOSite -Identity https://BigSite/sites/ituneslibrary  -ResourceQuota 300

Now all should be right in the world.

The resource usage quota is a site collection metric calculated by SharePoint Online. The main purpose of resource quotas is to limit the risk that sand-boxed custom code can have on available resources on a site collection, bad code causing excessive CPU use for example.

The actual resource quota used to be determined by the number of user seats in your company's subscription (#seats×200) +300 (may have changed now). 

So for a 10 seat license, the resource quota would be 2300 split across all site collections you own

HopeThisHelps,

John