Skip to main content

Performance Benefits

Learning Focus

By the end of this lesson you will understand the specific performance advantages of LSAPI over CGI, FastCGI, and PHP-FPM.

How LSAPI Gains Performance​

1. Worker Persistence​

Workers stay alive between requests, avoiding process creation overhead on every page load.

2. Reduced Context Switching​

LSAPI minimizes data copying between the web server and PHP by using optimized shared memory paths.

3. Auto-Management​

OpenLiteSpeed automatically spawns, monitors, and recycles workers based on demand — no external pool manager needed.

4. Tight Protocol Integration​

The LSAPI protocol is purpose-built for LiteSpeed, eliminating the protocol translation overhead that exists with FastCGI or FPM.

Benchmark Comparison​

InterfaceRelative PerformanceNotes
CGI1x (baseline, slowest)New process per request
FastCGI5-10x fasterPersistent workers, standard protocol
PHP-FPM5-10x fasterIndustry standard for Nginx/Apache
LSAPI10-15x fasterPurpose-built for LiteSpeed
info

The exact performance difference depends on workload, PHP version, and application complexity. LSAPI's advantage is most visible under high concurrency.

Key Takeaways​

  • LSAPI's performance advantage comes from worker persistence, shared memory, and tight protocol integration.
  • It outperforms CGI, FastCGI, and PHP-FPM for OpenLiteSpeed workloads.
  • You typically do not need PHP-FPM when running OpenLiteSpeed — LSAPI replaces it.

What's Next​