A server for a web app: Laravel, Django, Node.js
Frameworks have no «so many gigabytes per app» rule: memory is counted by the number of worker processes. We look at how PHP, Python and Node.js run their processes and which VPS to start with.
The short answer. To start with, a Laravel, Django or Node.js app with its database on the same server is usually fine on a VPS with 2 cores and 2–4 GB of memory on NVMe: catalog medians are $11.88 and $17.98 a month. The exact figure comes not from the framework but from the number of worker processes: each one keeps its own copy of the app in memory.
How to count memory
Neither Laravel, nor Django, nor Node.js names a minimum amount of memory for an app: it depends on the code, the libraries and the number of simultaneous requests. But all three have a clear process model. A server's memory is the database (its buffer is usually the biggest consumer, see how much memory and how many cores a website needs), Redis if there is one, and the app's worker processes multiplied by the memory of one process. That figure is read on a running server in htop or ps (the RSS column) and multiplied by the number of processes.
PHP and Laravel: PHP-FPM and queue workers
PHP-FPM keeps a pool of processes. Per the PHP documentation, pm.max_children sets their maximum number and with it how many requests are served at once, so it is chosen so that all processes fit into free memory. pm.max_requests respawns a process after a set number of requests and protects against memory leaks in third-party libraries. Laravel queues run as separate queue:work processes: the Laravel documentation advises keeping them under Supervisor, where numprocs sets the number of workers. A worker keeps the booted app in memory and does not see new code, so a deploy needs php artisan queue:restart, and --memory, --max-jobs and --max-time help cap memory growth. The VPS for Laravel selection (2 cores, 2 GB, NVMe, API) has 2,776 plans from 204 hosts, starting at $13.16. Schedules and queues are covered in more detail in scheduled tasks on a VPS.
Python and Django: Gunicorn workers
Gunicorn runs the app in several worker processes. The Gunicorn documentation advises starting with the formula «2 × CPU cores + 1» and adjusting under load: 4–12 workers usually handle even heavy traffic, and extra ones only waste resources. On 2 cores that is 5 workers — 5 copies of the app in memory. Threads (the gthread worker) share a process's memory and cost less. For scripts and one-off jobs there is the VPS for Python selection with hourly billing: 4,431 plans, starting at $5.93.
Node.js: one thread and a cluster
Node.js runs code in one thread, so one app loads one core. To use several cores you run several processes — with the cluster module (per the Node.js documentation they share one port) or in PM2's cluster mode. Each process's memory counts separately. The VPS for Node.js selection (1 GB+, 20 GB disk, KVM) has 31,060 plans, starting at $9.97.
What to start with
NVMe VPS: 2 cores and 2 GB — 668 plans, median $11.88; 2 cores and 4 GB — 1,960 plans, median $17.98 ($18 in Russia, $17.63 in Europe); 4 cores and 8 GB — 1,815 plans, median $35.32. Start with 2 GB when the database and Redis are small; move to 4 GB when the app processes and the database buffer stop fitting — swap use and the OOM killer in the log are the sign. Apps in Docker need KVM (Docker on a VPS), and deploying without downtime is covered in zero-downtime updates.