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 applications

Grow an Exponential application from one server to many - measure first, caches and Velocity workers, the database, background work, search on Solr, shared storage and clustering, and what each step costs.

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/creators/app-creators/scaling-applications.md

On this page

Scaling applications

This page is for application creators whose application must serve more users or more data. Scale in steps, measuring before each one: most sites never need more than the first three.

Contents

  1. Measure first
  2. The steps, in order
  3. Several web servers
  4. Application design that scales

Measure first

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

exp:benchmark gives median, p90 and p99 per page; kernel mode times boot, render, INI load, fetches and database round trips (Benchmarking, Profiling and performance).

The steps, in order

StepEffectRead
1. Caches on and keyed rightmost requests never renderCaching in applications
2. Velocity with its response cacheanonymous repeat requests answered without PHP; persistent workers keep the application warmVelocity response cache
3. Slow work out of requestsrequests stay fast under loadBackground work
4. The database tuned; query cachefewer and cheaper queriesDatabases, SQL query cache
5. Search on Solrsearch load off the databaseSearch with ezfind and Solr
6. Shared cache backendcontent and INI caches in Redis or Valkeysevenx_valkey_cache
7. Several web servershorizontal capacityClustering and shared storage

Velocity's worker pool and its dynamic sizing are set in velocity.ini (8.3.6 Workers).

Several web servers

Multiple web servers need: one database (or a cluster of it), shared file storage through the cluster file handler, the same code and settings on every server, sessions every server can read (the database session handler), a load balancer listed in TrustedProxies[], and cron and queue workers on one designated server (or locked).

Application design that scales

  • Every list paged and limited; counts with count queries.
  • No per-request work proportional to the size of the site (whole-tree fetches in the pagelayout).
  • Writes batched, transactions short.
  • Idempotent background jobs, so more workers do not mean duplicates.
  • Caches keyed by what changes, cleared by events rather than by time where possible.

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