This repository contains the necessary information and tools to benchmark the performance of Nginx Unit and PHP FPM, two popular technologies for serving PHP applications.
Before proceeding with the benchmark, ensure that you have the following requirements in place:
- Nginx Unit - Install and configure Nginx Unit on your server.
- PHP FPM - Install and configure PHP FPM on your server.
- Yandex.Tank - Install Yandex.Tank for load testing.
- Overload - Install Overload for plotting benchmark results.
- Telegraf - Install Telegraf to collect resource usage statistics.
for nginx-php-fpm
cd nginx-php-fpm && docker-compose up
for nginx-unit-php
cd nginx-unit-php && docker-compose up
To benchmark Nginx Unit vs PHP FPM, follow these steps:
-
Configuration: Update the configuration files according to your server setup. Modify the Nginx Unit and PHP FPM configurations to reflect your application's settings.
-
Load Testing: Use Yandex.Tank to simulate concurrent requests and measure the performance of Nginx Unit and PHP FPM. Customize the load test scenarios and parameters in the
test.yaml
configuration file. -
Resource Monitoring: Configure Telegraf to collect resource usage statistics during the load test. Adjust the Telegraf configuration file to monitor CPU, memory, disk, or other relevant metrics.
-
Benchmark Execution: Execute the load tests using Yandex.Tank and collect resource usage data with Telegraf. Save the benchmark results and resource statistics.
-
Graph Generation: Use Overload to generate graphs based on the benchmark results and resource usage data collected during the load tests. Customize the graph generation options to suit your visualization requirements.
-
Analysis and Optimization: Analyze the benchmark results and graphs to gain insights into the performance of Nginx Unit and PHP FPM. Identify any bottlenecks or areas for optimization. Make necessary adjustments to the server configurations, PHP settings, or code optimizations.
The repository structure is organized as follows:
config/
: Contains the configuration files for Nginx Unit and PHP FPM.load-tests/
: Includes the Yandex.Tank configuration file (test.yaml
) and any additional ammunition files for load testing.reports/
: The directory where the benchmark results and resource usage statistics are saved.graphs/
: The directory where Overload generates the graphs based on the benchmark results.
This repository is licensed under the MIT License.