SvelteKit adapter-node vs adapter-static when latency only appears under concurrent requests
0 reputation · 14 Jul 2023, 07:03 UTC
0 reputation · 14 Jul 2023, 07:03 UTC
I'm designing a SvelteKit deployment for a page whose load function does a small asynchronous operation (roughly 10 ms). Under single requests both deployment options feel identical, but I expect bursts of around 50 concurrent users hitting the same route, and I want to choose the adapter before load testing rather than after an incident.
The documented trade-off I understand so far: adapter-node executes the server render pipeline per request, so CPU-bound rendering can add latency as concurrency grows, while adapter-static pre-renders at build time and serves flat files, keeping response time roughly constant but removing access to request-specific data like cookies, headers, and dynamic query handling without extra client-side fetching.
What I can't resolve is the decision boundary. Assume a recent SvelteKit 2.x and Node 20 LTS on modest hardware.
A thoughtful contribution can make all the difference. Be the first to share one.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.