Skip to content
On this page

Throttle (Windows)

PM> Install-Package Shuttle.Esb.Module.Throttle

INFO

This package currently makes use of Performance Counters which are only available on Windows. In due course these will be replace with Event Counters which are cross-platform. Pull Requests are welcome if you'd like to refactor in the meantime.

The Throttle module for Shuttle.Esb aborts pipeline processing when the CPU usage exceeds given percentage.

The module will attach the ThrottleObserver to the OnPipelineStarting event of all pipelines except the StartupPipeline and abort the pipeline if the SPU usage is exceeds the given percentage.

<configuration>
	<configSections>
		<section name="throttle" type="Shuttle.Esb.Module.Throttle.ThrottleSection, Shuttle.Esb.Module.Throttle"/>
	</configSections>

  <throttle 
	cpuUsagePercentage="65"
	abortCycleCount="5"
	performanceCounterReadInterval="1000"
	durationToSleepOnAbort="1s" />
</configuration>
AttributeDefaultDescription
cpuUsagePercentage65The CPU usage percentage to start throttling the endpoint pipelines.
abortCycleCount5The number of times a pipeline will be aborted before running at least once.
performanceCounterReadInterval1000The number of milliseconds between reading the CPU usage performance counter. Minimun of 1000 allowed.
durationToSleepOnAbort1sThe duration(s) to sleep when aborting a pipeline. Cannot be incremented for each abort.

Registration / Activation

The required components may be registered by calling ComponentRegistryExtensions.RegisterThrottle(IComponentRegistry).

In order for the module to attach to the IPipelineFactory you would need to resolve it using IComponentResolver.Resolve<ThrottleModule>().

Throttle (Windows) has loaded