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

Scaling and clustering

How an Exponential site scales - up on one machine with Velocity and caches, and out to several web nodes - with what must be shared (database, files, sessions), what stays per node (caches, logs, workers), the DFS…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/software-engineers/scaling-and-clustering.md

On this page

Scaling and clustering

This page is for engineers who plan capacity or a high-availability setup. The operator's guide, with a checklist, is Several web nodes; the cluster file handler is described in Clustering and shared storage.

Contents

  1. Scale up first
  2. Scaling out: what must be shared
  3. Files: the cluster file handler
  4. Sessions
  5. Database scaling
  6. The edge: load balancer and proxies
  7. Operations across nodes
  8. Limits

Scale up first

A single machine with enough CPU and memory is the simpler choice for most sites. Before adding nodes:

  1. Serve with Velocity and its response cache for anonymous traffic (Application servers).
  2. Switch on the caches that fit the traffic: the role-aware HTTP cache for signed-in pages, the SQL query cache for what cannot be stored whole (Caching layers for engineers).
  3. Size the worker pool by PSS, not RSS (Velocity persistent workers).
  4. Measure (Performance measurement and benchmarks).

Scale out when one machine is not enough, or when a node must be able to fail without taking the site down.

Scaling out: what must be shared

PartShared or localHow
Databaseshareda database server; every supported engine except SQLite
Uploaded files (var/storage)sharedthe DFS cluster file handler and an NFS mount
Code, settings, extensions, designsidentical on every nodethe same deployment on each node
Sessionsshared, or the user kept on one nodethe database session handler, or sticky sessions
Cacheslocal per node, kept in stepthe cluster handler, or Redis or Valkey
Logslocal per nodecollect centrally if you need one view
Cronjobsone noderun the crontab on one node only

Do not put the whole var/ directory on a network share for all nodes; the cluster handler keeps the nodes in step itself.

Files: the cluster file handler

Every cache and storage file is written through eZClusterFileHandler. The shipped handler is eZFSFileHandler (local files); for several nodes it is eZDFSFileHandler (kernel/private/classes/clusterfilehandlers/): files on a shared NFS export, their metadata in a database table, cache files copied to each node. bin/php/clusterize.php moves an installation's files into the cluster. Code that writes files directly instead of through the handler breaks clustering; reviews should catch it (Code review checklist).

Sessions

site.ini [Session] Handler decides where sessions live: empty (the default, ezpSessionHandlerPHP) keeps them in PHP's storage on each node; ezpSessionHandlerDB keeps them in the ezsession table, visible to every node (Sessions).

Database scaling

  • SQLite cannot serve several machines: all processes must be on one machine.
  • On MySQL or MariaDB, site.ini [DatabaseSettings] UseSlaveServer sends read queries to replicas (shipped disabled) (Database support, Performance and scaling).
  • PostgreSQL brings replication and point-in-time recovery of its own.

The edge: load balancer and proxies

Behind a load balancer the kernel sees the balancer's address. List it in site.ini [HTTPHeaderSettings] TrustedProxies[], or forwarded headers (X-Forwarded-For, X-Forwarded-Proto, X-Forwarded-Host) are ignored and HTTPS detection, client addresses, the sign-in lockout and the audit log are wrong (Trusted proxies). Exponential sends no purges to a CDN or caching proxy; one that stores pages must be told what to store and for how long.

Operations across nodes

TaskAcross nodes
Deployexp:velocity deploy covers PHP-FPM and Velocity on one machine; deploy each node in turn
Cache clearclear on every node, or use a shared cache backend
Maintenance modethe switch is a file in var/; set it on every node
Logscollect them, or read them per node in the log viewer

Limits

  • No built-in purge for external proxies.
  • A schema change (exp:upgrade, exp:migration:migrate) is applied once, from one node; the installation lock keeps a second run from writing at the same time on that node only.
  • Per-node caches can briefly disagree after a change; plan the order of a deploy.

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