#Scaling Next.js in production (docker + kubernetes)

5 messages · Page 1 of 1 (latest)

rose notch
#

Wondering if anyone here would be willing to share their scaling practices for their Next app in production (including resource limits + requests on the deployment)?

Specifically, I have a Next app in a docker-base Node image, deployed to Kubernetes (so not Vercel) with the usual set-up, including a Horizontal Pod Autoscaler with CPU-based scaling. That said, as the application has grown, have been beginning to wonder if CPU-based scaling is really the best for a Node.js/Next.js application.

What are others' experiences scaling a Next app at scale with Docker + Kubernetes? Did you end up scaling on CPU? Memory? Both? Or neither, and instead on some custom metric (event loop utilization)? What kind of resources have you ended up allocating per pod (requests and limits for CPU and memory)?

Super interested in others' experiences and advice here -- and thanks in advance!

spice axle
#

Im trying to figure out some similar questions. It doesnt seem like Next actually lists any recommended configs in terms of CPU/memory anywhere, which makes it pretty tough to understand deployment best practices.

What did you wind up going with for CPU/memory on your containers?

covert bronze
#

Did you run into any issues with CPU based scaling?

spice axle
#

@covert bronze was that directed at me or @rose notch ?

covert bronze
#

kem988, since they are wondering if CPU based scaling is the best. Sounds like they are encountering some issues