Solved

load balance server

Posted on 2011-09-22
8
481 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
  • 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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 77

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 77

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

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
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.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

813 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now