IT:AD:Performance Counters:HowTo:Understand them
Summary
For such a seamingly small problem area, it's surprisingly a tough subject to grok.
Notes
Core concepts: * We are after readings, not values per say. * A reading can be:
- the reading of a single performance counter's raw value.- This is the simplest case.
- Note that in practice, use of the raw value directly is very rare. Instead the performance counter's computed value is used (see below), knowing that in these cases, it's the same value (the computed value is the raw value passed through a null Function).
 
- the reading of a single performance counter's computed value- this is the performance counter's raw value, passed through the Performance Counter type's Function.
 
- the using a pair of performance counters (Nominator + Denominator/Base) in order to get a reading of a Denominator performance counter's computed value- in this case the computed result is the performance counter's raw value, taken along with the Base performance counter's computed value, and passing both through the nominator performance counter's function.
 
* There are different types of readings:
- Instance,
- Average,
- Percentage,
- Rate,
- Difference
* Each type of reading can be developed either using
- a single Performance Counter, or
- a Pair of Performance Counters (a Nominator + a Base Denominator counter).
Instantaneous Readings:
Single Counter Instance Readings are probably the easiest to create (no Base required) – but are often not values that a Monitoring Service would require to alert SysAdmins to abnormal behavior (% threshold values are more often requested).
* Single Counter Instance Counters:
- set a single counter's value to this instant's absolute value.
- Configurations:- NumberOfItems32:- Purpose: record a absolute value at a particular instant (ie, a value, now).
- Formula: N/A
- Use cases examples:- “Number of SearchsById”
- “Number of SearcheByMatch”
- “Number of Creates”
- “Number of Retrieves”
- “Number of Updates”
- “Number of Deletes”
 
 
- NumberOfItems64- Purpose: record a absolute value at a particular instant (ie, a value, now).
- Formula: N/A
- Use cases examples:- “Memory size in bytes”- tip: interesting, but Monitoring would probably prefer a % of Memory Size Used/Available.
 
- “HardDrive size Available”- Rational: you don't want to run out of hard-drive due to misconfigured log files.
- This can be useful… 
 
- “Logfile size”- Rational: you want to know if you have any misconfigured log file rotation.
- This can be useful… 
 
 
 
 
* Nominator + Denominator/Base Counter Configurations:
- Configurations:- TODO
 
Average Readings:
- Single Counter Instance Counters:- Configurations:- N/A
 
 
- Nominator + Denominator/Base Counter Configurations:- Configurations:- AverageCount64+- AverageBase:- Purpose: Returns the average number of child operations during an larger operation.- Formula:N 1 -N 0)/(B 1 -B 0)- N = the numbers of operations1 during the sample interval, D = the number of operations2 during the sample interval.
 
- Use cases examples:- “Average Number of Db Reads / Create” * *“Average Number of Db Reads / SearchById” * *“Average Number of Db Reads / SearchByMatch” * *“Average Number of Db Reads / Update” * *“Average Number of Db Reads / Delete” * *“Average Response Bytes / Create”
- “Average Response Bytes / SearchById”
- “Average Response Bytes / SearchByMatch”
- “Average Response Bytes / Update”
- “Average Response Bytes / Delete”
 
- AverageTimer32+- AverageBase:
- Purpose:
- Formula:
- Use cases examples:- “Average Duration of SearchById Operation”
- “Average Duration of SearchByMatch Operation”
- “PhysicalDisk\ Avg. Disk sec/Transfer”
 
- SampleCounter+- SampleBase:
- Purpose: returns the average operations completed per sec, between now and last sampling.
- Formula:(N 1 – N 0) / ((D 1 – D 0) / F)
- Use cases examples:
 
 
 
 
Rate Readings:
- Single Counter Instance Counters:- Configurations:- RateOfCountsPerSecond32|- RateOfCountsPerSecond64- Example use cases:- “Number of SearchsById / Second”
- “Number of SearcheByMatch / Second”
- “Number of Creates / Second”
- “Number of Retrieves / Second”
- “Number of Updates / Second”
- “Number of Deletes / Second”
 
