Hacker News new | ask | show | jobs
by watermelon0 1877 days ago
I think that Apache2 + mod_php (or modules for other runtimes) doesn't measurably impact most web applications, and this setup is a bit simpler, since you only need to run and configure Apache, instead of Nginx + PHP-FPM. If you are working with containers, it means that you only need one container, instead of two (if you go with the idea that container should only do one thing.)

Additionally, if you are behind CDN or just plain Varnish, static assets would only be hit once or twice, and majority of the requests would be processed by PHP anyways, so there is no benefit in putting additional pipe between proxy (Nginx) and PHP interpreter (FPM). Especially with smaller page responses, Apache can easily win, since it doesn't have to communicate with an external process.

1 comments

Raw performance is only one aspect. Splitting up the processes means that a security exploit in one component has basically no way of endangering the other. In a shared hosting environment, you can also run separate fpm processes for each tenant, allowing for custom configuration and even different versions altogether for each.