구독 대기 시간

Microsoft.SQLServer.Replication.Windows.Monitor.SubscriptionLongEstimatedTimeMonitor (UnitMonitor)

이 모니터는 배포 데이터베이스에서 구독자에 배달 대기 중인 명령의 대기 시간을 확인합니다. 이 모니터는 병합 구독에 대해 사용하지 않도록 설정되어 있습니다.

Knowledge Base article:

요약

이 모니터는 배포되지 않은 명령 탭에 보류 중인 명령을 표시하는 복제 모니터와 유사한 정보를 수집하여, 이와 함께 이러한 명령을 배달하는 데 걸리는 예상 시간을 수집합니다. 예상 시간이 임계값 기간보다 긴 경우 그 정보를 표시하는 경고가 발생합니다. 이 모니터는 병합 구독에 대해 사용하지 않도록 설정되어 있습니다.

http://msdn.microsoft.com/library/ms183374.aspx

원인

배포 에이전트가 중지될 수 있습니다.

게시자 데이터베이스에 커밋되고 배포 데이터베이스에 복제된 많은 명령이 포함된 대량 트랜잭션이 보류 중일 수 있습니다.

배포 데이터베이스에서 읽거나 구독자 데이터베이스에 쓰는 동안 배포 에이전트에서 성능 문제가 발생할 수 있습니다.

해결 방법

-MaxDeliveredTransactions와 -Continuous를 둘 다 지정한 경우 배포 에이전트에서 지정된 개수의 트랜잭션을 배달한 다음 중지됩니다(-Continuous가 지정된 경우에도 마찬가지). 작업이 완료된 후 배포 에이전트를 다시 시작해야 합니다.

게시자 데이터베이스의 대용량 트랜잭션으로 인해 경고가 발생한 경우 예상 배달 시간을 계산합니다. 예상 배달 시간이 스냅숏을 만들고 적용하는 시간보다 오래 걸리면 구독을 다시 초기화하는 것이 좋습니다.

배포 데이터베이스를 읽는 동안 배포 에이전트에서 성능 문제가 발생한 경우 배포 테이블에 대해 fullscan 옵션을 사용하여 통계 업데이트를 실행합니다.

구독자에 쓰는 동안 배포 에이전트에서 성능 문제가 발생한 경우 구독자 데이터베이스에서 모든 차단 또는 리소스 대기를 확인하고 해결합니다.

추가

아래 매개 변수 값을 변경하면 배포 에이전트 성능이 향상될 수 있는지 테스트합니다.

CommitBatchSize

COMMIT 문을 실행하기 전에 구독자에 대해 실행할 트랜잭션 수입니다. 기본값은 100개입니다.

QueryTimeOut

쿼리 시간 제한(초)입니다. 기본값은 1800초입니다.

SubscriptionStreams

구독자와 병렬로 변경 내용을 일괄 적용할 수 있는 배포 에이전트당 허용되는 연결 수입니다. SQL Server 게시자의 경우 1~64개의 값 범위가 지원됩니다.

외부

https://msdn.microsoft.com/library/ms173804.aspx)

재정의 가능한 매개 변수

이름

설명

기본값

경고 우선 순위

알림 우선 순위를 정의합니다.

보통

경고 심각도

알림 심각도를 정의합니다.

경고

사용

워크플로 사용하거나 사용하지 않도록 설정합니다.

알림 생성

워크플로에서 알림을 생성하는지 여부를 정의합니다.

간격(초)

워크플로를 실행하는 반복 시간 간격(초)입니다.

300

동기화 시간

동기화 시간

 

임계값

임계값

60

시간 제한(초)

닫히고 실패한 것으로 표시되기 전에 워크플로를 실행할 수 있는 시간을 지정합니다.

200

데이터베이스 연결 시간 제한(초)

워크플로는 지정된 기간 동안 데이터베이스에 액세스할 수 없으면 실패하며 이벤트를 등록합니다.

15

Element properties:

TargetMicrosoft.SQLServer.Replication.Windows.Subscription
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledTrue
Alert GenerateTrue
Alert SeverityWarning
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeMicrosoft.SQLServer.Replication.Windows.MonitorType.SubscriptionLongEstimatedTime
RemotableTrue
AccessibilityPublic
Alert Message
Windows의 MSSQL 복제: 배포 데이터베이스에서 구독에 대해 대기 시간이 긴 명령이 검색되었습니다.
구독 '{0}'에서 적용을 기다리는 보류 중인 명령에 대한 긴 예상 시간을 발견했습니다.
예상 시간: {1}초
RunAsMicrosoft.SQLServer.Core.RunAs.Monitoring

Source Code:

<UnitMonitor ID="Microsoft.SQLServer.Replication.Windows.Monitor.SubscriptionLongEstimatedTimeMonitor" Accessibility="Public" Enabled="true" Target="SQLReplWD!Microsoft.SQLServer.Replication.Windows.Subscription" ParentMonitorID="Health!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="Microsoft.SQLServer.Replication.Windows.MonitorType.SubscriptionLongEstimatedTime" ConfirmDelivery="false" RunAs="SqlCoreLib!Microsoft.SQLServer.Core.RunAs.Monitoring">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="Microsoft.SQLServer.Replication.Windows.Monitor.SubscriptionLongEstimatedTime.AlertMessage">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>Warning</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Target/Property[Type='MSRL!Microsoft.SQLServer.Replication.Core.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>
<MachineName>$Target/Host/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/MachineName$</MachineName>
<NetbiosComputerName>$Target/Host/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/NetbiosComputerName$</NetbiosComputerName>
<InstanceName>$Target/Host/Host/Property[Type='SqlCoreLib!Microsoft.SQLServer.Core.DBEngine']/InstanceName$</InstanceName>
<SqlTimeoutSeconds>15</SqlTimeoutSeconds>
<ConnectionString>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription"]/Distributor$</ConnectionString>
<MonitoringType>$Target/Host/Host/Property[Type="SqlDiscW!Microsoft.SQLServer.Windows.DBEngine"]/MonitoringType$</MonitoringType>
<SubscriptionType>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription"]/Type$</SubscriptionType>
<PublisherName>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription"]/Publisher$</PublisherName>
<Subscriber>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription"]/Subscriber$</Subscriber>
<PublisherDb>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription"]/PublicationDatabase$</PublisherDb>
<SubscriberDb>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription"]/SubscriptionDatabase$</SubscriberDb>
<Publication>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription"]/PublicationName$</Publication>
<ReplicationType>$Target/Property[Type="MSRL!Microsoft.SQLServer.Replication.Core.GenericSubscription"]/ReplicationType$</ReplicationType>
<EstimatedTimeSecondsThreshold>60</EstimatedTimeSecondsThreshold>
<IntervalSeconds>300</IntervalSeconds>
<SyncTime/>
<TimeoutSeconds>200</TimeoutSeconds>
<CheckMachineAndInstanceName>false</CheckMachineAndInstanceName>
</Configuration>
</UnitMonitor>