problem with php4 as fcgi both remote/local

Discussion in 'Install/Configuration' started by ts77, Oct 1, 2006.

  1. ts77

    ts77 Well-Known Member

    Hey folks,

    I know I'm having a kinda strange configuration but here's the deal:
    I'm running two web-servers currently with lsws.
    Usually only one is serving requests and just uses the other one as php-fcgi load-balanced backend (together with local php-fcgi backends).
    This part works fine.
    I've got php5 + php4 installed on both machines and working.

    Now, once the main-machine fails, the second machine should take over its ip-address and serve the requests.
    The takeover of the ip-address is working fine with heartbeat.

    But the problem is on the second backup-machine with accessing the local php4 instance through tcp/ip.
    It simply can't reach it and returns a 503 error.
    The other (main-) machine uses the php4 instance on the backup-machine without any problems through the internal load-balanced fcgi-backend.

    So, what could be the problem?
    I've been looking for a solution for hours already and can't find it.

    The configuration is as follows:
    	FastCGI App Definition	   Edit   Delete   Back
    Name	fcgi-local
    Max Connections	20
    Environment	PHP_FCGI_CHILDREN=20
    Initial Request Timeout (secs)	60
    Retry Timeout (secs)	0
    Persistent Connection	Yes
    Connection Keepalive Timeout	-1
    Response Bufferring	No
    Auto Start	Yes
    Command	/usr/lib/php4/bin/php-cgi -b
    Back Log	100
    Instances	1
    Run On Start Up	Yes
    Max Idle Time	-1
    Priority	0
    Memory Soft Limit (bytes)	300M
    Memory Hard Limit (bytes)	350M
    Process Soft Limit	110
    Process Hard Limit	110
    Yes, I know I could remove the -b ip part but that only worked for me for php5. with php4 the other machine couldn't connect if I left out the -b ... .


  2. mistwang

    mistwang LiteSpeed Staff

    Maybe the FCGI instances on the backup machine is still pre-occupied by the first machine, TCP connections is still established between FCGI processes and the LSWS on first machine.
    To solve this issue, you need to set "PHP_FCGI_CHILDREN=40", so there is always php process available for local use.
  3. ts77

    ts77 Well-Known Member

    hmm, I'll try that but its really not fully used.
    the first machine mostly has a pool of around 5 or 6 of the connections from the second machine.
    but its worth a try.
  4. ts77

    ts77 Well-Known Member

    Ok, rised both connections and PHP_FCGI_CHILDREN to 40.
    Nothing changed.
    tried it without raising connections, same result.

    Any further ideas or how to track this down?
    enabled debug log only showed "connection reset by peer" for the fcgi connection. no, I don't have a firewall or something enabled.
  5. mistwang

    mistwang LiteSpeed Staff

    Maybe it is the fault of FCGI_WEB_SERVER_ADDRS, please try with it being removed.
  6. ts77

    ts77 Well-Known Member

    yeah removing it works. too bad its then open to all ip-addresses. I can only bind it to my private ip-address which can still be reached in the same network.
    strange that the same line works with php5-fcgi apps without problems.
  7. xing

    xing LiteSpeed Staff

    The past few php 5.1.X release are using a completedly rewritten FCGI package versus older php5 and php4 releases. They might have improved it when it comes to bugs/features as compared to the php4 fcgi.

Share This Page