we activated SSR on our Spartacus frontend and tried to test if it worked. For this, we step SSR and run it in production mode. After that, we used JMeter to create the load of 10 simultaneous users requesting two simple CMS Sites. There was also a check added to verify that the answer was actually the SSR response and not the CSR "empty index html". About 80% of all requests did not do SSR, but fallback to the CSR response. If we lower the number of simultaneous users to only 2, it worked most of the time.
To prevent that this is caused by one of our customizations, we run the same experiment with the Spartacus OOTB code and it produced the same result.
Our SSR Optimizing Options were the following:
const engineConfig: SsrOptimizationOptions = {
timeout: 5000, // spartacus default: 3000
maxRenderTime: 300_000, // spartacus default: 300_000 (5min)
concurrency: 20, // spartacus default: 20
cache: false,
cacheSize: 20,
debug: false,
};
Is the SSR engine able to render this amount of simultaneous requests? If the cache is activated, it worked fine. But we are having thousands of pages and we most likely are not able to cache every page.