Bug reports Found a bug? Post it here please.
Version 5.x > Bug reports > CPU Spikes when using content staging with many documents View modes: 
User avatar
Member
Member
Chanan - 4/28/2011 8:45:57 AM
   
CPU Spikes when using content staging with many documents
We had to move about 300 documents to production a few nights ago using content staging. When we did that, the cpu spiked on production and the sync slowed to a crawl. Looking around, I checked the APP_DATA -> Smart Search folder and saw files being created and deleted. So my guess was that it was due to Lucene indexing each file is it was moved over. I deleted the index in the admin - and the cpu dropped, the files finished and I put the index back which only took a few seconds to complete.

So, I think something has to be adjusted in the content staging process.

User avatar
Member
Member
kentico_alleng - 5/4/2011 4:18:31 PM
   
RE:CPU Spikes when using content staging with many documents
As with any other part of Kentico, we are continually working on improving content staging and search indexing, and we appreciate the details you have provided us.

If you are synchronizing a large number of new files, you should be able to avoid a slowdown like the one you saw by disabling indexing then re-enabling it after the synchronization is complete.

Regards,

Allen Greenhaw

User avatar
Member
Member
lancetek - 6/29/2011 8:40:14 AM
   
RE:CPU Spikes when using content staging with many documents
Hi Allen,
This is some pretty crazy 'functionality' for Kentico. I just went through the same pain as Chanan last night - using content staging, I saw the server CPU pegged at 100%. In my case it's the Lucene Index updates being altered due to document updates.

We have about 3,000 documents that we are uploading to the site using the content staging, so this indexing craziness made the server unusable until I could figure out what was going on with it.... which is a very... slow... process... when the server's cpu is at 100%!

I'd like to recommend an enhancement/bugfix - add another smart search setting 'minimum automatic smart search index age (in minutes)'. It's a setting that could be inspected inside of the TaskIndexer to check if the index is older than DateTime.Now - { minimum automatic smart search index age } - if the index IS older, then run the TaskIndexer Task (Rebuild, Update, etc). If the index is NEWER, then queue a maximum of a rebuild single task (that will be executed eventually automatically)

Note that by 'index' I mean checking all the index files, not just the main index file - in my case my main index file is named _14h.cfs, and that wasn't being updated, it was the 20 or so other *.cfs files that were being added and changed. So I'm sure Lucene and Kentico are doing something clever in that the 'document index updates' are being stored in external files to the regular index.

Note: This 'minimum automatic smart search index age (in minutes)' would sit well in the Site Manager > Settings > web site > just under the 'Enable Smart Search Indexing' field.

Note also that this mechanism should in no way stop someone from MANUALLY rebuilding the index. That would be bad.

Please contact me if you have any questions.

Cheers,
Lance



PS - Someone should probably put a note in the Content Staging documentation that if you're pushing more than a handful of documents, you should temporarily turn off 'smart search'. To helpfully avoid the crazy infinite index rebuilding loop thing.

PPS - Or maybe even alter the content staging syncronization service to turn it off and then on again automagically.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 6/30/2011 4:57:41 AM
   
RE:CPU Spikes when using content staging with many documents
Hello,

We are already aware of this problem and there is already a fix for it in the 6.0 version. There will be a web.config key to disable the rebuilding of the indexes automatically at the staging and there will be a scheduled task to rebuild the indexes periodically.

Best regards,
Boris Pocatko