Skip to the content
Documentation
Help Start
Reading in:
  • German: 9,059 of 9,059 pages
About the help in other languages
All help pages

Sizing memory, CPU and disk

The memory, CPU and disk figures the Exponential repository actually states (PHP memory limits, Velocity workers, OPcache, APCu, SQLite page cache, MongoDB, disk health thresholds, log rotation), what grows on disk, and…

Download as PDF

Address: https://doc.exponential.earth/learninminutes/exphelp/viewer/help/hosting/basics/sizing-memory-cpu-and-disk.md

On this page

Sizing memory, CPU and disk

This page is for system administrators and product managers at a hosting company who size servers and plans for Exponential sites. It answers: which figures the project's documentation and settings actually give, what consumes memory, CPU and disk on a running site, and how to measure a real site. It gives no figures the repository does not state; chapter 2.10 says the same: "The documentation gives few hard numbers, and this book does not invent others."

Contents

  1. The figures the repository gives
  2. Memory
  3. CPU
  4. Disk
  5. Measure, do not guess
  6. Turning measurements into plans
  7. Checklist
  8. Related pages

The figures the repository gives

ItemValueSource
PHP memory_limit, installer floor64Msettings/setup.ini, [memory_limit] MinMemoryLimit
PHP memory_limit, health checkbelow 128M a failure, below 256M a warningSystem information
PHP memory_limit under FrankenPHP512M shippedsettings/velocity.ini, [FrankenPHPSettings] IniOptions[]
One Velocity workerabout 10 MB of private memory (measured)settings/velocity.ini; Velocity web server
Velocity poolWorkers=4 shipped; the engine's own default is what fits in RAM, at most 8 per core and 64, never fewer than 4settings/velocity.ini, chapter 2.10
OPcachememory_consumption=256, max_accelerated_files=20000, interned_strings_buffer=32chapter 10.12 and velocity.ini [PHPSettings]
APCu for Velocityapc.shm_size=256M (reserved, not used, until it fills)velocity.ini [PHPSettings]
SQLite page cacheup to 64 MB per process that opened the database; 256 MB memory mapDatabase support
SQLite VACUUMabout twice the database's size in free diskchapter 9.2
A MongoDB installationRAM 512 MB minimum, 2 GB recommended; disk 2 GB minimum, 10 GB recommendedporting reference, section 24.1
Free disk, health checkunder 1 GB or 5 % a failure; under 5 GB or 10 % a warningSystem information
Log rotationeach log rotated at LogFileMaxSize=2097152 (2 MB), LogFileRotateCount=3 keptsettings/site.ini, [FileSettings]
A kernel clone with historyabout 370 MBchapter 3.2

Memory

What uses memory on a server running Exponential sites:

  • PHP processes. Each PHP-FPM child or Velocity worker up to its memory_limit at peak; package installs, imports and image work need the most. Plan pool sizes so that the busiest moment fits (PHP-FPM tuning).
  • Velocity workers hold about 10 MB of private memory each from the moment they are forked, idle or not. With SpareWorkers the pool keeps only that many when quiet and grows to Workers under load, retiring idle workers after IdleWorkerTimeout seconds.
  • Shared caches. OPcache (opcache.memory_consumption) and APCu (apc.shm_size) reserve shared memory. PHP-FPM takes them from its php.ini; Velocity sets its own in velocity.ini [PHPSettings] IniOptions[], because the command-line default for APCu is 32 MB, too small for its response cache and the SQL query cache together.
  • The database. SQLite's page cache counts per process that used it: SQLitePragmas[]=cache_size=-16384 lowers it to 16 MB, which helps on servers with many small SQLite sites. Database servers need their own sizing.
  • Optional services. Solr, Valkey or Redis, if a plan includes them.

Note

Read Velocity's memory as its control panel shows it: the proportional set size (PSS) of the parent and its workers. The resident set size (RSS) of each forked worker counts the memory they share again and again, and adds up to far more than the machine really uses (chapter 2.10).

CPU

  • Cached pages cost little. Velocity's response cache answers anonymous visitors in the server process without a worker. settings/velocity.ini records a measurement: one server answers cached pages at about 0.3 ms of CPU each, about 3,500 a second on a 12-core machine; with Instances above 1 the kernel spreads connections across servers (two measured 6,600 to 6,900, four 12,200 to 13,100). Renders are bounded by the workers, not by this.
  • Rendered pages (first views after a clear, signed-in editors, search) are where CPU goes. Keep the content view cache and template-block cache on (both shipped), and leave the static cache off (chapter 10.12).
  • OPcache matters. Under Velocity, opcache.file_update_protection above 0 made a render take about four times the CPU it takes under PHP-FPM; the shipped velocity.ini sets it to 0 (Velocity opcode cache).
  • FrankenPHP threads default to twice the CPU cores when [FrankenPHPSettings] Workers is empty.
  • Cron and image work add bursts: image variations are generated on first use, and the cronjobs run on schedule.

Disk

What growsWhereHow to keep it in check
Uploaded files and image variationsvar/storage (per site var/<site>/storage)grows with content; the main factor of a plan's disk
Cachesvar/cache (per site var/<site>/cache)cleared and rebuilt; can live on a memory file system (multi-site paths)
Logsvar/log, var/vc/ for Velocityrotation (LogFileMaxSize, LogFileRotateCount, LogFileCompress), plus the system's logrotate for cron logs
The SQLite databasevar/storage/sqlite3/room for the database twice over, for VACUUM and backups
Backupsoff the machine, ideallynever only on the same disk
Codethe installation, vendor/, extension clonesGit clones with history take more than archives

The disk check of the administration (Setup > System information) fails under 1 GB or 5 % free and warns under 5 GB or 10 %; use the same thresholds in your monitoring. See also the disk full runbook.

Measure, do not guess

php bin/php/console exp:benchmark --save=var/benchmark/base.json --allow-root-user
php bin/php/console exp:benchmark kernel --repeat=30 --allow-root-user
php bin/php/console exp:system:info --json --allow-root-user
du -sh var/storage var/cache var/log

exp:benchmark requests the front page, menu pages, the search page and the admin login page and prints median, p90 and p99; it is polite by default against other hosts (Benchmarking). exp:system:info prints the facts and health checks of Setup > System information (memory limit, OPcache and APCu, disk, machine memory and load). Velocity's control panel shows the memory of the pool.

Tip

Build a reference site from your most common plan, measure it with these commands on your hardware, and size from that. A figure measured on your own servers is worth more than any rule of thumb.

Turning measurements into plans

The repository gives no plan sizes and no prices; these are the dimensions a host can choose to put limits on, each measurable with the commands above:

DimensionMeasured with
Disk for var/storagedu -sh var/storage
PHP memory per processmemory_limit and the pool's peak
Number of PHP workersthe pool size or Velocity's Workers
Database sizeSetup > System information, Database card
Upload sizeupload_max_filesize, post_max_size

Checklist

  • To do: memory_limit 256M or more for production pools.
  • To do: Velocity's Workers set explicitly; SpareWorkers considered on busy multi-site servers.
  • To do: OPcache and APCu sizes set for PHP-FPM and for Velocity separately.
  • To do: Velocity memory read as PSS.
  • To do: Disk monitoring at the System information thresholds.
  • To do: A reference site benchmarked on your own hardware.

Become an Exponential Partner

Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.

Something wrong on this page? Report an error

Documentation license

This documentation is free documentation, licensed under the GNU Free Documentation License 1.3 or later.

Exponential Copyright © 1998-2026 Exponential Foundation and 7x