problem with php4 as fcgi both remote/local

ts77

Well-Known Member
#1
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:
Code:
	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

LiteSpeed Staff
#2
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

Well-Known Member
#3
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

Well-Known Member
#4
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.
 

ts77

Well-Known Member
#6
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

LiteSpeed Staff
#7
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.
 
Top