Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Synchornization and re-indexing search View modes: 
User avatar
Member
Member
kong-gc.cuny - 4/10/2012 4:17:26 PM
   
Synchornization and re-indexing search
We've been able to programatically setup a scheduled task to run that automates our synchronization of content from staging to production.

Now our issue is with the smartsearch indexing which causes slowdowns with on production. We've determined that everytime the sync runs, production tries to re-index each change and our guess is that if there are a lot of tasks, the search constantly tries to re-index each item in the queue and eventually timesouts and takes up a lot of cpu time bringing the server to a crawl.

We've found that we can solve this by disabling the smartsearch, let the sync run, re-build the index when the sync is done and then re-enable the smartsearch again.

Our problem now is figuring the optimal way to schedule all this. The sync is not a problem since we already have this, but this kickoffs on staging. How can I disable, re-index and re-enable the smartsearch features on production when the sync runs on staging?

One idea was to use a standard .net data connection to production and change the record for the smartsearch value to disable it before we execute the sync. Then after the sync completes, we write a value to a custom field, also from staging, to note the completion of the sync.

Meanwhile on production, we would run a check every few minutes on that field to see if it's been populated with a value denoting the completion of the sync. At this point, we can then re-build the index (since it would already be disabled as noted earlier) and then re-enable the smartsearch.

This all sounds ok in theory but just seems a bit tedious to have to run 2 scheduled tasks on 2 web servers just to resolve our timeout issues because of the sync. Does anyone have a cleaner routine to do this?

Is there anyway to handle all of this directly from staging without needing to run 2 scheduled tasks?

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/11/2012 2:22:38 AM
   
RE:Synchornization and re-indexing search
Hi,

You can add this key into the production web.config file and set its value to true: CMSProcessSearchTasksByScheduler

Then, on the production instance you will configure the search indexer scheduled task to some time and the search tasks will be indexed at this time only.

Best regards,
Juraj Ondrus

User avatar
Member
Member
kong-gc.cuny - 4/12/2012 9:40:02 AM
   
RE:Synchornization and re-indexing search
Just to make sure, this is available on 5.5R2?

And is there a search indexer scheduled task already available or would we need to custom build that process because I don't see that as a pre-configured option in 5.5R2.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 4/13/2012 2:14:40 AM
   
RE:Synchornization and re-indexing search
Hi,


The task is listed under global scheduled tasks and it is called Execute search tasks. However, you are right, that key was added in version 6. I just confirmed it with our developer. In this case you will need to upgrade your CMS to version 6. I am sorry for the confusion.

Best regards,
Juraj Ondrus

User avatar
Member
Member
phillip.duncan-svpworldwide - 6/3/2013 1:58:26 PM
   
RE:Synchornization and re-indexing search
Big thanks for this post. I recently added a staging server to our Kentico WebFarm setup.

Stagings is manually synced to Production.
Production is synced to Staging every 5 minutes.

We have 15+ cultures that enter/edit content everyday. Our SQL server started slowing down with the CPU maxed at 100%. After running SQL Profiler, I could see both staging and production running commands related to the Search Index.

Adding the "CMSProcessSearchTasksByScheduler" key to our web.config files instantly solved the issue.