OpenLiteSpeed vs. NGiNX vs. Apache
If our search statistics are any indication, the question on everyone’s mind is “How does OpenLiteSpeed compare to NGiNX and Apache?” We think that’s a question that deserves an answer, so we set up a test environment and got to work.
When it comes to WordPress, caching is important, so we made sure to use an appropriate caching solution for each web server in our tests.
All tests were performed with Keep-Alive enabled. (See more common settings under Web Server Configuration below.)
The following charts show how many requests per second the three servers processed during our series of tests. The larger the number, the better.
WordPress is a heavy PHP application and as such, caching is strongly recommended. In this test, we pair each server with an appropriate caching option.
As you can see, OpenLiteSpeed outperforms NGiNX and Apache in all of our scenarios.
Try It Yourself
In the interest of transparency, we’re including the specs of our web server configuration and test environment below. Feel free to run the same benchmarks and compare OpenLiteSpeed to NGiNX and Apache for yourself.
This is the command we used in all tests (Replace
example.com/path) with the location of your test subjects):
ab -n 10000 -k -H "Accept-Encoding: gzip,deflate" -c 100 example.com/path
Each test was run five times, and the average result was used for our graphs.
Web Server Configuration
common Settings For All Servers
- PHP use socket
- PHP version 7.1.2
Additional OpenLiteSpeed Settings
- Number of Workers: 4
- PHP_LSAPI_CHILDREN = 20
- LSAPI_AVOID_FORK = 1
Additional Nginx Settings
- worker_processes 4
- worker_connections 4096
- pm.start_servers = 20
Web Server Version:
- OLS: v1.4.28
- NGiNX: v1.12.2
- Apache: v2.4.6
Server API Version:
- OLS: LSAPI v6.11
- NGiNX: FPM/FastCGI
- Apache: Apache 2.0 Handler
- OLS: LSCache for WordPress v1.7.1
- NGiNX: FastCGI Cache
- Apache: W3 Total Cache v0.9.6
- Version: 4.9.4
Both Client and Server Specs:
- Intel Xeon CPU E7- 4870 4 Core @ 2.40GHz
- 4GB RAM
- 120GB ZFS RAID-Z2 iSCSI Drive
- CentOS 7
Although we didn’t use one for our benchmarks, We recommend Solid State Drives (SSD) in production environments.