Welcome! Log In Create A New Profile

Advanced

Measuring PHP-FPM Outperforming Apache+mod_php

Posted by Zach Gardner 
Zach Gardner
Measuring PHP-FPM Outperforming Apache+mod_php
August 24, 2012 01:30AM
I'm interested in ditching Apache+mod_php for HAProxy+nginx+PHP-FPM. I've
read a lot on line of the performance advantages, so I decided to run some
experiments to verify the advantage.

I'm having trouble getting PHP-FPM to perform better than Apache. I'm on
Ubuntu 11.04 on VirtualBox. My www.conf is as follows:

pm = dynamic
pm.max_children = 10
pm.min_spare_servers = 2
pm.max_spare_servers = 4
pm.max_requests = 500


I tried to setup Apache with similar limits:
<IfModule mpm_prefork_module>
StartServers 5
MinSpareServers 5
MaxSpareServers 10
MaxClients 10
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_worker_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 10
MaxRequestsPerChild 0
</IfModule>
<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxClients 10
MaxRequestsPerChild 0
</IfModule>


Additional configs can be found here:
http://stackoverflow.com/questions/12056861/configuring-haproxynginxphp-fpm-to-out-perform-apachemod-php


If I configure both to have the same number of workers, I would think that
the performance advantage would shine through. Using both siege and ab,
Apache and PHP-FPM are giving nearly the same amount of max concurrent
users. 300 concurrent connections is around when I get socket full issues.
Load seems to be about the same.

Is there some utility I can run that helps identify any misconfigurations?
Am I not getting enough concurrent connections to see PHP-FPM shine through?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 246
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready