I hope you all are doing well and safe.
Today I am here to ask a question specific to Sitecore JSS performance.
Category - Sitecore JSS integrated mode, performance issue
Sitecore Version - 9.2, Azure Pass
- Azure Pass
- Azure front door
- Web APP P2V2
Problem Statement - While running my application in integrated mode I am facing issues with the performance of the site.
During performance tuning, I have polished almost all the surfaces i.e.
1) HTML cache is implemented (Although as per Sitecore documentation it states that in integrated mode its only cache JSON and the node server efforts of converting JSON to Html will be considered in every request however after implementing HTML cache (rending/var by data) I can see that DB call is low.
2) Sitecore module Dianoga is implemented to get Web optimized image format (WEBP). Definitely it helped as now the images are almost 70-80% reduced.
3) From front end perspective I have implemented below major changes
- Browser cache is implemented for static files (CSS, JS, TTF, WOFF)
- JS is minified
- Image Lazyloading is implemented
- Web optimized font WOFF is used
Post the above three major changes I can see page response time reduced to 30-40% but it didn't reach the expected level of at least (2-3 sec)
4) At last, the umbrella of CDN is implemented and now the page response time is reduced to 40-60% but that's not the solution as I want to test the capability of my application with CDN.
The root cause is the time taken by server-side rendering, so at the time of Peak load I have found that a simple page with 4-5 components(with HTMLCACHE enabled) is taking more than 10 seconds where 8 seconds has been taken by the single SSR call only and 2 seconds is taken by other resources(Images, CSS, JSS, etc.)
To analyze it further
1) I have implemented Node js profiler by following this post, it was helpful as now I have something to enter in node area but still still still no luck as the profile is not giving much info it says that 93% of the time is consumed by some "C: WS M32tdll.dll".
2) To revalidate, if it's really an issue with integrated mode I have installed a fresh Sitecore 9.2 instance and deployed a sample JSS app and yes I found that sometimes the TTFB(time to the first byte) is a bit high for a sample app but still it's not too much as compared to my application at the time of peak load. Please find the attached screenshot for the TTFB issue on a vanilla Sitecore instance.
I believe with all these analyses and implementation I am going in the right direction but would like to hear and get suggestions from my Sitecore community.