TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How much traffic can a pre-rendered Next.js site handle?

76 点作者 MartijnHols2 个月前

23 条评论

davedx2 个月前
&gt; excellent developer experience (DX)<p>My experience with next.js has been it’s like working with struts or enterprise java beans or something. It’s a giant, batteries included framework whose primary purpose is to lock you in to the Vercel ecosystem. There are some bright spots - next-auth is decent - but all this SSR spaghetti with leaky abstractions dripping out (try rendering emails in the backend of a next app) make it really not worth it.<p>Also compile times when working on it locally can get astronomical with relatively modest applications for no obvious reasons. Like Scala but less predictable.<p>I suspect the % of apps built with next.js that actually genuinely get a lot out of SSR is tiny, it’s mostly the darling of B2B SaaS companies.
评论 #43318038 未加载
评论 #43308838 未加载
jonathanhefner2 个月前
I have also found that Next.js is shockingly slow.<p>I recently added some benchmarks to the TechEmpower Web Framework Benchmarks suite, and Next.js ranked near dead last, even for simple JSON API endpoint (i.e. no React SSR involved): <a href="https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r23&amp;hw=ph&amp;test=json" rel="nofollow">https:&#x2F;&#x2F;www.techempower.com&#x2F;benchmarks&#x2F;#section=data-r23&amp;hw=...</a><p>I discussed it with a couple of Next.js maintainers (<a href="https:&#x2F;&#x2F;github.com&#x2F;vercel&#x2F;next.js&#x2F;discussions&#x2F;75930">https:&#x2F;&#x2F;github.com&#x2F;vercel&#x2F;next.js&#x2F;discussions&#x2F;75930</a>), and they indicated that it&#x27;s only a problem for &quot;standalone&quot; deployments (i.e. not on Vercel). However, I&#x27;m not entirely convinced that is true. I wonder if there are major optimizations that could be made to, for example, the routing system.
评论 #43306695 未加载
评论 #43307067 未加载
评论 #43306973 未加载
jowday2 个月前
Next has been a nightmare to use every step of the way. Endless undocumented ways to shoot yourself in the foot, especially if you’re trying to deploy somewhere other than Vercel. I can’t imagine anyone using it for anything other than the most basic CRUD app. And even then I’d recommend not using it.
评论 #43307533 未加载
评论 #43306751 未加载
fabian2k2 个月前
I did expect SSR to be generally quite slow, but ~34 rps on the VPS is below my expectations. If I understand the blog post correctly, this tests an essentially static site with no DB requests. That would be pretty abysmal performance for something like that.<p>I&#x27;d be really concerned to have to work around a performance limitation like that in a more complex app.
评论 #43308170 未加载
PUSH_AX2 个月前
Ditch next, build a static site, put it in your object storage of choice, cache&#x2F;cdn in front… solved problem?
评论 #43315603 未加载
henning2 个月前
&gt; Then again, I don&#x27;t think &lt;500 kB is too much traffic for a modern website, especially since the page is already usable after the first 100 kB.<p>I could not disagree more. Why does a &quot;modern&quot; website that just has simple static text and images need to be tens of times larger&#x2F;slower to load than a simple static website with plain old HTML and CSS?<p>What kind of &quot;developer experience&quot; do you need for a static website? Just write HTML or markup and run it on a local server with hot reload -- what more do you want&#x2F;need? Specifically what use cases is NextJS satisfying here?
评论 #43306887 未加载
jpc02 个月前
I don&#x27;t know if I entirely buy the argument here. CSS&#x2F;JS&#x2F;Images should be at the very least cached by your reverse proxy if not on a CDN(I&#x27;m a strong believer you should never be serving Images&#x2F;Videos from your own VPS, even if you don&#x27;t like Cloudflare there are many CDN providers).<p>So at most it is the actual dynamic content being served, ie API calls.<p>Now whether next.js bad deployment experience on your own hardware is to blame for the complexity of doing that easily is up for debate.<p>As much as I dislike the accidental complexity of React and it&#x27;s &quot;frameworks&quot;(react-router&#x2F;next), I can deploy a good looking site with good accessibility very quickly using it and evey JS bootcamp dev won&#x27;t be completely lost if they happened to need to work on the project.<p>Sometimes the technically best decision is decided by non-technical factors.
评论 #43318597 未加载
评论 #43313372 未加载
t-writescode2 个月前
I like this article and it directly relates to some things I&#x27;m working on at present; but I wish it had gone a bit deeper into server-side rendering.<p>In an earlier section, there was a statement about how there&#x27;s something like 60 individual requests in a webpage load, so the &quot;90% less&quot; (1&#x2F;10th speed) could actually be faster overall.<p>Also worth investigating is how many concurrent requests can exist. If it&#x27;s a little slower; but a single server can handle 5x the number of concurrent requests, because most of the interaction is busy-waiting for something else, that could be worthwhile.<p>Given how many job openings seem to be interested in Next.js and&#x2F;or anything 100% Javascript, it seems like some parts of the industry are pushing all JS all the time; but it seems like maybe that&#x27;s not the right route to go, and that _also_ is interesting.<p>Just interesting things all around :)
c0wb0yc0d3r2 个月前
I’ve never used next.js. Wouldn’t pre-rendering a site remove dependence on any framework? It should just be html js and css right?
评论 #43306889 未加载
评论 #43306968 未加载
评论 #43306876 未加载
评论 #43307348 未加载
coolhand21202 个月前
Let me guess: Significantly less than the same site as an SPA on a CDN. All with significantly more cost, complexity, and a whole additional domain of security concerns. The only up side is rapid search engine indexing, about a week faster - if that even matters to you. Performance improvement is questionable. Debugging is very difficult. It&#x27;s difficult to imagine why you would want your team to ensure anything server side for your web front end in 2025.
评论 #43308039 未加载
wavemode2 个月前
Even aside from Next.js specifically - when did it become okay that visiting a website fires off dozens of HTTP requests? Back in the day the server would just render the site and return it in one request. It seems nowadays we are causing both the client and server to do a lot more work. And it&#x27;s not like development has gotten easier, it&#x27;s mostly gotten harder. So it&#x27;s simply the worst of all worlds?
评论 #43307641 未加载
评论 #43307556 未加载
_benton2 个月前
Next.js is basically designed to run on servers that process one event at a time and in which there are many parallel deployments (ie. &#x27;serverless&#x27;). Still, it&#x27;s shocking just how bad its performance actually is - virtually unusable for anything serious hosted off of Vercel or analogous providers.
ekojs2 个月前
Interesting. My hunch is that Next.js is not optimized for the dockerized Node server deployment. I would say that you could get much greater prerendering performance from Next.js by just fronting the assets directly using Caddy&#x2F;Nginx.
评论 #43307607 未加载
评论 #43307265 未加载
chrisldgk2 个月前
For things like this (public facing static sites) I’ve often gone for a pretty naive approach using Redis (more lately KeyDB as a drop-in alternative) to cache any static pages that SSR would be handling otherwise for a minute or so. If I needed any more performance I’d also use node:cluster to run the server on multiple threads. This significantly improved RPS while keeping CPU usage lower because I had found that my bottleneck for most of these problems was database lookups (Postgres mostly, specifically rerequsting the same data).<p>The big convenience that SSR brings for most of my use cases is querying the CMS for changes and getting instant updates on the frontend without having to statically rebuild the HTML anytime content is updated. That approach allowed me to run SSR without all the performance issues it would bring otherwise.<p>I don’t have exact numbers but I can provide them if anyone’s interested.
niutech2 个月前
Using Next.js for a blog&#x2F;home website (not PWA) is overengineering. Why not just put a static website made in Publii, hugo or similar and just sparkle it with a bit of vanilla JS where it is appropriate? This is how it should be - progressive enhancement. Requesting hundreds of KB of JS code just to show a static content is bad practice. KISS!
ksec2 个月前
That is why Request per seconds has been a meaningless measurement for the past 20 years. A page view would be a better metric. Whether that is 1 request or 100 request.<p>That is especially true when comparing a site done with Rails + Hotwire vs Others + React &#x2F; Client Side Rendering.
jarofgreen2 个月前
&gt; One key thing to underline: each request in the test is just a single call to the pre-rendered Next.js page. No assets are requested. A real visitor would need 60+ additional requests. That means as few as three simultaneous visitors could push the server dangerously close to its limit.<p>Ok but remember browsers will reuse HTTP connections, HTTP2 introduces multiplexing, and browsers have tight mode. So you can&#x27;t just take the figures for 1 request and divide by 60 to get the real world performance.
评论 #43307018 未加载
zkldi2 个月前
I just don&#x27;t understand how this can be this slow. What on earth is it doing to get 193 requests per second on static, cached content?<p>The article doesn&#x27;t dig too deep into this sadly, rather just accepts that it&#x27;s slow and uses a different tool.<p>But seriously, this is responding to a request with the content of a file. How can it be 100,000x slower than the naive solution. What can it possibly be doing, and why is it maxxing out the CPU?<p>If no-one else looks into this, I might get around to it.
评论 #43308402 未加载
clusterfook2 个月前
No mention of <a href="https:&#x2F;&#x2F;nodejs.org&#x2F;api&#x2F;cluster.html#cluster" rel="nofollow">https:&#x2F;&#x2F;nodejs.org&#x2F;api&#x2F;cluster.html#cluster</a>? Not sure if NextJS supports it even, but if you are only using one core of your webserver for node, you are leaving stuff on the table.
econ2 个月前
Maybe hn could periodically hide ddosed sites on the front page.<p>I ran a script once that would show an archived copy for links that stopped working. Then ended up hosting&#x2F;stealing most of someone website which moved to a different domain. The concept was nice tho.
casper142 个月前
I&#x27;ve been down the same path with next.js. When seeing terrible performance after testing with k6, I pushed all static files (js, css, images etc) to a cdn.<p>This way only the first request hits your actual server, the rest is handled for you.
Aeolun2 个月前
I think these stats are for running with the built in next.js server?<p>For shits and giggles, you should try compiling to completely static files, then host them with nginx.
hyuuu2 个月前
have you considered using remix?