Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


load balance server

Posted on 2011-09-22
Medium Priority
Last Modified: 2013-12-16
hello there,
I have a server running on centos v5.6 and apache with mysql.
the server its getting high loads recently so I would like to know how can I get a load balance server.
do I need to have the load balance server on the same network as the current one or can it be in a different data center..
once I get the server what do I do?
Question by:XK8ER
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
LVL 21

Expert Comment

ID: 36585023
Depends.  Do you want to spend money on a hardware LB solution that may be robust and feature-full, or software based like LVS which is generally more limited, but works great and is easy to learn, even has a web GUI for administration if you so desire.

It all comes down to how robust your needs are, and how fat your wallet is.

Author Comment

ID: 36585030
how about setup a new dedicated server also running on centos v5.6 right next to it in the same data center?
LVL 21

Expert Comment

ID: 36585033
And using LVS?  Sounds like a great idea!  :)
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.

LVL 80

Expert Comment

ID: 36585038
First you should determine the cause of the load increase, is it because there are far more requests to the webserver than were expected and by extension more queries to the mysql server? (resource limits)
If you do not have phpmyadmin you should consider using it to determine whether improvements can be achieved by making some adjustments to the mysql server settings, and perhaps by adding additional indices/indexes.

You could setup mysql on its own server (separate the two applications network will come into play here)
You could configure mysql in replication mode (master/master) and then  have the web application distribute the requests.

LVL 38

Accepted Solution

wesly_chen earned 1000 total points
ID: 36585044
For data integrity, the load balancing usually do it on Apache (Web server), not on mysql.

You might want to find out why the system load getting too high.
Usually it could be the disk IO (read/write) issue (from "top" command, you see CPU has high percentage in "wa", say XXwa).

If IO wait is the issue, I would recommend
1. reduce the Apache log, turn off access_log and leave just error_log (in /etc/httpd/conf/httpd.conf)
reload httpd after change httpd.conf

2. Turn off MySQL query log (if it is enabled), only enable log-error (in /etc/my.cnf)
restart mysqld after change my.cnf

If the system load still high, then separate the Apache web server and MySQL to different machines.
MySQL should give more powerful machine with more memory.
This will reduce MySQL disk IO wait slower down Apache web server.

Author Comment

ID: 36585047
the server its receiving the same requests per day but the mysql database its growing fast.
LVL 21

Expert Comment

ID: 36585059
the server its receiving the same requests per day but the mysql database its growing fast.
Well then load balancing probably isn't the best approach :)

I should have asked that I guess, since the other Experts drilled a bit deeper.... still new to EE I am, I assume too much :)
LVL 80

Assisted Solution

arnold earned 1000 total points
ID: 36586729
Do you have the option to reduce the number of rows available for querying?
I.e. "archive" unused/non-relevant entries from mysql (relocate historic entries from primary query table into an archive/warehouse table)?

This way the scope of the query will be reduced while you maintain access to the entire data set.
Everything depends on what it is you have in the mysql.

Depending on the version of mysql that you have, table partitioning might be another alternative.
http://dev.mysql.com/doc/refman/5.1/en/partitioning.html (5.1 and newer) you presumably have the 5.0.77 that is the default in the centos 5 version.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question