Most of us might have faced issues with performance and slow Sitecore instance,I would like to share my experience with Sitecore troubleshooting which I have learned over the period of time, these are some of the things which I feel should be checked whenever we see the application has really some performance issues.
This is one of the key factor of healthy business relation, we should make sure that application/business always meets users expectation, a non performing(from performance standpoint) site can’t guarantee a high ROI.
Here are few things i would like to mention to check the slow performing Sitecore site, and what can be done to fix it.
- Logs Reviews:
- This is one of the wonderful feature which is shipped with Sitecore, and we should make use of it to check the performance of the application, regularly checking the logs can help us in fixing the issue well before in time before it becomes critical.
- Logs can give us most of the details which includes:
- Publishing details.
- Schedule task running.
- Any code error issue.
- Indexing or query issue.
- Issue with MongoDB connectivity.
- Issue with SOLR server connectivity.
- Issue with SQL server connectivity
- Above are some of the details which we can review and proceed our investigation, it’s always better to have something in hand to troubleshoot, instead of randomly looking for something.
- Enable JS,CSS Compression:
- This helps in boosting the performance of application, by reducing page request to server or browsing the pages.
- We can make use of static and dynamic content compression in IIS.
- Sitecore Debugging:
- We should make use of Sitecore debugger tool which can be found in Page editor, this gives a very good understanding and statistics around different components being used in the page.
- Helps in understanding which specific component(sublayout/rendering) takes how much time to render on the page.
- One of the early troubleshooting which every developer should start doing right from the time we start experiencing performance issue in local development environment.
- This tools helps in narrowing down the problem with code,and thus helps in putting all our energy and time in right spot.
- Sitecore Schedule tasks:
- Always try to review the Sitecore schedule tasks, and see if there is any task which is running and which is not expected?
- Make sure to review all the agents which is present under <agents> section, in web.config or using custom patch(if used).
- Another thing to note, we should also consider updating the frequency of that task execution by updating the time,if schedule task is not required we should disable it.
- See if the schedule task is triggering site full publish, this can be a serious issue in production environment,as this can clear all cache which can slow down the site.
- Keep close watch on the logs for anything related to schedules tasks.
- Indexing Strategy:
- Revisit the indexing strategy which is being used in the application, see if the full index rebuild is in place for any item publish event.
- Try to update the strategy if it’s not as per the requirement, or if it’s over killing.
- Please review this document for anything related to available indexing strategy- https://doc.sitecore.net/sitecore_experience_platform/setting_up_and_maintaining/search_and_indexing/indexing/index_update_strategies
- Image optimization:
- I have seen this issue with several applications, just because the images are not properly optimized, they end up taking more resource bandwidth and resulting poor user experience.
- Remember, this is the time of mobile, and any poor performing mobile site can be a serious issue to client.
- We should always train and educate our client and content authors to make use of optimized images, and trust me they will listen to you.
- This is one of the critical and important part of any Sitecore application, try to use indexes as much as possible when it comes to fetching details from the repository or searching of the items based on specific condition and filters.
- Try to perform all the operation directly in the query like:
- Avoid fetching all the results and then applying business rules to filter it based on specific condition, as I mentioned try to do most of the processing directly in query level.
- I had seen issues in application which was not performing well, just because of not making true use of indexes,review you index definition and configuration,and see if it has everything which is expected for it.
- Try to use create and use custom indexes for any custom feature, it’s always better to have one.
- Use of computed fields can be considered, this helps in executing any complex business logic while querying the results.
- Site publish:
- We should not trigger complete site publish in production environment,unless and until it’s very much required, this can be a costly operation, as this clears all the cache.
- Try to publish only areas which are required, we can trigger full site publish in development environment, but should be done carefully in production.
- Use Smart or Incremental Publish.
- Configure sublayout(s) and rendering(s) to use caching, this can give a real good browsing experience to site users.
- Clearing cache is something which should be considered in production environment, when trying to publish items this will clear the cache and can slow down the application performance.
- Use of GetDescendants is one of the costliest operation we can think off, we should always try using indexes or fast queries if possible and required.
- Revisit your code and search if there is any reference to GetDescendants, and update it if required.
- No of Items under one node:
- Try not to have more items under single node/item, and break it down using several sub folders or items.
- This helps in giving good content editor experience.
- make use of item buckets wherever applicable.
Few important things to follow:
- Write good code.
- Proper unit testing.
- Get your code reviewed.
- Follow best practices.
This helps in fixing some of the issues before it goes to QA.
Please also refer Sitecore recommendation for performance optimization : https://sdn.sitecore.net/Articles/Administration/Sitecore%20Performance/Optimizing%20Sitecore%206%20and%20later/Optimizing%20Performance%20in%20Sitecore.aspx
I hope this helps someone in troubleshooting Sitecore performance issues, please let me know if you have any questions or comments, happy to discuss.
Happy learning 🙂