PDA

View Full Version : problem with php4 as fcgi both remote/local


ts77
10-01-2006, 08:14 AM
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
Address 192.168.115.11:1026
Max Connections 20
Environment PHP_FCGI_CHILDREN=20
PHP_FCGI_MAX_REQUESTS=1000
FCGI_WEB_SERVER_ADDRS="192.168.115.11,192.168.115.10,127.0.0.1"
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 192.168.115.11:1026
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 ... .


Thanks,

thomas

mistwang
10-01-2006, 05:03 PM
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.

ts77
10-01-2006, 06:26 PM
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.

ts77
10-02-2006, 02:58 AM
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.

mistwang
10-02-2006, 10:39 AM
Maybe it is the fault of FCGI_WEB_SERVER_ADDRS, please try with it being removed.

ts77
10-02-2006, 03:13 PM
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.

xing
10-02-2006, 05:46 PM
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.