Which to install: Apache Worker or Prefork? What are the (dis-)advantages of each

apache-2.2mpm-preforkmpm-worker

Based on the descriptions for both the Prefork and Worker MPM, it seems the prefork type is somewhat outdated, but I can't really find a proper comparison of the two types.

What i'd like to know:

  • What are the differences between the two versions?
  • What are the (dis-)advantages of each server type?
  • Are there any basic guidelines on which type to choose based on the conditions?
  • Are there any big performance differences between the two?

Best Answer

As the docs say, you should use the prefork MPM if you need to avoid threading for compatibility with non-thread-safe libraries. Typically, any non-trivial Apache module (mod_php -- or, more precisely, the myriad of extensions and libraries that it links to -- being the canonical example) has some sort of non-thread-safe library (or has non-thread-safe code in it), so unless you're using a pretty stock Apache install, I'd go for the prefork MPM.

Related Topic