r/reactjs • u/dustingetz • Jul 31 '17
Who is SSR react in prod?
How many nodejs processes do you have? Render-to-string can take a long time and node is single threaded. How is your nginx gateway set up?
2
Upvotes
2
u/slightly_old_avocado Jul 31 '17
I asked this question stack overflow and got some cool responses. Some of the info is a bit outdated (smart/dumb component idea is basically stateless functional components). There are some examples of companies using component caching really well. Ultimately you'll probably have to do a combination of a bunch of things to get the renderToString time down, as well as cluster your node server so you get multiple processes running on multi-core machines
1
2
u/darrenturn90 Jul 31 '17
I use setImmediate around my express processes, and have one node process for each core.