Prefork MPM or worker MPM

From Django In Production

Jump to: navigation, search

This question comes up because there is some debate over the issue of using Django in a multi-threaded environment. In terms of Apache this comes down to a choice of using the single threaded prefork MPM or the multi-threaded worker MPM.

The official Django documentation recommends running the prefork MPM, thought without much explanation. For example, the 'winnt' MPM on Windows is multi-threaded, but no mention is made of Django being unsuitable to run on Windows. There are also instructions for running Django with FastCGI in a multi-threaded configuration without mention that it may cause problems.

The Django core dev team haven't been very forthcoming with information on this issue, so the bottom line is that it is probably most advisable to run Django on a single threaded configuration. In terms of Apache, this means sticking to the prefork MPM for now.

Multithreaded Django

Personal tools