This monitor checks the latency for commands in the Distribution database waiting to be delivered to the Subscribers.
This monitor collects information similar to the replication monitor that displays the pending commands in the undistributed commands tab, along with the estimated time to deliver those commands. If the estimated time is longer than in a time of threshold period, an alert is fired to display the information.
http://msdn.microsoft.com/library/ms183374.aspx
The Distribution agent may be stopped.
There may be large amounts of pending transactions with many commands committed on the Publisher database and replicated to the distribution database;
The Distribution agent may be experiencing performance issues reading from distribution database or writing to Subscriber database.
If -MaxDeliveredTransactions and -Continuous are both specified, the Distribution Agent delivers the specified number of transactions and then stops (even though -Continuous is specified). You must restart the Distribution Agent after the job completes.
If the alert is due to large transactions volume in Publisher database, evaluate the estimated time of delivery. Consider re-initializing the subscription if the estimated delivery time is longer than creating and applying a snapshot.
If the distribution agent is experiencing performance issues reading the distribution database, run update statistics with the fullscan option against the distribution tables.
If the distribution agent is experiencing performance issues writing to the Subscriber, check and address any blockings or resources waits on the Subscriber database.
Test if changing the below parameter values can help the distribution agent performance:
CommitBatchSize
The number of transactions to be issued to the Subscriber before a COMMIT statement is issued. The default is 100.
QueryTimeOut
The number of seconds before the query times out. The default is 1800 seconds.
SubscriptionStreams
The number of connections allowed per Distribution Agent to apply batches of changes in parallel to a Subscriber. For a SQL Server Publisher, a range of values from 1 to 64 is supported
https://msdn.microsoft.com/library/ms173804.aspx)
Name | Description | Default Value |
Alert Priority | Defines Alert Priority. | Normal |
Alert Severity | Defines Alert Severity. | Warning |
Enabled | Enables or disables the workflow. | Yes |
Generates Alerts | Defines whether the workflow generates an Alert. | Yes |
Interval (seconds) | The recurring interval of time in seconds in which to run the workflow. | 300 |
Synchronization Time | Synchronization Time |
|
Threshold | Threshold | 60 |
Timeout (seconds) | Specifies the time the workflow is allowed to run before being closed and marked as failed. | 300 |
Timeout for database connection (seconds) | The workflow will fail and register an event, if it cannot access the database during the specified period. | 15 |
Target | Microsoft.SQLServer.2012.Replication.Subscription | ||
Parent Monitor | System.Health.PerformanceState | ||
Category | PerformanceHealth | ||
Enabled | True | ||
Alert Generate | True | ||
Alert Severity | Warning | ||
Alert Priority | Normal | ||
Alert Auto Resolve | True | ||
Monitor Type | Microsoft.SQLServer.2012.Replication.MonitorType.SubscriptionLongEstimatedTime | ||
Remotable | True | ||
Accessibility | Public | ||
Alert Message |
| ||
RunAs | Microsoft.SQLServer.Replication.Monitoring.RunAs.Monitor |
<UnitMonitor ID="Microsoft.SQLServer.2012.Replication.Monitor.SubscriptionLongEstimatedTimeMonitor" Accessibility="Public" Enabled="true" Target="MS2RD!Microsoft.SQLServer.2012.Replication.Subscription" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.2012.Replication.MonitorType.SubscriptionLongEstimatedTime" ConfirmDelivery="false" RunAs="MSRL!Microsoft.SQLServer.Replication.Monitoring.RunAs.Monitor">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.2012.Replication.Monitor.SubscriptionLongEstimatedTime.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type='MSRL!Microsoft.SQLServer.Replication.Library.GenericSubscription']/SubscriptionName$</AlertParameter1>
<AlertParameter2>$Data/Context/Property[@Name='EstimatedTime']$</AlertParameter2>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="Health" MonitorTypeStateID="Health" HealthState="Success"/>
<OperationalState ID="Warning" MonitorTypeStateID="Warning" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<SqlTimeout>15</SqlTimeout>
<ConnectionString>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericSubscription"]/Distributor$</ConnectionString>
<SubscriptionType>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericSubscription"]/Type$</SubscriptionType>
<PublisherName>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericSubscription"]/Publisher$</PublisherName>
<Subscriber>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericSubscription"]/Subscriber$</Subscriber>
<PublisherDb>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericSubscription"]/PublicationDatabase$</PublisherDb>
<SubscriberDb>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericSubscription"]/SubscriptionDatabase$</SubscriberDb>
<Publication>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericSubscription"]/PublicationName$</Publication>
<ReplicationType>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Library.GenericSubscription"]/ReplicationType$</ReplicationType>
<EstimatedTimeSecondsThreshold>60</EstimatedTimeSecondsThreshold>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>300</TimeoutSeconds>
</Configuration>
</UnitMonitor>