Compare PHP Performance Between LiteSpeed, Apache, and Nginx https://litespeedtech.com/images/logos/litespeed/litespeed-logo.png 2019-08-16 20:52:59 Comparing web server response time to requests for small PHP scripts: LiteSpeed vs. Apache and Nginx

PHP Hello World

Comparing web server response time to requests for small PHP scripts

This benchmark compares the speed at which different web servers respond to requests for small PHP scripts using both non-keep-alive and keep-alive connections.

Summary

LSWS with LSPHP Performance Gain

Concurrent Users Keep-Alive Nginx / FPM Apache / FPM Apache / EA4 Default
10 No 1.4x 3.4x 127.4x
Yes 1.5x 3.6x 192.6x
100 No 1.4x 3.4x 137.5x
Yes 1.5x 4.1x 197.5x

Notes:

  • We used a simple PHP hello world script, 4.0K in size. We used such a tiny script to avoid saturating the network connection and to show raw speed differences between the different setups.
  • Part of the difference in speeds is due to different server APIs. LiteSpeed Enterprise used LSAPI, PHP-FPM uses FCGI, EA4 Default uses CGI.
  • Opcode caching was used for all setups.
  • The benchmark simulated serving 10000 requests to 10 and 100 users.
  • The test was performed over a 10GBps network connection to make sure network bandwidth did not become a bottleneck.

Test Environment

Software:

LiteSpeed Enterprise 5.1.13
Nginx 1.10.3
Apache 2.4.25
PHP 7.1.2
cPanel 62

Server hardware specs:

Intel Xeon X5660 Single Core @ 2.80GHz
2GB RAM
50GB HDD
CloudLinux 7.3

Client hardware specs:

Intel Xeon E5-1620 Dual Core @ 3.60GHz
2GB RAM CentOS 6.8 with OpenVZ kernel 2.6.32-042stab116.1 Intel X540 10GBASE-T on board NIC

Network Switch:

Netgear XS708E-100NES 8-ports 10G switch

We welcome your feedback on our forum.

accelerate internet
[

Accelerate Your Internet Now!

]