How much RAM does your VPS actually need? Numbers by workload
Disclosure: I'm Parth, I run Bigdomainhost, an Indian hosting company, and the price column below is our own plan list. The RAM numbers apply to any host. Almost every VPS gets bought one size too big or one size too small. Too small looks like WordPress, MySQL and a page builder squeezed into 2 GB, throwing "Error establishing a database connection" every few days. Too big looks like a 32 GB box…
Determining the appropriate amount of RAM for a VPS depends on the workload it will be handling. Typically, a VPS may be overspecified or underspecified. An underspecified VPS can lead to issues like "Error establishing a database connection" in WordPress, while an overspecified VPS can be wasteful. This article provides a method to calculate the ideal RAM size based on the specific workload.
A normal LAMP or LEMP server's RAM is used by components such as Ubuntu/AlmaLinux, MySQL/MariaDB, PHP-FPM, Nginx, Apache with mod_php, LiteSpeed, and Redis. The typical usage ranges for these components vary, with MySQL/MariaDB requiring 500 MB to 2 GB, PHP-FPM 40-120 MB per worker, Nginx 50-100 MB, Apache with mod_php needing more than Nginx, and Redis depending on the capped amount, usually between 256 MB to 2 GB. cPanel can consume around 1 GB before hosting a site.
Two factors can significantly impact a server's performance: PHP-FPM and MySQL's InnoDB buffer pool. PHP-FPM memory usage varies greatly depending on the workload; for instance, a WordPress site using Elementor could require a full gigabyte of RAM just for PHP-FPM workers. MySQL's InnoDB buffer pool should ideally hold the entire working data set in memory; otherwise, every query that misses the pool will result in disk access, leading to slow performance and the misconception of a "slow site."
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.