New php sapi (by litespeed)

Hi,
I’ve recently discovered that George W.'s LiteSpeed PHP SAPI is
actually quite good and probably one of the best php sapis out there. Of
course, im not talking about the LiteSpeed web server, which is a
completely different matter entirely.

The litespeed interface to php has a simplified protocol, and is
supposed to be, well, a lot faster. It may be even faster than PHP-FPM
sapi (and should do a performance comparison to confirm this). You might
believe that its a bad idea to support this kind of a proprietory thing.
However after reviewing the licenses, there seems no problem. Its all
freely available under BSD license, and is included with php5.3+.

Check it out at:

The tricky bit is we have yet to write an nginx module to understand /
forward requests over the lsapi protocol.
It would make a great little project if anyone is interested.

Best regards,

dreamcat4
[email protected]

P.S. No flame wars about litespeed please.
We don’t wish to discuss that here.

Posted at Nginx Forum:

Hi,

On Fre 02.10.2009 13:10, dreamcat4 wrote:

Hi,

[snipp]

Check it out at:
PHP LSAPI Overview - LiteSpeed Technologies
LiteSpeed SAPI (LSAPI) - LiteSpeed Technologies

The tricky bit is we have yet to write an nginx module to understand /
forward requests over the lsapi protocol.
It would make a great little project if anyone is interested.

You are right it looks very interesting.
I have never developed a nginx module, looks a interesting start :wink:

BR

Aleks

Heres a checklist to help get started:

  1. download the php 5.3.X sources and build --with-litespeed → build
    ls-php binary

  2. Study any available litespeed lsapi protocol documentation

  3. Study the nginx fast-cgi module, how it forwards the requests

  4. Study the ‘how to write and nginx module’ guide for writing an nginx
    module

  5. Modify the existing nginx fast-cgi module (and replace the
    fcgi-specific parts with lsapi interface)

It may help to study these lsapi requests and responses directly by
attaching to the TCP port.
i.e. Tracing the conversations between webserver and the ls-php program
(ethereal)

You may also try to debug / step the code in php-src/sapi/litespeed.
This is OSS code available under BSD license.

Posted at Nginx Forum:

Hi,

The tricky bit is we have yet to write an nginx module to understand / forward requests over the lsapi protocol.
It would make a great little project if anyone is interested.

I’ve not looked at the code to check, but it may well work for Ruby too
(and I believe they’re planning on offering other languages e.g. Python
at some stage).

Marcus.

On 10/2/09 4:32 PM, “Aleksandar L.” [email protected] wrote:

You are right it looks very interesting.
I have never developed a nginx module, looks a interesting start :wink:

I’m guessing it’d be an upstream module (like http_proxy and fastcgi)??

On Fre 02.10.2009 17:01, dreamcat4 wrote:

Heres a checklist to help get started:

[snipp]

Thanks for your help

I will take a look :wink:

BR

Aleks

Marcus C. Wrote:

I’ve not looked at the code to check, but it may
well work for Ruby too
(and I believe they’re planning on offering other
languages e.g. Python
at some stage).

Marcus.

Yeah sure - the protocol should to support ruby, and python too.
Its just probably a little bit easier to develop it with php.

Posted at Nginx Forum: