<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>Tom Grounds' Blog</title><link>http://blogs.parivedasolutions.com/tgrounds/</link><description /><managingEditor>Tom Grounds</managingEditor><dc:language>en-US</dc:language><generator>.Text Version 0.95.2004.102</generator><item><dc:creator>Tom Grounds</dc:creator><title>SQL Server 2000 Replication as a solution for WAN Latency</title><link>http://blogs.parivedasolutions.com/tgrounds/archive/2006/09/26/264.aspx</link><pubDate>Tue, 26 Sep 2006 12:16:00 GMT</pubDate><guid>http://blogs.parivedasolutions.com/tgrounds/archive/2006/09/26/264.aspx</guid><wfw:comment>http://blogs.parivedasolutions.com/tgrounds/comments/264.aspx</wfw:comment><comments>http://blogs.parivedasolutions.com/tgrounds/archive/2006/09/26/264.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.parivedasolutions.com/tgrounds/comments/commentRss/264.aspx</wfw:commentRss><trackback:ping>http://blogs.parivedasolutions.com/tgrounds/services/trackbacks/264.aspx</trackback:ping><description>&lt;P&gt;&lt;FONT face=Arial&gt;What do you do when your client's&amp;nbsp;WAN can't support&amp;nbsp;the busines-critical application you just built?&amp;nbsp; You install SQL Server replication.&amp;nbsp; This has been an interesting process trying to get the a client of ours with two offices&amp;nbsp;running an application we developed at a reasonable pace at both ends.&amp;nbsp; The network environment for this client is very locked down - it's more locked down than any government or multi-national corporation network that I have developed for.&amp;nbsp;&amp;nbsp;W&lt;/FONT&gt;&lt;FONT face=Arial&gt;e engaged an infrastructure management compnay that we recommend to our clients&amp;nbsp;to assist us in setting up the initial replication between the&amp;nbsp;two offices&amp;nbsp;- the reason we went this route was twofold.&amp;nbsp; 1)&amp;nbsp; Allow the users in&amp;nbsp;both offices to run the application&amp;nbsp;within their local office so that the network latency didn't effect the usability of the application (by having&amp;nbsp;to traverse the WAN)&amp;nbsp;and 2) Give&amp;nbsp;our client&amp;nbsp;a business continuity plan that allows them to run off of the&amp;nbsp;remote office's server in the event they have to vacate their corporate office.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;The process is pretty straight-forward...&lt;/FONT&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;&lt;FONT face=Arial&gt;On the&amp;nbsp;home server, create a publisher for the database (this adds additional columns for replication to every table in the database)&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Arial&gt;Backup the database and copy it to the&amp;nbsp;remote server&lt;/FONT&gt; 
&lt;LI&gt;&lt;FONT face=Arial&gt;Restore the database to the second server and add a subscription to the publisher on the other SQL Server&lt;/FONT&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;OK, that's oversimplified but those are the basic steps&amp;nbsp;- it took us 16 hours to copy the database&amp;nbsp;between the two offices over the WAN&amp;nbsp;and about an hour to get everything working in the remote office.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Performance issues...&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;We started to see strange things that shut down replication throughout the day (usually 2-3 times a day) with an enumeration error - which was really that the query being run for replication was timing out. so we made a few changes&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;On the replication agent, you can set a schedule for when the replication job starts - now this is an interesting thing - because replicaiton should run and sit idle when it has nothing to process... so, I set the job to start each hour from 5:00 AM through midnight (allowing it to stop during our nightly processing) - but in the event that it did shut down - it would re-start the next hour - which depending on the urgancy of the replication this may be acceptable.&amp;nbsp; When I reduced the time to every 10 minutes I found that the job was ended in success - but not going to idle - so, that defeated my purpose.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;When replication was first set up we used the&amp;nbsp;Default agent&amp;nbsp;profile which has the following key parameters:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;BarchSize: 100000&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;ChangesPerHistory: 100&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;DestThreads: 4&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;DownloadedGenerations/Read/WritePerBatch: 100&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;KeepAliveMessageInterval: 300&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;DeadlockRetries: 5&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;PollingInterval: 60&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;QueryTimeout: 300&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;There is an alternate profile that we switched t &amp;nbsp;'High Volume - Server to Server' with the following key parameters:&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Arial&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;BatchSize: 100000&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;ChangesPerHistory: 100&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;DestThreads: 4&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;DownloadedGenerationsPerBatch: &lt;STRONG&gt;2000&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;DownloadedRead/WriteChangesPerBatch: 100&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;KeepAliveMessageInterval: 300&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;DeadlockRetries: 5&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;PollingInterval: 60&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;QueryTimeout: &lt;STRONG&gt;600&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;This profile doubles the query time-out value - we found that in our environment we eliminated the enumeration errors which had been shutting down the replication.&amp;nbsp; Haven't seen the error again.&lt;/P&gt;
&lt;P&gt;This turned out to be a good solution for our client and we will keep this solution for future reference.&lt;/P&gt;&lt;/FONT&gt;&lt;img src ="http://blogs.parivedasolutions.com/tgrounds/aggbug/264.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>