Distribution2:Distribution Writer
Distribution Writer 调用Statement Delivery 存储过程,将Publication的改变同步到Subscriber中。查看Publication Properties->Ariticle Properties->Statement Delivery 属性,Distribution Writer调用Insert,Update 或 Delete 存储过程,实现数据的同步。

Distribution Writer不是每一个Command单独提交,而是根据CommitBatchSize 和CommitBatchThreshold来批量提交Commands,这样可以提高性能。
-CommitBatchSize commit_batch_size Is the number of transactions to be issued to the Subscriber before a COMMIT statement is issued. The default is 100.
-CommitBatchThreshold commit_batch_threshold Is the number of replication commands to be issued to the Subscriber before a COMMIT statement is issued. The default is 1000.
一般情况下,Distribution Writer的写入速度十分快,很少出现 Latency Problem。如果出现PageIOLatch_EX 或 PageIOLatch_SH 等待,请参考《Latch2:Latch和性能》:
PAGEIOLATCH_SH 发生在用户访问一个数据页,同时SQL Server正在将数据页从磁盘写入内存,经常发生PAGEIOLATCH_SH等待,说明内存不够大,导致SQL Server需要做很多页面读取的操作,磁盘IO是内存压力的副作用。
PAGEIOLATCH_EX:发生在从Disk page读取到内存buffer中,经常发生PAGEIOLATCH_EX等待,说明Disk读取速度慢,这和内存没直接关系。
Appendix:
引用《Transactional Replication Conversations》:
Distribution Writer thread writing queue commands to the Subscriber via parameterized stored procedures prefixed with sp_MSupd…, sp_MSins…, sp_MSdel… to apply individual row changes to each article at the subscriber.
The Writer-Thread calls Replication created stored procedures to apply changes to the subscriber. These sp’s rely on a user table’s unique index (usually primary key) to locate records to be updated or deleted. Latency in the Writer thread is usually see in long-running execution time for these stored procedures.
Possible Cause: Not Replicating SQL statements as “Parameters”
Obtain the create publication script and check ALL articles to see if the SQL statements are being sent as batch of ‘parameters’ statements. The status = 8 indicates ‘parameters’ batching is not enabled.
查看Article的Status,推荐将Status设置为25。
select artid,
name,
objid,
pubid,
status
from dbo.sysarticles
Satus:The bitmask of the article options and status, which can be the bitwise logical OR result of one or more of these values:
1 = Article is active.
8 = Include the column name in INSERT statements.
16 = Use parameterized statements.
24 = Both include the column name in INSERT statements and use parameterized statements.
64 = Identified for informational purposes only. Not supported. Future compatibility is not guaranteed.
For example, an active article using parameterized statements would have a value of 17 in this column. A value of 0 means that the article is inactive and no additional properties are defined.
Article status can be updated on-demand using the following Replication stored procedure. This should be executed on all articles.
USE [Publisher_database]
GO
exec [sys].[sp_changearticle]
@publication sysname = NULL,
@article sysname = NULL,
) = NULL,
) = NULL
参考doc:
Transactional Replication Conversations
Distribution2:Distribution Writer的更多相关文章
- Distribution1:Distribution Reader
在transactional replication中,在publication中执行了一个更新,例如:update table set col=? Where ?,如果table中含有大量的数据行, ...
- Replication:Distribution Reader
在transactional replication中,在publication中执行了一个更新,例如:update table set col=? Where ?,如果table中含有大量的数据行, ...
- 2015-2016 ACM-ICPC, NEERC, Northern Subregional Contest D:Distribution in Metagonia(构造)
http://codeforces.com/gym/100801/attachments 题意:给出一个数n(1 <= n <= 1e18),将 n 拆成 m 个整数,其中 m 必须是 2 ...
- Replication:distribution 中一直在运行 waitfor delay @strdelaytime 语句
Replication 自动创建来一个 Job:Replication monitoring refresher for distribution,这个Agent执行一个sp: dbo.sp_repl ...
- IPC 经典问题:Reader & Writer Problem
完整代码实现: #include <stdio.h> #include <unistd.h> #include <time.h> #include <stdl ...
- Gym - 100801D:Distribution in Metagonia (数学)
题意:给定一个N,让你把它拆成若干个只含素因子2和3的数之和,且两两之间没有倍数关系,比如10=4+6. 思路:即是2因子的幂递增,3因子的幂递减:或者反之. 对于当前N,我们拆分出的数为num=2^ ...
- Scalaz(13)- Monad:Writer - some kind of logger
通过前面的几篇讨论我们了解到F[T]就是FP中运算的表达形式(representation of computation).在这里F[]不仅仅是一种高阶类型,它还代表了一种运算协议(computati ...
- 杂项-桌面应用程序:Windows Live Writer(WLW)
ylbtech-杂项-桌面应用程序:Windows Live Writer(WLW) Windowslive Writer 即(WLW) 是一个免费的桌面应用程序,您可以使用它轻松发布丰富的内容到您的 ...
- DevExpress应用案例--语音识别器Dual Writer
Dual Writer是 一个以语音识别为特色的文档处理器,无需安装其他软件,只需要插入你的麦克风就可以开始录入口述文字.它不仅支持MS Word的DOCX格式,还支持 RTF.ODT.TXT等常见文 ...
随机推荐
- js中获取css的样式
因为给定一个div宽度或者其他样式之后,再设置一个border的宽度在js中得到的obj.setoffWidth就会变成width加上border的二倍宽度,因此可以自己写一个方法来获取样式.(obj ...
- intellij 调试spark scala 程序 报错
spark用的是cdh spark-2.0.1 package main.scala import org.apache.spark.rdd.RDD import org.apache.spark.{ ...
- [NOIP2013]华容道
1.题面 小 B 最近迷上了华容道,可是他总是要花很长的时间才能完成一次.于是,他想到用编程来完成华容道:给定一种局面,华容道是否根本就无法完成,如果能完成,最少需要多少时间.小 B 玩的华容道与经典 ...
- [知识点]字符串Hash
1.前言 字符串的几大主要算法都多少提及过,现在来讲讲一个称不上什么算法, 但是非常常用的东西——字符串Hash. 2.Hash的概念 Hash更详细的概念不多说了,它的作用在于能够对复杂的状态进行简 ...
- 【BZOJ3314】 [Usaco2013 Nov]Crowded Cows 单调队列
第一次写单调队列太垃圾... 左右各扫一遍即可. #include <iostream> #include <cstdio> #include <cstring> ...
- 关于.9.png格式图片的制作与使用
.9.png图片其实就是png格式图片,不过它比普通的png图片外围多了1px(像素)的边框,另外就是使用这种格式的图片可以实现背景自适应大小且不失真的效果. 制作使用步骤: 1.制作属于你自己的pn ...
- Java学习【1】
一.Java 简介 Java是由Sun Microsystems公司于1995年5月推出的Java面向对象程序设计语言和Java平台的总称. 2005年6月,SUN公司公开Java SE 6.Java ...
- 树莓派pppoe
连接的网络是移动(铁通)的宽带,不同的宽带的dns需要修改. 1.首先安装pppoe包 apt-get install pppoe 2.然后,复制conf文件/etc/ppp/pppoe.conf: ...
- asp.net 生成图形验证码(字母和数字混合)
验证码技术是网站开发过程中比较重要的技术,可以防止非法人员利用注册机或者登陆工具来攻击我们的网站.下面是效果图: 具体实现方法如下: 1.主要思路是:引用Using System.Drawing命名空 ...
- radio相关
radio 按钮组, name=”sex”. <input type="radio" name="sex" value="Male"& ...