Sitecore parallel publishing

In version 7.2 Sitecore introduced the ability to really crank up the publishing performance of the application. There is a lot more information about how to enable Sitecore parallel publishing at http://www.sitecore.net/Learn/Blogs/Technical-Blogs/Reinnovations/Posts/2014/03/Enabling-Parallel-Publishing.aspx

During testing it was found the time it took to publish was noticeably shortened. See here for some stats.

One uncertainty was exactly what does parallel publishing do behind the scenes? What does ‘parallel’ actually mean?

  • The setting MaxDegreeOfParallelism configures the number of threads to use
  • Languages are published concurrently
  • You don’t get any more publish queues by increasing the number of threads. This means you can only run 1 publish at a time still.
  • Publishing targets are published to in sequence – e.g. if you have 2 targets: web1 & web2 and publish to both, items will appear in web1 first, once complete items will then be pushed to web2
  • Be careful cranking things up too much – you need to ensure the servers in use can cope with the load. The dbs will be under a lot more strain during the publishes
  • For any diagnostics check in the new log file generated specifically for publishing

How to prove the targets run in series?

I ran a simple experiment to prove this:

  1. Create 2 publish targets: web & web2
  2. Create folder structure:
    1. Parallel item (folder)
    2. + item for web (only allowed to publish to web)
    3. + item for web2 (only allowed to publish to web2)
  3. Added custom publish item processor with Thread.Sleep(###)
  4. Run publish with MaxDegreeOfParallelism set as 4
  5. Check web db and check web2 db via dbbrowser

The data arrived:

  • Web 2a
  • Web 2b
  • Web2 2a
  • Web2 2c

The publish logs and the UI also indicate its one target after another.

1048 08:44:27 INFO  Settings.Publishing.MaxDegreeOfParallelism:4

8588 08:44:45 INFO  [Publishing]: Starting to process 2 publishing options

8588 08:44:45 INFO  [PublishOptions]: root:{8960D17C-38F1-4DB0-8EBD-FD6B128D9E00}, language:en, targets:Web, database:web, mode:SingleItem, smart:False children:True, related:False

8588 08:44:45 INFO  [PublishOptions]: root:{8960D17C-38F1-4DB0-8EBD-FD6B128D9E00}, language:en, targets:Web2, database:web2, mode:SingleItem, smart:False children:True, related:False

7040 08:44:46 INFO  Starting [ParallelPublishing] – ProcessQueue

7040 08:44:46 INFO  Processing queue

7040 08:45:46 INFO  Processing re-try list (count=0)

7040 08:45:46 INFO  Finished [ParallelPublishing] – ProcessQueue in 60354 ms

7040 08:45:46 INFO  Publish Mode : SingleItem

7040 08:45:46 INFO  Created : 2

7040 08:45:46 INFO  Updated : 1

7040 08:45:46 INFO  Deleted : 0

7040 08:45:46 INFO  Skipped : 1

10136 08:45:46 INFO  Starting [ParallelPublishing] – ProcessQueue

10136 08:45:46 INFO  Processing queue

10136 08:46:46 INFO  Processing re-try list (count=0)

10136 08:46:46 INFO  Finished [ParallelPublishing] – ProcessQueue in 60101 ms

10136 08:46:46 INFO  Publish Mode : SingleItem

10136 08:46:46 INFO  Created : 2

10136 08:46:46 INFO  Updated : 1

10136 08:46:46 INFO  Deleted : 0

10136 08:46:46 INFO  Skipped : 1

Leave a Reply

Your email address will not be published. Required fields are marked *