LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-17-2008, 10:39 AM   #1
Firebar
Member
 
Registered: Feb 2005
Location: Southampton (UK)
Distribution: Debian, RHEL and SuSE
Posts: 69

Rep: Reputation: 15
MySQL - Performance Tuning


Hi everyone,

I have a MySQL database which has a number of tables, some of the rows within contain 86,000,000 entries. Overall its about 100GB in size.

Some queries for the large rows take around 5 minutes, maxing out the CPU on the box. It's on an AMD proliant running RHEL5.2 Xen.

My question is, if I were to take one of the tables which has a huge amount of data and turn it into a new database - will I be able to 'run' that database on a different core to achieve a form of load balancing? A bit like setting afinity.

To help illustrate this point:

Database DATA -> TABLES MyData1 + MyData2 (LARGE) + MyData3 (VERY LARGE) - CPU Core 0

into:

Database DATA_SPLIT1 -> TABLES MyData1 + MyData2 (LARGE) - CPU Core 0
Database DATA_SPLIT2 -> TABLES MyData3 (VERY LARGE) - CPU Core 1

Is this possible or should I look at other methods? I've got plenty of cores to throw at this and it doesn't hammer the disk much at all (approximately 20% utilisation).

Thanks MySQL DBA's
 
Old 12-17-2008, 12:46 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by Firebar View Post
Hi everyone,

I have a MySQL database which has a number of tables, some of the rows within contain 86,000,000 entries. Overall its about 100GB in size.

Some queries for the large rows take around 5 minutes, maxing out the CPU on the box. It's on an AMD proliant running RHEL5.2 Xen.

My question is, if I were to take one of the tables which has a huge amount of data and turn it into a new database - will I be able to 'run' that database on a different core to achieve a form of load balancing? A bit like setting afinity.

To help illustrate this point:

Database DATA -> TABLES MyData1 + MyData2 (LARGE) + MyData3 (VERY LARGE) - CPU Core 0

into:

Database DATA_SPLIT1 -> TABLES MyData1 + MyData2 (LARGE) - CPU Core 0
Database DATA_SPLIT2 -> TABLES MyData3 (VERY LARGE) - CPU Core 1

Is this possible or should I look at other methods? I've got plenty of cores to throw at this and it doesn't hammer the disk much at all (approximately 20% utilisation).

Thanks MySQL DBA's
Why don't you check out the MySQL Load Balancer?? Check here: http://dev.mysql.com/doc/refman/5.1/...-balancer.html
 
Old 12-18-2008, 01:31 AM   #3
Firebar
Member
 
Registered: Feb 2005
Location: Southampton (UK)
Distribution: Debian, RHEL and SuSE
Posts: 69

Original Poster
Rep: Reputation: 15
I'll take a look at it, thanks
 
Old 12-18-2008, 03:37 PM   #4
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
5 minutes isn't necessarily that long, depending on the actual data. Do these tables have indexes? What type of SQL are you using, can you give any type of examples? I've learned a lot of the time dealing with SQL and queries, it's usually the SQL being used that is the number one culprit for long running queries. The second culprit is the indexes or lack of indexing.

I'd say for a 5 minute query, you don't need to throw another server at it or the like.
 
Old 12-24-2008, 12:16 PM   #5
alexhwest
Member
 
Registered: Dec 2008
Location: Cleveland, OH
Distribution: Ubuntu
Posts: 30

Rep: Reputation: 15
Can you post the describe output of the table, or explain what it looks like, or perhaps the sql output from a mysqldump showing the indexes, etc. What is the query that takes 5 minutes? It is very likely that indexing would help tremendously, but as was said earlier, seeing the query would help diagnose the issue also.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux Performance Tuning anon249 Linux - Server 6 10-10-2008 07:24 AM
LXer: Tuning MySQL Performance with MySQLTuner LXer Syndicated Linux News 0 09-03-2008 02:11 PM
mysql performance tuning jindalarpan Linux - Server 2 05-19-2008 11:57 PM
apache performance tuning sachin1361 Linux - Enterprise 1 03-05-2007 06:19 AM
network performance tuning Skunk_Face Linux - Networking 1 04-16-2004 05:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration