Replication:distribution 中一直在运行 waitfor delay @strdelaytime 语句

Replication 自动创建来一个 Job:Replication monitoring refresher for distribution,这个Agent执行一个sp: dbo.sp_replmonitorrefreshjob ,在该SP中存在一个Loop,如下

create procedure sys.sp_replmonitorrefreshjob 
(
    @iterations tinyint = 0 -- 0 - run continuously, non 0 - run for specified iterations
    ,@profile bit = 0 -- for internal use - DO NOT DOCUMENT (remove this before release)
)
.....
while (1=1)
begin
--other commands--
--
-- wait for given delay
--
if (@profile = 1)
    raiserror('Waitfor delay %s', 10, 1, @strdelaytime)
waitfor delay @strdelaytime
end -- while (1=1)


为了有效监控Replication的运行,SQL Server Replication将性能数据缓存起来,周期性的刷新缓存。数据缓存能够减少查询,并且能够供多个User同时查询Replication的性能数据。dbo.sp_replmonitorrefreshjob  用于刷新缓存数据,刷新的周期(@strdelaytime)为4s 或 30s。

Microsoft SQL Server Replication Monitor is designed to efficiently monitor a large number of computers in a production system.The queries that Replication Monitor uses to perform calculations and gather data are cached and refreshed on a periodic basis. Caching reduces the number of queries and calculations required as you view different pages in Replication Monitor and allows monitoring to scale well for multiple users.

Cache refresh is handled by a SQL Server Agent job, the Replication monitoring refresher for distribution. The job runs continuously, but the cache refresh schedule is based on waiting a certain amount time after the previous refresh:

  • If there were agent history changes since the cache was last created, the wait time is the minimum of: 4 seconds; or the amount of time taken to create the previous cache.
  • If there were no agent history changes since the cache was last created (there could have been other changes), the wait time is the maximum of: 30 seconds; or the amount of time taken to create the previous cache.

参考doc:

Caching, Refresh, and Replication Monitor Performance

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

悦光阴

你的鼓励是我创作的动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值