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
| Interface | Relative Performance | Notes |
|---|---|---|
| CGI | 1x (baseline, slowest) | New process per request |
| FastCGI | 5-10x faster | Persistent workers, standard protocol |
| PHP-FPM | 5-10x faster | Industry standard for Nginx/Apache |
| LSAPI | 10-15x faster | Purpose-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
- Return to the PHP Integration module for the complete overview.