Solved

load balance server

Posted on 2011-09-22
8
480 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
 
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:

920 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

20 Experts available now in Live!

Get 1:1 Help Now