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

Performance and scaling

How the load of an Exponential site reaches its database and how to scale it - the cache layers that keep most requests away, what still reaches the database, persistent connections and Velocity's persistent workers…

Download as PDF

Address: https://doc.exponential.earth/exphelp/viewer/help/database-administrators/performance-and-scaling.md

On this page

Performance and scaling

This page is for database administrators who size the database of an Exponential site or look for the reason it is slow. It answers: how much of the traffic reaches the database at all, what does, and which levers help each engine. Sources: Database support, performance and scaling, What carries the read load and 10.12 Performance tuning.

Contents

  1. Most requests never reach the database
  2. What does reach it
  3. Connections and workers
  4. Per engine
  5. The levers, in order
  6. Checklist

Most requests never reach the database

LayerSettingWhat a hit costs
Velocity response cachesettings/velocity.ini [CacheSettings] Enabled=enabled, DefaultTtl=30answered by Velocity's parent process: no PHP worker, no database; anonymous visitors only
Content view cachesite.ini [ContentSettings] ViewCaching=enabledthe main area of a page from a file
Template-block cachesite.ini [TemplateSettings] TemplateCache=enabledmenus and footers from files
SQL query cachequerycache.ini Mode=off by defaulta repeated SELECT from APCu or a file; not on MongoDB (The SQL query cache)
Operating system file cachedatabase pages from memory after the first read

The static cache ([ContentSettings] StaticCache) is disabled in the shipped installer and should stay off: with it on, every publish regenerated the affected pages over HTTP inside the editor's request.

What does reach it

  • the first views after a cache clear or a publish;
  • signed-in editors and the administration;
  • search (the built-in engine reads ezsearch_*);
  • publishing, workflows, cronjobs, imports.

Size the database for these, not for the total page views. After a deploy that clears caches, expect a short burst (the warm-up); exp:preload warms a site's pages on purpose (Preloading caches).

Connections and workers

  • Under PHP-FPM each worker opens its own connection when a request needs one. UsePersistentConnection=enabled keeps it for the life of the worker (MySQL, PostgreSQL, Oracle).
  • Under Velocity with persistent workers (settings/velocity.ini [ServerSettings] ForkPerRequest=disabled, the shipped value) each worker keeps the application, its connection and its caches warm. The pool size is [ServerSettings] Workers (shipped 4), optionally dynamic with SpareWorkers and IdleWorkerTimeout (Velocity workers and pools).
  • Count the connections: PHP-FPM workers plus Velocity workers plus cron and console processes, per site, against the server's limit (max_connections on MySQL and PostgreSQL, sessions or a DRCP pool on Oracle).

Per engine

EngineLevers
SQLitereads scale with the number of processes; writes queue. Count up to 64 MB of page cache per process that opened the database (SQLitePragmas[]=cache_size=-16384 lowers it to 16 MB). ANALYZE after imports (SQLite maintenance)
PostgreSQLrow-level locking; persistent connections; your usual shared_buffers and autovacuum tuning; replication is external
MariaDB, MySQLInnoDB row locking; persistent connections; innodb_buffer_pool_size sized for the working set; read replicas with UseSlaveServer (Read replicas)
MongoDBperformance follows the number of statements per page; create the indexes from bin/mongodb/create_indexes.js, without which subtree queries and URL alias lookups scan whole collections
Oraclea new dedicated session costs tens of milliseconds: Persistent=enabled and DRCP; the Prefetch settings; statistics with gather-stats (Oracle tuning)

Server parameters such as buffer pools are your engine's own; Exponential does not set or require particular values.

The levers, in order

  1. Caches on: view cache, template-block cache, Velocity's response cache; check them in Setup > System information, card Caches.
  2. Statistics current: ANALYZE (SQLite, PostgreSQL), gather-stats (Oracle); MongoDB indexes created.
  3. Find the statements: Finding slow queries; fix repeated queries at their source.
  4. Query cache request, then shared.
  5. Persistent connections or Velocity's persistent workers.
  6. Replicas for MySQL and MariaDB; a bigger server or another engine when writes queue (Choosing an engine).

Measure each step with exp:benchmark --save and --baseline (Benchmark).

Checklist

  • To do: Caches enabled; static cache off.
  • To do: Connection count of all workers below the server's limit.
  • To do: SQLite memory sized for cache_size per worker.
  • To do: Statistics and indexes current.
  • To do: Every change measured before and after.

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