Memory requirements

Last updated on
9 February 2024

Drupal's memory requirements depend on which programs and tools are in use. PHP uses some memory, and if you also use Solr, Memcache, or similar programs, it all adds up. You probably need to run Composer commands occasionally, which require a certain amount of free memory. You can check the memory usage with a Unix command line tool such as htop or with the WebProfiler module.

  • Minimum RAM: 1 GB

Composer

Running a Composer command such as composer update used to require a lot of free memory (RAM). Luckily, this was improved in Composer 2, and much less memory is now required.

For a Drupal 10 installation with around 30 contrib modules, Composer may not use more than a maximum of 200 MB of RAM to successfully run composer update, but it is recommended to have at least 1 GB of free memory available, to be on the safe side.

To get an estimate of the memory required, you can run a benchmark test.

Note: Run first without COMPOSER_DISABLE_NETWORK=1 to allow local caches to get populated, and then with:

$ COMPOSER_DISABLE_NETWORK=1 composer update --dry-run --profile
[12.1MiB/0.07s] Loading composer repositories with package information
[...]
[23.3MiB/5.01s] No installed packages - skipping audit.
[23.2MiB/5.01s] Memory usage: 23.2MiB (peak: 194.72MiB), time: 5.01s

In the example above with 30 contrib modules in composer.json, Composer's memory usage maxed out at ~200 MB.

PHP

PHP memory requirements can vary significantly depending on the modules in use on your site. The minimum required memory size is 64 MB, typically 128 MB or 256 MB are found in production systems. For more, see PHP memory requirements.

Solr, Memcache, etc.

Memcache and Solr can require a lot of memory, depending on the amount of data. Check usage with htop or the WebProfiler module.

Help improve this page

Page status: No known problems

You can: