Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Can anyone please describe me what is the role of CriticalExceptionCount measure in SharePoint 2010?

Couldn't understand the below line:

ResourcesPerPoint - Represents a normalization factor for this resource measure. 0 will disable.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

CriticalExceptionCount is one of the resource usage limits defined for sandbox solution on SharePoint 2010 - it works by monitoring the following list of exception a solution may trigger:

  • ThreadAbortException
  • OutOfMemoryException
  • AccessViolationException
  • AppDomainUnloadedException
  • BadImageFormatException
  • TypeInitializationException
  • MissingMethodException
  • ExecutionEngineException

The resource per point property is related to the Per Day/Per Site Collection usage limit. Basically, you can define an usage limit (expressed in resource point - default 300) for a specific site collection: when the usage exceeds its maximum allowed points all sandboxed solutions in the site collection are terminated, and no more can run for the remainder of the day. In this contest "The Resources Per Point (column) specifies how much of the resource, by default, causes an additional point to be added toward the Per Day/Per Site Collection total." (taken from MSDN). In your example the critical exception count usage limit is defined with a default Resource Per Point setting of 3. This means that after 3 critical exception the daily usage will be increased.

There is also a second parameter called "Absolute Limit". This defines how many resource usage should trigger an immediate termination of the process, no matter what the daily limit may by.

For further detail, see this links: msdn, John blog article.

share|improve this answer
    
Thanks but not sure which code you are referring!! "In your example the critical exception count usage limit is defined with a default Resource Per Point setting of 3." Where did I set 3?? –  NICK Jun 11 '12 at 12:16
    
SPUserCodeService userCode = SPUserCodeService.Local; SPResourceMeasureCollection measures = userCode.ResourceMeasures; SPResourceMeasure measure = measures("CriticalExceptionCount"); MISSING_CODE measure.Update(); –  NICK Jun 11 '12 at 12:17
    
Nick, I was referencing the default value for the Resource Per Point setting of the CriticalExceptionCount resource. Out of the box, if no user action is performed, SharePoint sets this parameter to 3. As said, this means that it will take three critical exceptions to increase the daily usage by one. –  SPArchaeologist Jun 11 '12 at 12:34
    
Ok, got it now...!! –  NICK Jun 11 '12 at 12:44

When using Sandboxed solutions in SharePoint 2010 the code runs in a separate process to isolate the "normal" environment from the sandboxed code.

Each site collection is allocated a number of points it can use for sandboxed code each day. The moment the site collection has consumed more that that number of point during a day all sandboxed code execution for that site collection is disabled until next day.

So what is a point?
A point is taxed for use of certain resources. One of these resources is Critical Exceptions others are CPU, IO,... see Resource Usage Limits on Sandboxed Solutions in SharePoint 2010 for full list. As you can't just add CPU time, IO operations, Exception count..., SharePoint has introduced a way to convert each of these into points.

For CriticalExceptionCount there is set to numbers:

  • Resources Per Point = 10 (by default) means that each exception costs 1/10 point.
  • Absolute Limit = 3 (by default) means that if a worker process encounters 3 of these exceptions then it'll be restarted (as it could be a local problem) the restart costing 1 point.

The exceptions that count as Critical in this context are:

  • ThreadAbortException
  • OutOfMemoryException
  • AccessViolationException
  • AppDomainUnloadedException
  • BadImageFormatException
  • TypeInitializationException
  • MissingMethodException
  • ExecutionEngineException
share|improve this answer
    
Wow!! Thanks, it's pretty much awesome explanation!! I'm still little bit confused between Reources Per Point and Absolute Limit. –  NICK Jun 11 '12 at 11:51
    
For example, I need to disable the CriticalExceptionCount measure for all user solutions. I will write: SPUserCodeService userCode = SPUserCodeService.Local; SPResourceMeasureCollection measures = userCode.ResourceMeasures; SPResourceMeasure measure = measures("CriticalExceptionCount"); MISSING_CODE measure.Update(); –  NICK Jun 11 '12 at 11:52
    
Instead of MISSING_CODE, I have below options: A. measure.AbsoluteLimit = 0; B. measure.AbsoluteLimit = 1; C. measure.ResourcesPerPoint = 0; D. measure.ResourcesPerPoint = 1; Where C is the right answer!! How?? –  NICK Jun 11 '12 at 11:53
    
That just how SharePoint specifies that a certain measure is disabled by specifying that an amount of 0 cost 1 point. –  Per Jakobsen Jun 11 '12 at 12:20
    
Yes, that's the point. The phrase "Represents a normalization factor for this resource measure. 0 will disable." is a little on the criptic side, but the meanining is just that: every N usages of the resource add a resource point to the daily count. If N is set to 0, disable the resource (note: afaik the Absolute Limit will still apply!) –  SPArchaeologist Jun 11 '12 at 12:27

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.