- Setup: just needs one PC definition, of typeRateOfCountsPerSecond32orRateOfCountsPerSecond64.
 
 
 
- Nominator + Denominator/Base Counter Configurations:- Configurations:
 
 
Percentage Readings:
- Notes:- Sometimes direct value comparison is not appropriate. Especially comparisons between different servers with different hardware). In which case the use of abstract ratios as percentages is better.
 
- Single Counter Instance Counters:- Examples:- TODO
 
- Setup:- TODO
 
 
- Nominator + Denominator/Base Counter Configurations:- RawFraction+- RawBase:- Purpose: record two absolute values at a particular instant in order to get a fraction result (ie, two values, now, in order to get a fraction result).
- Formula:(N 0 / D 0) x 100- N = Number Of Operations, D = Number of another Operation.
 
- Warnings: check the denominators value before you read the value, to ensure you don't get divide by zero errors.
- Use cases examples:- “Ratio of Creates / Searches”
- “Ratio of Updates / Searches”
- “Ratio of Deletes / Searches”
- “Operation Success / Attempt %“
- “Operation Failure / Failure %“
- “Operation Exception / Failure %“
 
 
- SampleFraction+- SampleBase:- Purpose: returns average operations between last two samplings (ie, now and last sampling).
- Formula:((N 1 - N 0) / (D 1 - D 0)) x 100
- Examples:- “Cache\Pin Read Hits %.”
 
 
- Timer100Ns+ TODO:???- Purpose: return amount of time operation was active compared to sample duration.
- Formula:(N 1 - N 0) / (D 1 - D 0) x 100
- Examples:- “Processor\ % User Time”
- “Lucene.NET Search Service Usage Duration / SearchByMatch Operation Duration”
 
 
- Timer100NsInverse" + TODO:??? * Purpose: return amount of time operation was active compared to sample duration, *from knowing the amount of time a process was inactive*. * Formula:(1- 1)) x 100`- Where D = elapsed sample interval, and N = the amount of time the component was inactive.
 
- Examples:- “Processor\ % Processor Time”
 
- CounterMultiTimer + CounterMultiBase:- displays as a percentage, the avg time taken for operations over the time of the sample.
 
- CounterMultiTimer100Ns + CounterMultiBase- TODO
 
- CounterMultiTimerInverse + CounterMultiBase- TODO
 
- CounterMultiTimer100NsInverse + CounterMultiBase- TODO
 
 
- Examples:
- Setup:- TODO
 
* Difference Counters:
- Examples:- Elapsed time since application started
- Hard-drive consumed since start of application
 
- Setup:- TODO
- Use: CounterDelta32, CounterDelta64
 
- Usage:- Difference between second value and first value.
 
