AboutBlogContact
DevOps & InfrastructureJune 18, 2002 2 min read 121Updated: June 22, 2026

Apache 2.0: Prefork vs. Worker MPM (2002)

AunimedaAunimeda
📋 Table of Contents

Apache 2.0: Prefork vs. Worker MPM

Apache 2.0 has finally moved to a modular architecture for handling requests, known as Multi-Processing Modules (MPMs). For those of us on Linux and Solaris, the choice comes down to prefork or worker. Choosing wrong can lead to either a crashed server or a very slow one.

The Case for Prefork (The Safe Bet)

prefork is essentially the Apache 1.3 model. Each connection gets its own process.

  • Pros: Completely thread-safe. If one request crashes a PHP module, only that process dies.
  • Cons: Memory intensive. If you have 500 concurrent users, you have 500 copies of Apache and PHP in RAM.

If you are using legacy PHP modules or anything that isn't explicitly thread-safe (like some older GD or IMAP libs), stay with prefork.

The Case for Worker (The Performance Play)

worker uses a hybrid model: a few processes, each with many threads.

  • Pros: Massive memory savings. Threads share memory, allowing you to handle thousands of connections on a modest server.
  • Cons: One bad thread can take down the entire process (and all its threads). Everything must be thread-safe.

Benchmarking on Solaris

On Solaris, threads are "first-class citizens," and the worker MPM shines. On Linux 2.4, the "LinuxThreads" implementation is okay, but prefork still often wins in stability. However, with Linux 2.6 on the horizon and the New POSIX Threads Library (NPTL), worker is expected to become the king.

# httpd.conf - Worker Tuning
<IfModule worker.c>
    StartServers         2
    MaxClients         150
    MinSpareThreads     25
    MaxSpareThreads     75 
    ThreadsPerChild     25
    MaxRequestsPerChild  0
</IfModule>

If you're building a static asset server or using a thread-safe language like Java (via mod_jk), worker is a no-brainer. If you're a PHP shop, keep an eye on your extensions before making the jump.


Aunimeda provides DevOps engineering and infrastructure services - CI/CD pipelines, containerization, cloud deployments, and monitoring setups.

Contact us to discuss your infrastructure needs. See also: DevOps Services, Custom Software Development

Read Also

Kafka: Zero-Copy and Why It's Fast (2015)aunimeda
DevOps & Infrastructure

Kafka: Zero-Copy and Why It's Fast (2015)

How does Kafka push gigabits of data on commodity hardware? The secret isn't in the code; it's in the Linux kernel's sendfile() call.

The 2008 Scaling Crisis: Caching at the Edge with Memcachedaunimeda
DevOps & Infrastructure

The 2008 Scaling Crisis: Caching at the Edge with Memcached

Your database is the bottleneck. In 2008, if you're hitting your MySQL server for every user profile, you're not scaling. It's time to offload the heavy lifting to a distributed memory pool.

Memcached: Slab Allocation Internals (2007)aunimeda
DevOps & Infrastructure

Memcached: Slab Allocation Internals (2007)

Why is your cache server swapping? It's probably memory fragmentation. Let's look at how Memcached solves this with slabs.

Need IT development for your business?

We build websites, mobile apps and AI solutions. Free consultation.

DevOps Services

Get Consultation All articles