By default, Plesk uses NGINX as a reverse proxy for Apache. But is this default configuration optimal? What impact does it have on performance? To answer these questions, I carried out load tests on a Hetzner VPS (8 AMD Epyc cores) to measure the impact of enabling NGINX as a reverse proxy on overall performance.
Contents
Context and configuration
As part of this benchmark, I compared server performance with NGINX enabled and disabled. I also tested NGINX cache activation (and that changes everything!).
Load tests were carried out using ApacheBench (ab), sending 5000 requests locally with a concurrency of 200 simultaneous requests. This ensured that the test lasted long enough to limit the margin of error. It should be noted that the test site is very light and high-performing compared with the average, with only 50 to 80ms TTFB (response time).
Here are the main configurations:
- Server 8-core Hetzner VPS (AMD Epyc)
- Web server Plesk 18.0.65 with Apache + NGINX as reverse proxy
- Test site : LRob.fr a WordPress FSE website, Twenty Twenty-Four theme with Breeze cache
- Test commands :
ab -n 5000 -c 200 https://www.lrob.fr/
NGINX configurations
Performance test results
Nginx | Total time for 5000 requests | Requests per second | Average time per request | Transfer rate | Performance |
---|---|---|---|---|---|
Activated | 9.400 s | 531.94 | 375.984 ms | 16 572.67 Kb/s | 100% |
Off | 7.045 s | 709.74 | 281.794 ms | 22 130.80 Kb/s | 133.42% |
Enabled (static cache) | 5.734 s | 884.26 | 226.177 ms | 27567.59 | 166.24% |
Analysis: Impact of NGINX on performance
With the default configuration (NGINX enabled), the server operates correctly, but a CPU bottleneck was observed. Overall CPU utilization (all cores) did not exceed 85 % in the load test, with the NGINX process also bottlenecked around 85%.
Without NGINX, Apache handles requests directly. The results show a +33% improvement in performance.
But the surprise is when the NGINX cache is activated and manages static files directly. Performance gains of +66%! And that's not all: we've also seen a reduction in CPU core utilization to 30%, leaving plenty of CPU available for other essential uses such as PHP-FPM or MariaDB/MySQL. NGINX, however, is limited to 99% CPU usage (i.e. one core): Perhaps it's possible to extend its use to several CPU cores and boost results even further. At the time of testing, I still had 5 to 6 CPU cores available, enough to potentially multiply this result by 2 or 3. This is worth investigating further.
Other considerations concerning NGINX and Plesk
Plesk favors the use of NGINX with several advantages that may justify its activation:
- Enhanced certificate generation For example, Plesk allows you to generate a certificate for webmail only, when NGINX is in place.
- Security Functions such as OCSP Stapling are available in 1 click, only with NGINX.
I may be missing other advantages. The disadvantage is, of course, that you then have two web applications, which slightly increase the complexity of the installation.
Conclusion
Using NGINX as a reverse proxy under Plesk can be extremely powerful for static sites, or when combined with a good caching system (see cache comparison for WordPress). But according to my test, it is essential to modify the NGINX settings to obtain a performance gain rather than a reduction compared to Apache alone.
What's more, results can vary greatly depending on your end-applications (your sites) and their caches. If necessary, use my test methodology to make your own measurements and comparisons. I'm interested in your feedback: share your results in the comments!
Leave a Reply