[solved] Connection Timeout and php

Discussion in 'Install/Configuration' started by bobykus, Nov 23, 2012.

  1. bobykus

    bobykus Well-Known Member


    It is recommended to set "Connection Timeout" to 30 or so to prevent DDoS.
    On the other hand we have a php scripts which execution can takes lets say
    5 min (joomla theme install or update etc). How to distinguish between http connection timeout and lsapi apps output timeout then? I tried to set

    Connection Timeout 30


    Connection Keepalive Timeout 320

    for LiteSpeed API App Definition

    but connection to lsphp dropping within this 30 sec.

    BTW, is there any way to set timeout per External App?
    Last edited by a moderator: Nov 28, 2012
  2. webizen

    webizen Well-Known Member

    if your external app (LSPHP5) takes a long time to complete, you should extend "Connection Timeout" so that connection with external app does not get closed (due to inactivity) before ext app completes.

    You need to balance between get the work done and prevent DDoS (there are other ways to defend DDoS in LSWS).
  3. bobykus

    bobykus Well-Known Member

    Oh yeah?
    So no setting per php? What if I need one long and one short gun/php?
    And... Connection Timeout means Tuning > Connection Timeout?
    What is External App > ... > Connection Keepalive Timeout then?
    What is for? How this two cooperate?
  4. webizen

    webizen Well-Known Member

    Connection Timeout in Tuning indicates how long LSWS will keep the connection with end user when idel. If no response from external app (given LSWS keeps connection with LSPHP) within that period, connection with user will be closed.

    The timeout for LSWS connect with external app (like LSPHP) is Initial Request Timeout (secs) and Retry Timeout (secs) in External App.

    Here is a reference to run php without timeout:


    Connection Keepalive Timeout is for persistent connection which is only for FastCGI external app not for LSPHP.
  5. bobykus

    bobykus Well-Known Member

    Cool, thank you!

Share This Page