new php sapi (by litespeed)

D
  • 2 Oct '09
Hi,
I've recently discovered that George Wang'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:
http://www.litespeedtech.com/php-litespeed-sapi.html
http://www.litespeedtech.com/products/lsapi/overview/

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
dreamcat4 at gmail.com

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

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,10755,10755#msg-10755
A
  • 2 Oct '09
Hi,

On Fre 02.10.2009 13:10, dreamcat4 wrote:
>Hi,

[snipp]

>Check it out at:
>http://www.litespeedtech.com/php-litespeed-sapi.html
>http://www.litespeedtech.com/products/lsapi/overview/
>
>
>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 ;-)

BR

Aleks
D
  • 2 Oct '09
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: http://forum.nginx.org/read.php?2,10755,10826#msg-10826
A
  • 2 Oct '09
On 10/2/09 4:32 PM, "Aleksandar Lazic" <al-nginx at none.at> wrote:

> You are right it looks very interesting.
> I have never developed a nginx module, looks a interesting start ;-)

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

-- 
Brian Akins
M
  • 2 Oct '09
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.
D
  • 2 Oct '09
Marcus Clyne 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: http://forum.nginx.org/read.php?2,10755,10839#msg-10839
A
  • 4 Oct '09
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 ;-)

BR

Aleks