Page 1 of 1
PHP clustering - the works
Posted: Thu Feb 26, 2004 3:21 pm
by pythone
Hello
I am looking into writing numerous php-based Web sites that will work with Apache and MySQL.
I would like to be able to cluster those Web sites.
Can anyone refer me to some place where I could read about PHP clustering, pitfalls, how to do it, important issues I should be aware of and so on?
thanks
Posted: Fri Feb 27, 2004 6:46 pm
by ilovetoast
If you are in need of clustering, then you should be using a load balancer, preferably a hardware load-balancer. Some web hosts offfer hardware load-balanced solutions. Software load balancing is usually a kludge. If you need load balancing, I urge you to do it via hardware, not via a PHP solution.
If you need to do it via software, consider something along the lines of Zeus' Load Balancer. I have used Zeus and their load balancer in the past, and I found it very effective - in fact the best software load balancer I have ever used.
peace
how clustering affects my PHP programming
Posted: Mon Mar 01, 2004 1:48 am
by pythone
Hi
I am indeed planning on using a hardware load balancer. My question is this:
Since I want to cluster my web sites in the following way: Assume that the site can be located in any of several servers. A load balancer directes traffic to the appropriate server for processing.
The problem is that I can no longer save anything in a server's RAM, since the next client request could be directed to a different server.
This means that it is hard to keep track of session information.
The also means that I cannot store any files locally on the file system and must use a shared database.
Did anyone encounter such a problem when he/she tried to cluster web servers? How did it affect the php programming?
thanks in advance
Posted: Mon Mar 01, 2004 4:55 am
by timvw
you could either put the session information in a shared database, or write it on a mounted network disk (fe nfs)
Posted: Mon Mar 01, 2004 9:02 am
by hedge
I had to deal with this issue. Not the ideal solution but we decided to FTP the session files to the other servers in the pool. I did this by writing my own session handler.
I would have liked to save it to the DB, but the site also has a public component that uses sessions and we didn't want to expose the DB to the public.
It made no noticeable difference to the speed of the site... as long as your session files are small.