Friends, I am *wheezing*. People on this plane are giving me looks. Holy shit...like...hahahahahahaha....omg...doubled over laughing:

https://martijnhols.nl/blog/how-much-traffic-can-a-pre-rendered-nextjs-site-handle

How much traffic can a pre-rendered Next.js site really handle? by Martijn Hols

How much traffic can a self-hosted Next.js site handle? I ran load tests, uncovered surprising limits, and compared pre-rendering with SSR.

Martijn Hols

@slightlyoff Martin’s testing method is a little bit peculiar — was the issue really next.js? Or lack of load balancing and infrastructure right sized for the workload?

The article closes saying SSR isn’t appropriate for lots of traffic, but… doesn’t discuss caching, or if a page truly needs to be 100% dynamic.

There’s a lot of high traffic fully/semi dynamic pages out there, SSR is just fine for so many applications.

TLDR: next isn’t likely the problem here at all

@benschwarz My take is that the "prerendered" perf is trash tier, but I'd need to repeat the tests on the same host config. Just shocking to see below 200qps on 2 cores and 8gb of RAM, likely backed by 10K+ IOPS storage.

@slightlyoff @benschwarz yeah but that has nothing to do with next.js? saying that as somebody who hates next.js.

https://hachyderm.io/@mb21/114132277376540490

mb21 (@[email protected])

@[email protected] @[email protected] This. If it’s really a completely prerendered static site, this is testing the web server (like nginx). Or actually for a static site that needs to scale, you should use a CDN instead of (not in front of) the web server. sure, all CDN providers charge for bandwidth, but at that point it’s a pricing question, not a “does it scale” question (same for S3).

Hachyderm.io

@slightlyoff @benschwarz

I see you haven't met my friend WordPress...

On "static" sites where you can cache each page's html, nginx/litespeed can serve a huge amount of requests.

But if it's slightly "dynamic" (users log in, have custom views etc), it's all SSR and you'd be lucky to get 20 RPS on that sort of hardware because php is synchronous & single threaded, and WP has to do a billion calculations with 200 db queries to just return "You have 0 friends"

Fortunately most are the former

@slightlyoff @benschwarz
Though, again, the real stories here are

1. trash tier performance of almost all web hosts - especially any "shared hosting", but also most VPS and even many dedicated servers. They advertise blazing perf but run on overloaded 8yr old hardware. The "perf inequality gap" might be worse than on phones...

Surely SPA popularity is partly due to most devs knowing nothing about servers, so they are forced to move compute to the client when their server can't handle anything

@slightlyoff @benschwarz

2. The gap between SSG and SSR

Moving to a decent server had vastly better RPS. But there was still a chasm between SSG and SSR. Given its title, this is where the article should have focused

It's the same story as with WP (though, even there, plenty can also be done to partly mitigate the mess I described)

I'm curious how Ruby on Rails, Django, etc fare on a similar SSG vs SSR test. I suspect similar, or worse, numbers. Youd have to move to eg Golang for decent perf