Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize the performance bottleneck of react's server rendering #1004

Closed
lenny0702 opened this issue Feb 5, 2017 · 8 comments
Closed

Optimize the performance bottleneck of react's server rendering #1004

lenny0702 opened this issue Feb 5, 2017 · 8 comments

Comments

@lenny0702
Copy link

Firstly I have to say, this is a great framework. Originally, we have to the server rendering of react from bottom to up. This framework save us a lot of time and it's so convenient, thanks!

But as we know, there is a serious performance issue of react's server render, which will cause cost a lot of time to render when the server facing hight concurrent requests.

But I saw a very cool idea of Walmart labs which kind of solve this issue perfectly. Git link is https://github.com/walmartlabs/react-ssr-optimization

I'm wondering if it's possible to combine this idea to next.js? That will make the server render far more useful. Looking forward to your response

@arunoda
Copy link
Contributor

arunoda commented Feb 6, 2017

I think this is totally doable with our custom server API.
See: https://github.com/zeit/next.js#custom-server-and-routing

I'd also like to have an example using this project. Also show how to benchmark it.

@epiqueras
Copy link

I've seen that after ~100 concurrent users it becomes significantly more efficient to run server renders on child processes. This + caching provides the best performance.

@timneutkens timneutkens removed the good first issue Easy to fix issues, good for newcomers label Jun 12, 2017
@gcpantazis
Copy link
Contributor

See also #2279

@timneutkens
Copy link
Member

Going to close this since it's been open for over a year, since then React 16 was released, and we want to eventually support stream rendering.

@devcorpio
Copy link

Hi @epiqueras,

Could you show how run server renders in nextjs on child processes?

@epiqueras
Copy link

@devcorpio There's a few libs that do it for you, but with React 16 you can use streams.

See https://zeit.co/blog/streaming-server-rendering-at-spectrum.

@devcorpio
Copy link

Thanks for your answer @epiqueras.

Could I use that feature with nextjs? Or I'm blocked until the framework use that feature internally?

Kind regards

@epiqueras
Copy link

Next.js supports custom servers. See https://github.com/zeit/next.js/#custom-server-and-routing.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants