July 23, 2024

Dear Readers,

Recently, we faced a challenge while we were deploying to the production environment for one of our clients.

Challenge: Sitecore Publishing was extremely slow – took 5 mins or more to publish an item.

Scenario: We were doing manual deployment for one of our clients and we moved to Auto Deployment through all the environments for the first time this time. Everything was fine for the lower environments – Integration Environment, UAT Environment, Stage Environment – and suddenly when the same deployment package went to the Production environment, we found that Sitecore Publishing was extremely slow. It took more than 5 minutes to publish a single item. We all were scratching our heads, as to what happened on Production environment that the Publishing went that slow.

What we tried and it did’t work:

  1. We went and restarted the IIS on the machine – thinking that there might be something wrong with the current worker process. – After the App Pool Recycle, we thought it wasn’t, as it continued to be slow even after that.
  2. We have a number of background jobs configured for getting in the latest news from various feeds and add to Sitecore. We checked to see hope they are not running – checked – they were not we had disabled them prior to the deployment.
  3. We went to the Databases and truncated the Publish Queue and Event Queue tables – thinking they might be the reason it is slow, but no that wasn’t the case as well.
  4. All this time, we were checking the Sitecore Logs – and we found no errors! We turned the logging to DEBUG to check if anything weird, but everything was looking good.

We tried a number of other things which were specific to our solution but that didn’t work as well.

We were at a point, where most of the client team members felt that we will have to revert the deployment as there is something wrong with it. But, we were so sure, its nothing with the deployment.

We were still troubleshooting and didn’t lose hope to find what the issue was!

Solution:

Suddenly, while checking all the files in the solution, my friend and Colleague Mr. Sheetal Jain, had a Eureka moment!

He suddenly asked us to check for a configuration file called SitemapXML.config, disable it, restart the app pool and check the publishing again.

We did so and it worked! Sitecore Publishing was back to its normal speed.

Some background here — we have used the Sitecore.XML Module in our solution and this file was of that module. Important to note that the module works perfectly fine. We have this module in the solution for more than 2 years now and it didn’t have any issues.

Now, we went to the file and checked that there we have a publish:end event, which ideally refreshes the Sitemap – which is a file in the directory. And it was completely logical, that due to Auto Deploy, probably there were some rights which could have got disturbed (as we clean sweeped the directory for the first time after it was setup and tried to deploy – as during manual deploy, it was always overwriting the files everytime, rather than removing and adding all the files again).

So in case you face a similar issue where say the Sitecore Publishing gets very slow, just check, that hope there isn’t any custom code linked to Publish:end which is taking time.

Happy Sitecoring! 🙂

Leave a Reply

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