Performance Comparison Between Nginx + PHP and Apache + PHP
The test tool http_load has the same dynamic page for testing. With the same hardware resources, nginx + php has worse performance than apache + php and has the same concurrency and number of requests, in addition, if the request pressure is greater than the capacity of hardware resources, nginx + php will return a 502 status page in some requests, which means that the website is down (in the user's opinion), but apache will not, it's just that it takes a long time to open the website (also for Users)
Test result diagram of Nginx + PHP:
Test results of Apache + PHP:
Add nginx cache function to nginx + php
More than 4 times better than apache + php
Fetches/sec server requests per second
The time when msecs/connect requests call fees are completed.
Summary: When the hardware resources meet the requirements, apache + php is used because of its super stability. Of course, nginx + php is also good, and the hardware resources are insufficient. In addition, we want to solve the current website access pressure,
Nginx + php is a good choice
For more Nginx tutorials, see the following:
Deployment of Nginx + MySQL + PHP in CentOS 6.2
Build a WEB server using Nginx
Build a Web server based on Linux6.3 + Nginx1.2 + PHP5 + MySQL5.5
Performance Tuning for Nginx in CentOS 6.3
Configure Nginx to load the ngx_pagespeed module in CentOS 6.3
Install and configure Nginx + Pcre + php-fpm in CentOS 6.4
Nginx installation and configuration instructions
Nginx log filtering using ngx_log_if does not record specific logs
Nginx details: click here
Nginx: click here
This article permanently updates the link address: