From a couple of weeks for one of my test server I upgraded Apache2 MPM bringing it from version "Prefork" to "Worker". I decided to do this test after reading some interesting posts that described a significant improvement in performance of WordPress after performing this update. The trial confirmed everything on the server in question - which no longer turns a flaming "Lenny" - I could record a net reduction in the load average during the enforcement of a large number of PHP5 FastCGI processes generated by concurrent calls WordPress, a sort of home banchwork obtained with simple PHP scripts produced themselves.

I explain quickly what constitutes the difference between the two versions of Apache, at least on issues that affect the performance of WordPress then: while the version is usually considered standard - called "Prefork" - uses a Multi-Processing Module based on the processes, the version of "workers" instead of using threads. The model "Prefork" manages a process for each connection, while the "Worker" runs a process for each group of threads and a thread for each connection. In this way, the version of "Worker" Apache2 tend to use less memory and to better distribute the calls to the processor directing them to the greatest number of cores - for this reason we tend to consider "Worker" more suitable for multicore servers, meaning that is on those who can measure the most significant performance improvements.

Beware though, the price payable may be considerably daunting for many of you can run PHP5 and mod_fcgid only way you will be forced to give up mod_php5 Apache! Think twice before so this type of operation.

The way I usually configure my server, the transition from "Prefork" to "Worker" in my case was a single command:

aptitude install apache2-mpm-worker

Aptitude immediately warned me that installing this package would lead to the removal of libapache2-mod-php5:

# aptitude install apache2-mpm-worker
Lettura della lista dei pacchetti in corso... Fatto
Generazione dell'albero delle dipendenze in corso
Lettura informazioni sullo stato... Fatto
Lettura delle informazioni sullo stato esteso
Inizializzazione dello stato dei pacchetti... Fatto
Lettura delle descrizioni dei task... Fatto
I seguenti pacchetti sono DIFETTOSI:
libapache2-mod-php5
I seguenti pacchetti NUOVI (NEW) saranno installati:
apache2-mpm-worker
I seguenti pacchetti saranno RIMOSSI:
apache2-mpm-prefork{a}
0 pacchetti aggiornati, 1 installati, 1 da rimuovere e 0 non aggiornati.
È necessario prelevare 0B/242kB di archivi. Dopo l'estrazione, verranno occupati 8192B.
I seguenti pacchetti hanno dipendenze non soddisfatte:
libapache2-mod-php5: Dipende: apache2-mpm-prefork (> 2.0.52) ma non è installabile o
apache2-mpm-itk ma non è installabile
Le seguenti azioni permetteranno di soddisfare queste dipendenze:
Rimuovere i seguenti pacchetti:
libapache2-mod-php5
Il punteggio è 119

If you decide to proceed - I repeat: to permanently renouncing mod_php5! - The installation will happen in a few seconds, usually with the final restart apache using:

/etc/init.d/apache2 restart

From this point on, you just have to enjoy the superb performance of Apache2 MPM "Worker".