Updated: 28 September 2026 · Applies to: Apache 2.4 with PHP-FPM

Apache 2.4 performs well when configured for your traffic and memory. These settings apply to current Apache versions (the old prefork-only advice for Apache 2.2 is out of date).

1. Use the event MPM with PHP-FPM

Run PHP through PHP-FPM and use mpm_event instead of mpm_prefork with mod_php. On Ubuntu/Debian: a2dismod php8.3 mpm_prefork && a2enmod mpm_event proxy_fcgi setenvif && a2enconf php8.3-fpm.

2. Size the workers to your RAM

<IfModule mpm_event_module>
    StartServers            2
    ServerLimit             16
    ThreadsPerChild         25
    MaxRequestWorkers      400
    MaxConnectionsPerChild  10000
</IfModule>

Set PHP-FPM's pm.max_children to (RAM available for PHP) ÷ (average PHP process size, often 50 to 100 MB).

3. Keep-alive, compression and caching

  • KeepAlive On with KeepAliveTimeout 5.
  • Enable mod_deflate (or Brotli) for text files.
  • Set long cache lifetimes for static files with mod_expires.
  • Turn off modules you do not use.

4. Measure

Watch /server-status (mod_status, restricted to your IP) and test with a load tool before and after changes.

Prefer not to do it yourself? Our engineers can set this up on your Ucartz VPS or dedicated server as a paid task.

Related services

KVM VPS hosting

NVMe SSD and full root access, with Free Basic Managed Support.

Managed cPanel VPS

cPanel included; we handle updates, security and monitoring.

Server management

on-demand administration, hardening, migrations and monitoring.

Was this answer helpful?

Still stuck? Open a ticket