限制 SQL Server 复制?
我们在 sql server 2008 上当前的事务复制设置存在性能问题。 当创建新快照并将快照应用于订阅者时,我们看到发布者和分发者上的网络利用率跃升至 99%,并且磁盘队列达到 30 这导致应用程序超时。
有什么办法可以限制正在发送的复制数据吗? 我们可以限制复制的行数吗? 是否有任何开关可以打开/关闭来实现此目的?
谢谢!
We have a performance issue with the current transactional replication setup on sql server 2008.
When a new snapshot is created and the snapshot is applied to the subscriber, we see network utilization on the publisher and the distributor jump to 99%, and we are seeing disk queues going to 30
This is causing application timeouts.
Is there any way, we can throttle the replicated data that is being sent over?
Can we restrict the number of rows being replicated?
Are there any switches which can be set on/off to accomplish this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您有一个替代方案来处理这种情况
You have an alternative to deal with this situation
我们的 DBA 迫使我们分解 dml 代码,以便一次批量运行 50000 行,中间间隔几分钟。他有时会使用该批量大小,但这样我们的复制数据库就可以了。
对于批处理,所有内容都必须放入临时表中,一个执行 row_number() 的新列(将其命名为 Ordinal),然后是一个类似于 Ordinal / 50000 的 BatchID。最后是一个循环来计算 BatchID 并逐批更新目标表。对开发人员来说很困难,对 DBA 来说更容易,而且无需为基础设施支付更多费用。
Our DBA has forced us to break down dml code to run in batches of 50000 rows at a time with a couple of minutes in between. He plays with that batch size time to time but this way our replicating databases are ok.
For batching, everything has to go into temp tables, a new column (name it Ordinal) that does row_number(), and then a BatchID to be like Ordinal / 50000. Finally comes a loop to count BatchID and update target table batch by batch. Hard on devs, easier for DBAs and no need to pay more for infrastructure.