Solved

load balance server

Posted on 2011-09-22
8
479 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
Comment Utility
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
Comment Utility
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
Comment Utility
And using LVS?  Sounds like a great idea!  :)
0
 
LVL 76

Expert Comment

by:arnold
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 38

Accepted Solution

by:
wesly_chen earned 250 total points
Comment Utility
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
Comment Utility
the server its receiving the same requests per day but the mysql database its growing fast.
0
 
LVL 21

Expert Comment

by:Papertrip
Comment Utility
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 76

Assisted Solution

by:arnold
arnold earned 250 total points
Comment Utility
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
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 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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

762 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

10 Experts available now in Live!

Get 1:1 Help Now