Urgent.News

What's breaking now, across thousands of outlets.

Tech

How Many Builds Can Run at Once on One VPS

The number is not a property of your deployment tool. It is your server's available memory divided by what one build takes at its peak, and every answer that skips that division is guessing on your behalf. So do the division. An install-and-build of a Next.js, Nuxt, Remix or React Router project wants roughly 2 GB of RAM while it runs. That number is worth being honest about: it comes from…

The number of builds that can run simultaneously on a single VPS depends on the server's available memory divided by the peak memory usage of an individual build. For instance, a Next.js, Nuxt, Remix or React Router project typically requires around 2 GB of RAM during runtime. However, this figure is not a fixed rule but a starting point that should be replaced with your own measurements.

To determine your server's limits, you should run three commands: free -m to check the free memory, /usr/bin/time -v npm run build to find the maximum resident set size of a build, and sudo systemd-run --scope -p MemoryMax = 2G npm run build to test if a build with a 2 GB limit will complete successfully. Remember to account for other applications running on the server, such as the already deployed site, PHP-FPM pool, database, and their memory usage.

Keep in mind that the number of concurrent builds is not determined by the number of CPU cores. Instead, it's primarily governed by available memory. Running a build that exceeds the memory limit will result in a failure, either due to the Node process hitting its heap limit or the kernel killing the process as a last resort. The failure mode is different for V8 heap exhaustion versus kernel memory depletion, with the latter potentially affecting other services running on the server.

Adjusting the memory limit or adding swap space may change the failure behavior but does not resolve the underlying issue of insufficient memory for your builds. A more accurate approach is to size your deployments based on the peak RSS (resident set size) and subtract what is already occupied by other running processes. This way, you can avoid unexpected failures and ensure smoother deployments on your VPS.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

How to build a developer community

I described in my last post what makes and defines a developer community . If you are a developer wanting to run a developer community, or you work in developer relations (DevRel) and you are managing…

More from Wednesday 26 August →