react-redux-universal-hot-example icon indicating copy to clipboard operation
react-redux-universal-hot-example copied to clipboard

SSR with high traffic

Open anhdn opened this issue 7 years ago • 11 comments

Hi,

Firstly, thanks @bertho-zero for continuing contribute this repo.

I have an issue with high traffic, the server responses first time very slowly. It can not handle 20 request / second although i use server with 8 core 8 Gb memory. I checked CPU, Memory number are still normally. Maybe it was blocked by node single thread. We have a SSR issue with high traffic. Does anyone have solution for this?

Thanks!

anhdn avatar Jul 07 '17 08:07 anhdn

You mean that you should add a cluster manager or use pm2 and pm2 scale?

bertho-zero avatar Jul 07 '17 09:07 bertho-zero

I used pm2 scale 8 to increase node process but it did not affect.

anhdn avatar Jul 07 '17 09:07 anhdn

I am facing the same issue and I believe it is necessary to prebuild Webpack and ship the frontend to a CDN. This will help a lot with your first load. What are your thoughts @bertho-zero ?

MHerszak avatar Jul 12 '17 16:07 MHerszak

I'm using varnish cache.

anhdn avatar Oct 22 '17 05:10 anhdn

React 16 increases server side rendering performance by 2-3 times.

bertho-zero avatar Oct 22 '17 17:10 bertho-zero

I am also having same issue of server side rendering, it takes more time(6-7 seconds) for large component tree, Anyone found solution on this?

Swapnilchavan18 avatar Oct 27 '17 22:10 Swapnilchavan18

@MHerszak Have you tested the use of a CDN? I would like to know, if possible, the potential gains.

@anhdn Does this mean that the problem is fixed with varnish cache?

If you have more details about the cause of the problems with high-traffic, do not hesitate to share.

bertho-zero avatar Nov 22 '17 23:11 bertho-zero

@bertho-zero I am going to use a CDN in the near future. But this will not fix the problem on first load which is the only problem I have. As soon it is cached it is fine.

MHerszak avatar Nov 23 '17 01:11 MHerszak

@bertho-zero we use varnish to cache html. But i think you should upgrade to react 16, improve performance of ssr a lots.

anhdn avatar Nov 23 '17 14:11 anhdn

@anhdn I upgraded to react 16, which is between 2 and 4 times faster with SSR.

bertho-zero avatar Nov 23 '17 17:11 bertho-zero

News for that since all these updates?

bertho-zero avatar Jun 05 '18 20:06 bertho-zero