* Unclassified:
- ElapsedTime?
* KNown combos
* PercentageCounter:
Types
CounterMultiBase A base counter that indicates the number of items sampled. It is used as the denominator in the calculations to get an average among the items sampled when taking timings of multiple, but similar items. Used with CounterMultiTimer, CounterMultiTimerInverse, CounterMultiTimer100Ns, and CounterMultiTimer100NsInverse.
CounterMultiTimer A percentage counter that displays the active time of one or more components as a percentage of the total time of the sample interval. Because the numerator records the active time of components operating simultaneously, the resulting percentage can exceed 100 percent. This counter is a multitimer. Multitimers collect data from more than one instance of a component, such as a processor or disk. This counter type differs from CounterMultiTimer100Ns in that it measures time in units of ticks of the system performance timer, rather than in 100 nanosecond units. Formula: 2) x 100 / B, where N 1 and N 0 are performance counter readings, D 1 and D 0 are their corresponding time readings in ticks of the system performance timer, and the variable B denotes the base count for the monitored components (using a base counter of type CounterMultiBase). Thus, the numerator represents the portions of the sample interval during which the monitored components were active, and the denominator represents the total elapsed time of the sample interval.
CounterMultiTimer100Ns A percentage counter that shows the active time of one or more components as a percentage of the total time of the sample interval. It measures time in 100 nanosecond (ns) units. This counter type is a multitimer. Multitimers are designed to monitor more than one instance of a component, such as a processor or disk. Formula: 3) x 100 / B, where N 1 and N 0 are performance counter readings, D 1 and D 0 are their corresponding time readings in 100-nanosecond units, and the variable B denotes the base count for the monitored components (using a base counter of type CounterMultiBase). Thus, the numerator represents the portions of the sample interval during which the monitored components were active, and the denominator represents the total elapsed time of the sample interval.
CounterMultiTimer100NsInverse A percentage counter that shows the active time of one or more components as a percentage of the total time of the sample interval. Counters of this type measure time in 100 nanosecond (ns) units. They derive the active time by measuring the time that the components were not active and subtracting the result from multiplying 100 percent by the number of objects monitored. This counter type is an inverse multitimer. Multitimers are designed to monitor more than one instance of a component, such as a processor or disk. Inverse counters measure the time that a component is not active and derive its active time from the measurement of inactive time Formula: (B - 4)) x 100, where the denominator represents the total elapsed time of the sample interval, the numerator represents the time during the interval when monitored components were inactive, and B represents the number of components being monitored, using a base counter of type CounterMultiBase.
CounterMultiTimerInverse A percentage counter that shows the active time of one or more components as a percentage of the total time of the sample interval. It derives the active time by measuring the time that the components were not active and subtracting the result from 100 percent by the number of objects monitored. This counter type is an inverse multitimer. Multitimers monitor more than one instance of a component, such as a processor or disk. Inverse counters measure the time that a component is not active and derive its active time from that measurement. This counter differs from CounterMultiTimer100NsInverse in that it measures time in units of ticks of the system performance timer, rather than in 100 nanosecond units. Formula: (B- 5)) x 100, where the denominator represents the total elapsed time of the sample interval, the numerator represents the time during the interval when monitored components were inactive, and B represents the number of components being monitored, using a base counter of type CounterMultiBase. CounterTimer A percentage counter that shows the average time that a component is active as a percentage of the total sample time. Formula: (N 1 - N 0) / (D 1 - D 0), where N 1 and N 0 are performance counter readings, and D 1 and D 0 are their corresponding time readings. Thus, the numerator represents the portions of the sample interval during which the monitored components were active, and the denominator represents the total elapsed time of the sample interval.
CounterTimerInverse A percentage counter that displays the average percentage of active time observed during sample interval. The value of these counters is calculated by monitoring the percentage of time that the service was inactive and then subtracting that value from 100 percent. This is an inverse counter type. Inverse counters measure the time that a component is note active and derive the active time from that measurement. This counter type is the same as CounterTimer100NsInv except that it measures time in units of ticks of the system performance timer rather than in 100 nanosecond units. Formula: (1- 6)) x 100, where the numerator represents the time during the interval when the monitored components were inactive, and the denominator represents the total elapsed time of the sample interval. CountPerTimeInterval32 An average counter designed to monitor the average length of a queue to a resource over time. It shows the difference between the queue lengths observed during the last two sample intervals divided by the duration of the interval. This type of counter is typically used to track the number of items that are queued or waiting. Formula: (N 1 - N 0) / (D 1 - D 0), where the numerator represents the number of items in the queue and the denominator represents the time elapsed during the last sample interval.
CountPerTimeInterval64 An average counter that monitors the average length of a queue to a resource over time. Counters of this type display the difference between the queue lengths observed during the last two sample intervals, divided by the duration of the interval. This counter type is the same as CountPerTimeInterval32 except that it uses larger fields to accommodate larger values. This type of counter is typically used to track a high-volume or very large number of items that are queued or waiting. Formula: (N 1 - N 0) / (D 1 - D 0), where the numerator represents the number of items in a queue and the denominator represents the time elapsed during the sample interval. ElapsedTime A difference timer that shows the total time between when the component or process started and the time when this value is calculated. Formula: (D 0 - N 0) / F, where D 0 represents the current time, N 0 represents the time the object was started, and F represents the number of time units that elapse in one second. The value of F is factored into the equation so that the result can be displayed in seconds. Counters of this type include System\ System Up Time.