- SAP Spartacus 服务器端渲染的本地性能测试
- SAP Spartacus UI 服务器端渲染的调试启动方式 -
- SAP Spartacus 服务器端渲染单步调试步骤之二:在服务
- SAP 电商云 Spartacus 服务器端渲染的单步调试详细步
- 关于 SAP UI5 对服务器端渲染 Server Sider
- Jest 测试框架 beforeEach 的设计原理解析
- SAP Spartacus UI Duplicated keys
- 关于 SAP 电商云首页加载时触发的 OCC API 请求
- SAP Spartacus 找不到登录入口的问题 - 如何使用
- SAP 电商云 Spartacus UI Quick Order
Test scenario 1:SSR cache option not activated, low concurrency
SSR optimization engine setting:
const ngExpressEngine = NgExpressEngineDecorator.get(engine, { timeout: 10000, debug: true, concurrency: 2,
forcedSsrTimeout:30000,
maxRenderTime:40000 });
jMeter setting:sending 10 requests for the same page simultaneously
Test result:
The 9 requests get CSR fallback result;
The last request gets SSR result
![](https://img.haomeiwen.com/i2085791/8e4a577c271e064b.png)
![](https://img.haomeiwen.com/i2085791/86ebee88446ec4c8.png)
CSR fallback observed in the backend:
![](https://img.haomeiwen.com/i2085791/26e49fe782e7e21d.png)
Test scenario 2:SSR cache option activated, low concurrency
SSR optimization engine:
const ngExpressEngine = NgExpressEngineDecorator.get(engine, { timeout: 10000, debug: true, concurrency: 2,
forcedSsrTimeout:30000,
maxRenderTime:40000,
cache:true, cacheSize: 20 });
When I send the first group of 10 requests, the same test result as Scenario 1.
And when I send the second group of 10 requests, all those 10 results are served by cached SSR result.
![](https://img.haomeiwen.com/i2085791/79a7ac27297eabfd.png)
![](https://img.haomeiwen.com/i2085791/0ba172ce03fdb775.png)
Test scenario 3:SSR cache option not activated, high concurrency
SSR Optimization engine:
const ngExpressEngine = NgExpressEngineDecorator.get(engine, { timeout: 10000, debug: true, concurrency: 20,
forcedSsrTimeout:30000,
maxRenderTime:40000});
Test result: the same as scenario 1.
![](https://img.haomeiwen.com/i2085791/86ab8357b9e1b66c.png)
Test scenario 4:SSR cache option activated, high concurrency
SSR Optimization engine:
const ngExpressEngine = NgExpressEngineDecorator.get(engine, { timeout: 10000, debug: true, concurrency: 20,
forcedSsrTimeout:30000,
maxRenderTime:40000,
cache:true, cacheSize: 20 });
Test result is exactly the same as in scenario 2:
![](https://img.haomeiwen.com/i2085791/35b4850a19e60f85.png)
Test scenario 5:SSR cache option activated, high concurrency, enlarge timeout value
SSR optimization engine:
const ngExpressEngine = NgExpressEngineDecorator.get(engine, { timeout: 90000, debug: true, concurrency: 20,
forcedSsrTimeout:90000,
maxRenderTime:100000,
cache: true, cacheSize: 10});
Test result is the same as in scenario 2.
![](https://img.haomeiwen.com/i2085791/ae60af4a3da64bc6.png)
Conclusion
-
When a lot of requests for the same page reach SSR server simultaneously, only the request which picked up first by SSR server ( let's call it request A) can succeed SSR process, all other requests will fall back CSR due to the rendering flag in SSR Optimization engine.
-
Enlarging timeout or maxRenderTime value will NOT change above behavior.
-
If cache option is applied, the situation could be mitigated to some degree, that is, as long as one request is finished by SSR successfully, all other subsequent request on the same page could be directly served by cached result ( see scenario 2,4,5)
更多Jerry的原创文章,尽在:"汪子熙":
![](https://img.haomeiwen.com/i2085791/97c4752c0e619c44.png)
网友评论