Compartilhar via


Monitoring Workflow Performance

You can monitor workflow performance by using Performance (Perfmon.exe) on Windows XP or Reliability and Performance Monitor (Perfmon.exe) on Windows Vista. Through the use of these tools, you can configure performance counters to record performance data and set system alerts to notify you when a specified counter's value is above or below a defined threshold.

Windows Workflow Foundation provides a set of performance counters with the Windows Workflow Foundation performance object that you can use to track the performance of the workflow runtime as it executes workflow instances. For a complete list of performance counters, see Workflow Performance Counters.

Windows Workflow Foundation performance counters are enabled by default. Because they cause a performance penalty when the workflow runtime engine starts and when workflow instances are running, you can disable them by either setting the EnablePerformanceCounters attribute to false in a workflow configuration file, or changing it programmatically in EnablePerformanceCounters.

The following example shows where to add this attribute in your App.config configuration file:

<?xml version="1.0"?>
<configuration>
    <configSections>
        <section name="CustomWorkflowRuntimeSettings" type="System.Workflow.Runtime.Configuration.WorkflowRuntimeSection, System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
    </configSections>
    <CustomWorkflowRuntimeSettings Name="Workflow1" EnablePerformanceCounters ="false">
        <!-- Define common parameters and declare services required for your workflow runtime -->
    </CustomWorkflowRuntimeSettings>
</configuration>

For more information about the configuration files, see Workflow Configuration Formats and Task 2: Configure Runtime Services using App.Config.

For more information about adding performance counters to the Performance and Reliability and Performance Monitor tools, see the Microsoft TechNet Web site.

See Also

Other Resources

Workflow Performance Counters
Windows Workflow Foundation Programming Guide