I am experimenting with server-side rendering of React components from within a ASP.NET website using both React.Net and SuperchargedReact implementations.
My initial load test results show that a single request can be handled reasonably quickly (circa 100ms) but that performance quickly degrades under concurrent requests (> 4 seconds). Details below.
It's probably I'm not using these tools to their potential and testing was cursory, but I need some advise on where to start on improving performance.
Roughly what level of concurrency should I expect? E.g. Is concurrency limited to the number of javascript engine instances I can hold in memory. Or is it dependent on the number of IIS worker processes. Or something else.
Where should I start looking to improve performance - tips? tricks? resources?
What could explain SuperchargedReact underperforming React.Net when it supposedly implements a number of performance improvements.
I constructed a js bundle from ES6 sources via browserify/babelify/gulp-minify. Then the react components were exposed via global variables. The react-router was not included and some small modifications were made to SuperchargedReact to get it working without the router.
I requested a single server-side rendered page of about 5kb from JMeter on another server with different numbers of threads and request-per-minute limits.
10 threads
req/min | avg ms | min ms | max ms
100 | 138 | 90 | 1,161
500 | 256 | 4 | 2,049
1000 | 566 | 31 | 4,969
20 threads
req/min | avg ms | min ms | max ms
100 | 284 | 88 | 1,964
500 | 432 | 52 | 3,649
1000 | 1,557 | 75 | 4,405
50 threads
req/min | avg ms | min ms | max ms
100 | 1,393 | 91 | 4,693
500 | 1,723 | 19 | 10,523
1000 | 4,418 | 97 | 32,769
10 threads
req/min | avg ms | min ms | max ms
100 | 763 | 7 | 2,194
500 | 2,149 | 263 | 5,160
1000 | 2,270 | 149 | 4,865
I stopped testing SuperchagedReact at this point since it looked significantly worse than React.Net
答案 0 :(得分:1)
这有助于我们:
ReactSiteConfiguration.Configuration.AllowMsieEngine = false;
ReactSiteConfiguration.Configuration.ReuseJavaScriptEngines = false;
希望有所帮助。