Apache 2.4 Prefork vs. PHP-FPM Event shows sig decrease in requests per second

Posted by Mark on Server Fault See other posts from Server Fault or by Mark
Published on 2012-10-25T04:27:16Z Indexed on 2012/10/25 5:06 UTC
Read the original article Hit count: 457

Filed under:
|
|

On my Apache 2.4.2 server with a standard mod_php Prefork setup these are my server-status results

Current Time: Wednesday, 24-Oct-2012 19:36:24 CDT
Restart Time: Wednesday, 24-Oct-2012 01:27:30 CDT
Parent Server Config. Generation: 1
Parent Server MPM Generation: 0
Server uptime: 18 hours 8 minutes 54 seconds
Total accesses: 14304233 - Total Traffic: 342.3 GB
CPU Usage: u12584.6 s721.93 cu.66 cs3.43 - 20.4% CPU load
219 requests/sec - 5.4 MB/second - 25.1 kB/request
507 requests currently being processed, 355 idle workers
______KKKKR_K______W_KKC___CKK_K_K_W__CC_KKK_KK._K_K_KK._KKKK_K_
K_____KK_KKKK_K_KK__K___KK_K___K_____CKKK_WK_K_____KCKK__K___K_K
K_CK_K_K_____K__KKKK_K__K___K_KK_K_K_KKKCK____________KK_CK__KKK
__C_KKKKKKK___CK___C_KKK_K__C__K_CK____KKK__K__K__K_K__KK_CK_K__
_KKKKK_K_W__KK______K___K__W___C_K__K____KKKKKKKK.KKKKKKKCK_K___
_C_KK_K_WK__K_KK__K__RK_KK___K____K_KK_K_K___RKC_KKKK___KKKC_K_W
_C_KK_KK__W____KC__KKK__KKK___K___KKK_KK_K_KKW__K_KR_KK_KK__KKK_
R__KKK__KKKKKK__K_KKKKK_K__K_K___KKW_________KK_K___KKK___KK.K_C
KKKKKKW_____K__K_KKC_KCKK_K_KK_K__KK__K___K__KK_KK__________KK__
__K___KK_K__K_C_KK_K___KK__KK__K__KCK_K__KK_________K_K_KK__.K__
K_CKK.CCRW__KKKKKKKKKKKC__W____K___KWK_KK_KKC______.K_K_KK_KKKC_
__KKK_W_KCKKK_K_K____CCCK__KC_KKKK_K____K_CK_K____K__K____KKK_KK
KK___K_K_K__KW__KCKKKK____WKWK__K_KKRKK__C_K_KK_KK_K__KKCC_K__C_
KK_K___K_KK______K_____CKK_K_______KK_CKCK__KKKKK____K__K..K____
__KKWK_KW__KKK__K_KKK___K_KK_KKK__KK___KK___KK_KK___KK____KKWKKC
KK_KKKK_................................`

When I switch to a PHP-FPM setup with the Event MPM with no other variables changes, my requests/sec plummet and overall apache response is garbage.

Current Time: Wednesday, 24-Oct-2012 19:51:21 CDT
Restart Time: Wednesday, 24-Oct-2012 19:48:03 CDT
Parent Server Config. Generation: 1
Parent Server MPM Generation: 0
Server uptime: 3 minutes 18 seconds
Total accesses: 18720 - Total Traffic: 307.1 MB
CPU Usage: u16.57 s4.74 cu0 cs0 - 10.8% CPU load
94.5 requests/sec - 1.6 MB/second - 16.8 kB/request
15 requests currently being processed, 49 idle workers
PID Connections Threads Async connections
total   accepting   busy    idle    writing keep-alive  closing
11701   114 no  10  22  0   66  38
11702   134 no  5   27  0   81  48
Sum 248     15  49  0   147 86
__R_R__W___RRW________RR__R___W_W_______W_____W_____________R_R_

Is there any obvious reason anyone could think of why this would be the case. I can provide any other additional stats or server setup info to help out. Ive tried tweaking everything up and down and nothing really helps get the PHP-FPM setup anywhere near a baseic prefork/mod-php setup.

Thanks!

© Server Fault or respective owner

Related posts about apache2

Related posts about php-fpm