Skip to content

LiteSpeed vs Apache: what changes, what stays, and what to measure

A direct comparison of LiteSpeed and Apache covering compatibility, performance characteristics, configuration differences, and the metrics that actually matter.

When a hosting team evaluates swapping Apache for LiteSpeed, the usual question is “how much faster?” — but the more useful question is “faster at what, under which load, and what breaks?” LiteSpeed is drop-in compatible for the vast majority of Apache configurations, but the performance story is nuanced and depends heavily on workload type. This article is aimed at server administrators and DevOps engineers who want to make an informed decision rather than rely on marketing claims or synthetic microbenchmarks.

How to verify

Establish a baseline before any change. On the existing Apache server:

ab -n 5000 -c 100 https://example.com/
wrk -t4 -c200 -d30s https://example.com/
curl -w "@curl-format.txt" -o /dev/null -s https://example.com/

After switching to LiteSpeed, run the same tests from the same client machine. Also compare under concurrent load:

# Check worker mode and connection count
/usr/local/lsws/bin/lshttpd -v
curl -sI https://example.com/ | grep -E '(Server|X-LiteSpeed|Connection)'
# Monitor memory footprint under load
ps -o pid,vsz,rss,comm -p $(pgrep -d, lshttpd)

Use curl-format.txt with time_namelookup, time_connect, time_starttransfer, and time_total fields to isolate TTFB from transfer time.

What’s happening

Apache uses a process or thread-per-connection model. Under the default mpm_event module, it maintains a pool of worker threads and assigns one to each active connection. This works well for moderate concurrency but the per-thread memory overhead compounds quickly: at 500 concurrent connections, Apache may be holding 500 threads or processes in memory, each with its own stack, even when most of those connections are idle between request/response cycles.

LiteSpeed uses an event-driven architecture. A small number of worker processes — typically one per CPU core — handle thousands of connections through asynchronous I/O multiplexing. An idle keep-alive connection costs almost no memory or CPU. This is the same architectural difference that made Nginx competitive with Apache a decade ago, and LiteSpeed shares it.

In practice, the performance gap between LiteSpeed and Apache on a lightly loaded server is small and often not worth the migration risk. The gap becomes significant in three scenarios: high concurrency with many keep-alive connections (LiteSpeed’s event loop pulls ahead), PHP delivery with LSAPI vs. PHP-FPM (LSAPI eliminates a FastCGI socket round-trip and shares memory differently), and static file serving where LiteSpeed’s zero-copy sendfile implementation and built-in cache layer remove syscall overhead.

What stays the same: .htaccess parsing, mod_rewrite rule syntax, VirtualHost directives, SSL certificate paths, PHP version selection, and mod_security rule files (with minor caveats). LiteSpeed reads Apache-format configuration files directly and aims for behavioural parity on directives it supports.

What changes: the process model (one manager plus workers vs. many Apache children), the PHP execution path (LSAPI vs. FastCGI), the log file location, the cache layer (LSCache is built into LSWS with no Apache equivalent), and the way HTTP/2 and HTTP/3 are enabled.

The procedure

1. Define what you are measuring.

Choose metrics relevant to your actual workload:

  • TTFB (Time To First Byte): most important for dynamic PHP pages, search ranking signals.
  • Requests per second: throughput ceiling for a given hardware configuration.
  • Concurrency at degradation: the connection count at which p99 latency starts climbing.
  • Memory per worker: critical on servers with many vhosts and limited RAM.

Do not compare raw benchmarked RPS between servers with different RAM or CPU counts. Normalize to a single metric: p95 latency at a fixed concurrency level (e.g., 200 concurrent connections, 30-second test).

2. Run Apache baseline under realistic load.

Use a traffic replay tool or wrk with a realistic URL list. Include a mix of cacheable pages, dynamic PHP pages, and POST endpoints if your application uses them:

wrk -t4 -c200 -d60s --script=mixed-urls.lua https://example.com/

Record p50, p95, p99 latency and total requests served.

3. Switch to LiteSpeed and run the identical test.

Do not tune LiteSpeed yet. The first comparison should be baseline Apache vs. default-configured LiteSpeed, to understand the out-of-the-box difference. Tune only after you have the baseline comparison recorded.

4. Enable LSCache and retest.

LSCache is LiteSpeed’s built-in full-page cache. For WordPress, install the LiteSpeed Cache plugin, enable it, and warm the cache:

curl -s https://example.com/ > /dev/null  # prime
curl -sI https://example.com/ | grep X-LiteSpeed-Cache

Rerun the wrk test. The improvement here is often 5–10× for cacheable pages because LSWS serves them from a memory-mapped cache without invoking PHP at all.

5. Tune worker count and PHP concurrency.

Edit /usr/local/lsws/conf/httpd_config.conf (or the WHM interface) and set:

maxConnections 10000
maxSSLConnections 10000
worker 4
phpConcurrency 35

worker should match physical CPU core count. phpConcurrency controls how many simultaneous PHP requests LSWS allows per worker before it queues new ones. Default is often 10, which starves high-traffic sites unnecessarily.

Common pitfalls

Comparing different PHP execution modes. If Apache was using mod_php (DSO) and LiteSpeed is using LSAPI, you are not comparing web servers — you are comparing PHP execution models. Run both tests with PHP-FPM under Apache first to isolate the web server variable, then compare FPM on Apache to LSAPI on LiteSpeed.

Synthetic benchmarks with no PHP. Benchmarking pure static file serving is not a useful indicator for most hosting workloads. The real bottleneck is almost always PHP. Use a benchmark that exercises your actual application stack.

Forgetting keep-alive tuning on Apache. Apache defaults to very short keep-alive timeouts (KeepAliveTimeout 5). If you do not tune this before the Apache baseline, LiteSpeed will appear faster than it actually is relative to a tuned Apache. Use KeepAliveTimeout 15 in the Apache baseline.

Attributing caching gains to LiteSpeed’s web server. LSCache gains are real, but they exist because caching was not configured on Apache — not because LSWS is faster at PHP. Varnish or nginx-based page caching on an Apache server would produce similar numbers. Credit the cache layer separately from the web server layer.

Overlooking .htaccess directives with no LiteSpeed equivalent. Run a grep for Options +MultiViews, SetHandler, AddHandler, and SetEnvIf across all .htaccess files before cutover. Some directives are silently ignored by LSWS, and the silence means the application continues to work without the directive’s effect, which may be a security or routing issue.


Stack Harbor benchmarks LiteSpeed migrations as standard practice under managed cloud operations, capturing pre- and post-switch metrics so the performance improvement is documented rather than assumed. For a managed switchover with a verified comparison, start with the knowledge base.