LiteSpeed SAPI is a protocol designed specifically for communication between LiteSpeed web server and third party web application that runs in it own process.
Like FastCGI Application, Application utilize LiteSpeed SAPI will run in it own persistent process, and talk to web server via a persistent socket connection. The overhead of starting a new process or socket connection has been complete avoided.
LiteSpeed SAPI is designed to be the fastest server API for inter-process communication between LiteSpeed Web Server and third party web application, protocol overhead has been reduced to minimum. Comparing to FastCGI protocol, LiteSpeed SAPI has about 25% speed advantage over FastCGI for simple "Hello World" application.
Does not like some server API which allow you to embed your module inside the web server process, LiteSpeed SAPI application run in its own process and talk to web server through a socket connection. The main benefit of doing this is better reliability and security, a buggy application will not able to crash the whole web server or affect other application. Applications can be started with different user IDs (usually called "suEXEC"), file system can be easily secured.
In theory, out of process application is not as fast as embedded modules, however, due to the highly optimized protocol, our benchmark shows that LSAPI application delivers better performance than Apache modules for dynamic content generation.
An API library written in C is available for building third party web application using LiteSpeed SAPI. The protocol detail will be published later. Currently, we have the following LSAPI modules for third party scripting languages: