locked
Slow Sync times with minimal data. RRS feed

  • Question

  • Hello All,

    I know there are a few postings on slow synching. But Maybe the scenario here is a little different, I have virtually no data in my tables but I do have a large number of tables 50 odd to sync.

    Maybe something I have configured is the problem.

     

    I am having some speed issues with Sync Services, and I need to just clarify if the timings I am getting sounds reasonable.

    I am syncing in the development environment.Using a  windows Mobile emulator & My Sync Service hosted by  WCF Service Host.

     

    I used Sync Services Designer to create the datacache which has approx 50 tables which will be synchronised

    Synchronisation times seemed to be about 10mins each time I synched,
    However the data in the database is very minimal.
    most tables have no records in them at the moment.
    There are 2 tables which have 300 records in each of those.

    After stepping through the Sync Service code & some research
    I realised SyncGrouping may help (I grouped all the tables in one syncgroup)
    Also set all Synctables to be UseExistingOrFail (rather than create the table)

    My sync time halved to 5minutes.
    However on enabling biDirectional synching for some sync tables my sync time dramatically went up again (over 10mins sync time again).


    Is Sync Services just not a practical idea when using a large number of tables (i.e. 50 odd)?

     

    Is there anything that would explain the slow synching? when the database is close to empty I would of thought it would be quicker

     

    Can I optimise the syncing speed by changing the code behind the sync designer to say limit the number of columns I am syncing for each table? or is this bad to do?

     

    I have read through some of the Ideas of Serialization optimization etc in this forum,
    But I wouldnt imagine this would help me out too much when my database  am syncing with has limited data.

    Any help much appreciated, I will try to post any more details as I investigate more,
     but it does really seem like something is not right with those Sync speeds.

    Thanks for any tips or advice.

     

     

    • Moved by Hengzhe Li Friday, April 22, 2011 2:25 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Wednesday, January 14, 2009 5:36 AM

Answers

  • Himanath,

    This fixed overhead is a common complaint due to the fact that your queries to get changes are being fired off, regardless of whether or not the table has changed.  Some techniques you might want to try to improve the perf:


    1.  If you are using SyncAdapterBuilder, it is going to slow things down as it queries system tables every time you sync in order to generate the commands necessary to get and apply changes.  You might want to instead bake this logic into store procedures instead.  Doing so will improve performance but also is much easier to maintain and secure.

    2.  Write some logic to skip tables that have not changed during your sync operation.  Specifically, you might fire off a query per tables that runs against your timestanp columns in order to quickly determine f a table has changed.  Adding a covered non-clustered index to those timestamp columns is going to make that query relatively fast.  Subsequently, if a table has not changed you can remove it from your sync adapter list.

    Hope this helps,

    Sean Kelley
    Program Manager
    Microsoft

     

    Tuesday, July 28, 2009 1:01 PM
    Moderator

All replies

  • The client is Desktop or Device ?

     

    If your client is a device you may check this thread :

    http://forums.microsoft.com/sync/ShowPost.aspx?PostID=4272406&SiteID=75

    Wednesday, January 14, 2009 8:04 PM
  •  

    The Client is a Device.

    I did have a look at that thread and was interesting to see the slow sync times happening there. It looked like that was related to data in the table/tables being slow to sync.

     

    The fact I have no data(virtually) in the tables to be synced, and no records have been created/modified at server or client, but I have 50 odd empty tables to sync, I thought I would put the question out there whether there is a performance issue with many tables in the synchronisation.

     

    If I debugged the Web Service code, I noticed that it seemed to be taking at least 8 seconds for each of the empty tables to be synced even though they were empty(Each Table was synched in its own syncGroup at this stage)

    . I Put all the tables in the one sync group and performance was improved but still over 10mins with bi-directional sync on some tables.

     

    I seem to be getting the opinion that each table in the sync adds a significant amount of time to the Sync even if there is no data in it.

     

    I ran a Walkthrough for Sync Services using the Northwind database and one table synching, that worked well. But that was one table.

     

    Thanks for any more advice you can provide.

    Thursday, January 15, 2009 9:49 PM
  •  

    The Client is a Device.

    I did have a look at that thread and was interesting to see the slow sync times happening there. It looked like that was related to data in the table/tables being slow to sync.

     

    The fact I have no data(virtually) in the tables to be synced, and no records have been created/modified at server or client, but I have 50 odd empty tables to sync, I thought I would put the question out there whether there is a performance issue with many tables in the synchronisation.

     

    If I debugged the Web Service code, I noticed that it seemed to be taking at least 8 seconds for each of the empty tables to be synced even though they were empty(Each Table was synched in its own syncGroup at this stage)

    . I Put all the tables in the one sync group and performance was improved but still over 10mins with bi-directional sync on some tables.

     

    I seem to be getting the opinion that each table in the sync adds a significant amount of time to the Sync even if there is no data in it.

     

    I ran a Walkthrough for Sync Services using the Northwind database and one table synching, that worked well. But that was one table.

     

    Thanks for any more advice you can provide.

    Hello all,

    Even i am also facing same problem.My aplication has about 65 tables on average of 35 columns for each table.Sync service is taking 20 min for intial sync .and minimum of 10 min for each sync even there is no data need to be uploaded or downloaded.
    Iam using ado.net sync service 1.0.Does release 2.0 has any upgrades regarding performance.
    Or should i move to Rda.But Microsoft is suggesting not use Rda.Please help me regarding performance.
    Thanks in advance.
    Friday, July 24, 2009 1:38 PM
  • Himanath,

    This fixed overhead is a common complaint due to the fact that your queries to get changes are being fired off, regardless of whether or not the table has changed.  Some techniques you might want to try to improve the perf:


    1.  If you are using SyncAdapterBuilder, it is going to slow things down as it queries system tables every time you sync in order to generate the commands necessary to get and apply changes.  You might want to instead bake this logic into store procedures instead.  Doing so will improve performance but also is much easier to maintain and secure.

    2.  Write some logic to skip tables that have not changed during your sync operation.  Specifically, you might fire off a query per tables that runs against your timestanp columns in order to quickly determine f a table has changed.  Adding a covered non-clustered index to those timestamp columns is going to make that query relatively fast.  Subsequently, if a table has not changed you can remove it from your sync adapter list.

    Hope this helps,

    Sean Kelley
    Program Manager
    Microsoft

     

    Tuesday, July 28, 2009 1:01 PM
    Moderator