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
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
@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
To show that next is not a problem it’d be informative to benchmark a fully static site on the same server.
I mean, you can collect your own data to back your claim.
@pointlessone @slightlyoff My 'claim' isn't something even slightly unbelievable! Dynamic workloads have numerous levers to pull to eek out request performance.
Off the top of my head: Load balancing reverse proxies, employing a CDN, use well-suited cache headers, use server-side caching, use partial response caching, ensure the server has enough CPU/memory for the workload, ensure there's autoscaling, eliminating slow DB queries.
All of which will improve RPS for dynamic workloads.
Yeah, it had little to do with Next and mostly just a shit server
VPS isnt inherently slow - there's plenty of fast and cheap ones on lowendtalk.com - many (eg Ryzen) are much faster than his bare metal. netcup.com root servers are a good EU option
Nginx, caddy, etc would surely serve the static assets faster and with less compute
Avoiding US-based CDNs is probably prudent. More on SSR vs SSG wouldve been good. k6 also has playwright built-in now, for testing a full page render
@slightlyoff @benschwarz yeah but that has nothing to do with next.js? saying that as somebody who hates next.js.
@[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).
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
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
@slightlyoff it made me laugh as well. I can understand being shocked if you found these results hosting on Vercel, but this just points to author doing a poor job of hosting themselves. As others mention, what alternative are you comparing to on the same host?
Free advice, add a #varnish container to front anything static and 1000x your throughput
@slightlyoff I think about this quote from https://tailscale.com/blog/new-internet a lot:
> I read a post recently where someone bragged about using kubernetes to scale all the way up to 500,000 page views per month. But that’s 0.2 requests per second. I could serve that from my phone, on battery power, and it would spend most of its time asleep.
Tailscale's CEO, Avery Pennarun, explores the future of the internet, discussing the evolution of networking, the issues with today's complex systems, and how Tailscale is simplifying connectivity for developers with a new, more efficient approach. Discover the vision for a New Internet.
@slightlyoff 😂
I just had to try this. Same K6 script, a ratty old webpage written in ASP.net Web Forms (yeah) running on IIS on a Windows VM (4 cores, 4 GB), no caching whatsoever, all server side rendered (so to speak).
2760 requests/s, iteration_duration avg=69.63ms, max=223.39ms