• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1470
  • Last Modified:

Load Balance

Hello,

I have a Linux server running red hat enterprise.
We use PHP/Mysql and need to load balance.

when we promote specials we get so much traffic that the server shuts down.

What do i need to do to setup load balancing?
Do i need to recode anything?

0
bionicblakey
Asked:
bionicblakey
3 Solutions
 
Alf666Commented:
You could load balance with a simple DNS round robin. That is, have multiple A entries with the same IP address.
It's not the best though if you want to, for example, shutdown one of the systems.
Plus, it can be a nightmare if you handle sessions locally on the PHP side (versus in the MySQL DB), because if clients ask one page to one server
and the next one to another, it will mess up your sessions.

You can use a switch capable of layer 2 switching. They are clever enough to keep a notion of session in between requests.

There are also a few Linux based software load balancers (free and commercials). Among the free ones :

http://www.linuxvirtualserver.org/
http://plb.sunsite.dk/download.html

You won't be able to load balance the DB though. If it's the one giving you troubles, you'll have to rethink your database schema/model and/or cache certain information. You could also decide to split up your database to multiple boxes if your schema allows it.


0
 
paullamhkgCommented:
For MySql there is high availabilty and load balancing method have a check here http://www.mysql.com/newsletter/2003-04/a0000000157.html

To recode your PHP might help, also check whether there is/are any un use service running in your linux box, if there any un use service, try to stop it, will also help.

and Add RAM and swap space will also help :)
0
 
ahoffmannCommented:
PHP can handlesessions in Mysql, this is much better than the cumbersome/insecure  PHP method in files, see php.ini
0
 
Peeyush_MauryaCommented:
if u want to do load-balancing, look at

http://geocities.com/peeyush_maurya/bonding.htm

hope it helps

Regards,
Peeyush
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now