bertho-zero / react-redux-universal-hot-example

A starter boilerplate for a universal webapp using react, redux, express and feathers
https://react-hot-example.herokuapp.com/
MIT License
636 stars 171 forks source link

SSR with high traffic #298

Open anhdn opened 7 years ago

anhdn commented 7 years ago

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!

bertho-zero commented 7 years ago

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

anhdn commented 7 years ago

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

MHerszak commented 7 years ago

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 ?

anhdn commented 6 years ago

I'm using varnish cache.

bertho-zero commented 6 years ago

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

Swapnilchavan18 commented 6 years ago

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?

bertho-zero commented 6 years ago

@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.

MHerszak commented 6 years ago

@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.

anhdn commented 6 years ago

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

bertho-zero commented 6 years ago

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

bertho-zero commented 6 years ago

News for that since all these updates?