I'm a little confused between the different MPMs offered by Apache - 'worker', 'event', 'prefork', etc.
What are the major differences between them, and how can I decide which one will be best for a given deployment?
|
I'm a little confused between the different MPMs offered by Apache - 'worker', 'event', 'prefork', etc. What are the major differences between them, and how can I decide which one will be best for a given deployment? |
|||||||||||||||||||||
|
|
There are a number of MPM modules (Multi-Processing Modules), but by far the most widely used (at least on *nix platforms) are the three main ones:
|
|
|||
|
|||
|
|
Canonical indeed. Similar questions have been asked but I don't recall it ever being answered so well.
– John Gardeniers
Apr 27 '12 at 3:55
|
||
|
-1: IME, worker only reduces the size of the httpd footprint by in the region of 15% (IIRC Linux reports COW in RSS which makes pre-fork look as if it using much more memory than it does). There's negligible difference between the kernel footprint for a process and an NPTL thread. It's a long way from earth-shattering. I don't understand why you think that waiting for and allocating a thread is more efficient in scheduling terms than waiting for / scheduling a (pre-forked) process. Nor what bearing you think SSL has on the whole she-bang.
– symcbean
Apr 27 '12 at 8:28
|
||
|
@symcbean So you're saying that 15% RAM usage isn't significant? That's fine, but my opinion would be otherwise. Concurrency performance claims are not my own. See here. And the SSL difference is spelled out plainly in the documentation for the event MPM:
The improved connection handling does not yet work for certain connection filters, in particular SSL. For SSL connections, this MPM will fall back to the behaviour of the worker MPM and reserve one worker thread per connection.
– Shane Madden♦
Apr 27 '12 at 16:23
|
|
Mostly depends on which Apache modules you want to use. I think worker is generally the default choice, but some (older) modules require forking and depend on prefork. If you have no preferences, I recommend you go with the preferred dependency from your OS distribution. Ubuntu for example will by default install mpm-worker when you install Apache2. |
|||
|
|