Apache · Configuration and operations
What are Apache MPMs and how do prefork, worker and event differ?
Short answer
An MPM is the Multi-Processing Module that controls how Apache accepts connections and schedules work. Prefork uses one process per request, worker uses threaded processes, and event adds asynchronous handling for idle keep-alive connections.
Exactly one MPM is active per server. It is loaded like any other module, for example mod_mpm_event.so, and it defines the directives that tune capacity: ServerLimit, StartServers, ThreadsPerChild and MaxRequestWorkers.
- prefork: one single-threaded child process per connection, isolated but memory-hungry and incompatible with thread-unsafe modules
- worker: multiple processes, each running many threads, lower memory per connection than prefork
- event: worker-style threads plus a listener that handles idle keep-alive connections asynchronously, usually the best default for busy TLS sites
- winnt: the Windows-specific MPM
LoadModule mpm_event_module modules/mod_mpm_event.so
<IfModule mpm_event_module>
StartServers 3
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxRequestWorkers 400
MaxConnectionsPerChild 0
</IfModule>How to choose
Use event unless a required module is not thread-safe. Legacy mod_php is the classic reason people still pin prefork. With PHP-FPM, event works well because PHP runs outside the Apache process. Prefork remains useful for isolated, process-based handlers and for debugging, but it scales poorly with keep-alive traffic.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1Why is event MPM better for keep-alive connections?
- 2When would you still use prefork?
- 3How do you check which MPM is active?
- 4What happens if you load two MPMs at once?
Say it in the interview
The MPM is Apache's concurrency engine. Prefork gives each connection its own process, which is isolated but expensive, while worker uses threads inside processes. Event keeps worker threads but handles idle keep-alive sockets asynchronously, so a thread is not tied up waiting. I default to event and only choose prefork when a module is not thread-safe, such as legacy mod_php.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Apache mock interview and get scored feedback on depth, clarity and confidence.