IT Solutions · 2025-01-02 0

LiteSpeed vs NGINX vs Apache

LiteSpeed vs NGINS vs Apache

TL;DR infographic: LiteSpeed vs NGINX vs Apache

We’ve summarised the features below into this TL;DR comparison table infographic:

LiteSpeed vs NGINX vs Apache comparison table graphic

Architecture

Apache

Apache has a process-based architecture: each HTTP request is handled by a separate process. There is a master process that spawns a new process for every new HTTP request it receives.

The problem with process-based architectures is that there’s a lot of memory overhead: there are as many processes as active connections. In peak hours, your memory utilization may rise exponentially.

If this doesn’t make sense, read our analogy:

Think of a server as a restaurant: people come in (traffic), order food (request web pages), and eat (view those pages), then finally pay their bills, and leave.
In our analogy, the waiters are the processes that handle the various requests to the server.
Apache’s processed-based model translates to one waiter per customer. So, the one waiter will take care of everything. From handling the order, to preparing the food, payment, etc.
This means the more customers there are, the more waiters are needed to handle the load. If there’re more customers than waiters, a queue is formed, and you see where this is going.

NGINX

On the other hand, NGINX has an event-driven architecture: a new event is generated for every incoming HTTP request.

The event-driven process model works like this: there’s a master process, and multiple worker/helper processes. The master process oversees the management of the entire server, and performs all the privileged operations (reading configurations, binding ports etc.).

The operational workload of the server is distributed across various worker processes.

Running with our analogy above, one waiter will take multiple orders from different customers and delegate to other waiters as needed. This means people enter the restaurant, place their orders, and get served with minimal wait time. Queuing is processed faster, and the bottleneck becomes non-existent.

This is why event-driven architectures are much more lightweight and efficient. Your memory utilisation doesn’t vary too much during peak and off-peak hours, as the same number of worker threads share the load among themselves.

LiteSpeed

LiteSpeed also has an event-driven architecture that’s very similar to that of NGINX.


Speed

Apache’s process-based architecture usually means higher RAM usage and longer response times, especially during peak hours and stress runs.

NGINX is relatively faster than Apache, but LiteSpeed is undoubtedly the fastest of the lot.

The LiteSpeed team deployed WordPress instances on each of the three web servers, and ran a few tests to compute the following benchmarks:

Apache (with their own W3 Total Cache): 826.5 requests per second.

NGINX (with their own FastCGI Cache): 6,025.3 requests per second

LiteSpeed (with LiteSpeed Cache for WordPress): 69,618.5 requests per second

Click on the image below to view their site providing the details of their test environment:

A Litespeedtech graph showing Litespeed's swiftness in handling requests via HTTP/2
A LiteSpeedtech graph showing LiteSpeed’s swiftness in handling requests via HTTP/2

Similar trends have been observed in other bench-marking efforts. Check out this LiteSpeed graph displaying amount of transactions per second:

Simon Guetta

URL