FastCGI > LSAPI ?

Discussion in 'Feedback/Feature Requests' started by Jetro, Sep 1, 2005.

  1. Jetro

    Jetro New Member

    Hi, at start sorry for my english.

    On Your website is written that php with litespeed sapi is faster than fastcgi php. I tested this on my production server and portals and forum scripts like invisionboard are generated much slower. IPB in about 0.1s by lsapi and 0.03s in fastcgi mode. That's a big difference, about 300%! :( Both were compiled with almost the same directives, uses APC and same php.ini. Tested on lsws 2.1RC3 with default config (same results on 2.1RC2)

    Maybe i configured some wrong?

    ps. What Environment variables has lsapi that i can use in extrenal apps?
  2. mistwang

    mistwang LiteSpeed Staff

    Thank you for your feedback.

    We are surprised by the result as well, can you please send us your LSAPI PHP and FCGI PHP configuration, output of phpinfo().

    LSAPI's advantage over FCGI, is the communication cost between LSWS and PHP process, the pure execution speed of PHP script should be the same. So, I expect the result of speed measurement within PHP should be identical.

    One possible explanation is that FCGI PHP cache the whole html page generated, and send the script at the end of the request, LSAPI does not use a buffer that big and send partial content, which add some delay during IPC I/O, those delays is added into the overall PHP execution time.

    How big is the page generated in your test?

    Do you have a isolated test server that you can use 'ab' to measure the performance, not just the speed measurement within PHP?

    We will do some tests in our lab.

    Thanks,
    George
  3. Jetro

    Jetro New Member

    Thanks for the answer. Please check PM. :)
  4. SyNeo

    SyNeo New Member

    Hi.

    We have buffering enabled for the PHP, for all of the pages, in order to catch errors and present customized pages instead. Does it mean that in this case we should continue using FastCGI, because of the buffer size? Or there any way to increase the buffer size via options?
  5. mistwang

    mistwang LiteSpeed Staff

    Set output_buffering to 8K in php.ini will give you the best performance for LiteSpeed PHP.
  6. SyNeo

    SyNeo New Member

    Hi.

    Perhaps it's better to set this parameter to "On", and not limit it at all? Or the LSAPI is optimized best to work with 8K?
  7. mistwang

    mistwang LiteSpeed Staff

    8K is the best setting for LSAPI.

Share This Page