Answered by:
Improve performance of Sync Framework over the network

Question
-
I am using Sync Framework version 2.0 in a collaboratin scenario sync'ing between two sql server databases. I am initially provisioning my "client" database using an initial sync, and it is taking a long time (> 30 minutes) and it is not a large database.
I started playing with various options, and I discovered some strange performance characteristics: when I switched on batching I was able to watch the batched files being created on the server and the client. On the server the batched files are created quickly, but on the client they are created approximately every 20 seconds, and each file is about 70K in size. When monitoring the connection between the client and server machines I could see that the T1 that connects them is saturated with the traffic between them and the only communication between them is the sync framework.
Since a T1 should be about to manage a 70 k file in less than 0.5 seconds ( as opposed to the 20 seconds I am seeing) I am concerned that something is wrong either in my setup or in the framework.
When I run the same scenario but with the sync framework server running locally on my machine (so I am making a Sql connection from it to the remote server) the test executes much, much faster, which indicates to me that the communication overhead is coming from the framework.
Has anyone seen the same problem, and/or does anyone have any suggestions?
Nick CaramelloTuesday, April 13, 2010 10:29 PM
Answers
-
Normally with N-tier database sync scenario, batch files are send to service side one by one, you can check how long the ProxyProvider's ProcessChangeBatch takes, including how long the serviceProxy.UploadBatchFile takes and how long the serviceProxy.ApplyChanges takes. Thanks.
- Proposed as answer by Jandeep Thursday, April 29, 2010 11:44 PM
- Marked as answer by jigu2014Microsoft employee, Editor Wednesday, June 9, 2010 4:38 PM
Tuesday, April 27, 2010 6:04 PMAnswerer
All replies
-
antivirus? desktop firewall on the client side?Tuesday, April 13, 2010 11:29 PM
-
there is no firewall or antivirus on the server or the client. if there were I might expect to see a slowdown in the performance and/or an increase in the CPU usage, but I would not expect to see the T1 saturated while transferring small files.
Nick CaramelloWednesday, April 14, 2010 2:55 AM -
For the slow client-server scenario, are you using N-tier sync architecture so 2-tier?
For the client which is generating batch files much slowly, is the client generating batch files to a local directory on client's machine or to some network share connected with T1? And the client has similar machine config as server machine?
How many batches will be finally generated, in 70K size?
Wednesday, April 14, 2010 5:13 PMAnswerer -
So, I have more information on this.
The problem is basically this
- when using batching to a remote server over a WAN connection there is a 18-20 second time lapse between the end modification time stamp of one file and the creation time stamp of the next file. This time lapse is independent of the size of the file being pulled over.
- when doing the same batching to a local server there is no time lapse.
My solution to this problem is to increase the size of the batch files to 1MB which has greatly increased the performance, and the application is now performing OK.
If I can get rid of the 18-20 second time lapse I would be able to improve performance by a further 40%, which I am interested in doing. Since the creation of the file occurs in code immediately before request to get the batch file, I can reasonably make the assumption that the lag exists somewhere other than in the requesting of the batch files. I am going to profile the code to determine where it happens, and will then update this post.
Nick CaramelloFriday, April 23, 2010 3:50 PM -
Normally with N-tier database sync scenario, batch files are send to service side one by one, you can check how long the ProxyProvider's ProcessChangeBatch takes, including how long the serviceProxy.UploadBatchFile takes and how long the serviceProxy.ApplyChanges takes. Thanks.
- Proposed as answer by Jandeep Thursday, April 29, 2010 11:44 PM
- Marked as answer by jigu2014Microsoft employee, Editor Wednesday, June 9, 2010 4:38 PM
Tuesday, April 27, 2010 6:04 PMAnswerer