Solved

load balance server

Posted on 2011-09-22
8
482 Views
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?
0
Comment
Question by:XK8ER
[X]
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
8 Comments
 
LVL 21

Expert Comment

by:Papertrip
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.
0
 
LVL 1

Author Comment

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

Expert Comment

by:Papertrip
ID: 36585033
And using LVS?  Sounds like a great idea!  :)
0
Technology Partners: 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!

 
LVL 78

Expert Comment

by:arnold
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.

0
 
LVL 38

Accepted Solution

by:
wesly_chen earned 250 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.
0
 
LVL 1

Author Comment

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

Expert Comment

by:Papertrip
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 :)
0
 
LVL 78

Assisted Solution

by:arnold
arnold earned 250 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.
0

Featured Post

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Daily system administration tasks often require administrators to connect remote systems. But allowing these remote systems to accept passwords makes these systems vulnerable to the risk of brute-force password guessing attacks. Furthermore there ar…
How many times have you wanted to quickly do the same thing to a list but found yourself typing it again and again? I first figured out a small time saver with the up arrow to recall the last command but that can only get you so far if you have a bi…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

697 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