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


  Search this Thread
Old 05-15-2008, 01:18 PM   #1
Registered: Mar 2006
Posts: 94

Rep: Reputation: 15
mysql performance tuning

i m running mysql on rhel5 and its eating cpu. could any one help me in fine tune it. as under redhat i see /etc/my.cnf in different format . how i can set values there so that mysql should take less cpu as compared to present cpu usage
Old 05-15-2008, 03:20 PM   #2
LQ Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

The first place to look is your mysql application (rather than mysql itself).

What queries is the app making that's eating so much CPU?

Can those queries be simplified?

After that, do a Google search on "mysql performance tuning". There are lots of resources (lots of advice, lots of tools). Pick what looks best for you and your scenario.

Good luck .. PSM
Old 05-19-2008, 11:57 PM   #3
Registered: Aug 2004
Location: India
Distribution: Redhat,Trustix,Fedora
Posts: 52

Rep: Reputation: 15
Optimized my.cnf values

I dont know what kind of application you are using with mysql. Any way the following values will be better for middle sized mysql server /etc/my.cnf
copy paste the following
max_connections = 500
key_buffer = 64M
myisam_sort_buffer_size = 64M
join_buffer_size = 2M
read_buffer_size = 2M
sort_buffer_size = 4M
table_cache = 1800
thread_cache_size = 64
wait_timeout = 180
connect_timeout = 10
max_allowed_packet = 16M
max_connect_errors = 10
query_cache_limit = 1M
query_cache_size = 32M
query_cache_type = 1
log-slow-queries = /var/lib/mysql/mysql-slow.log
long_query_time = 10
old-passwords = 1

open_files_limit = 8192
max_allowed_packet = 16M
key_buffer = 64M
sort_buffer = 64M
read_buffer = 16M
write_buffer = 16M
Restart the MySQL


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 megaM Linux - Server 6 10-10-2008 07:24 AM
Performance Tuning Question? toddbailey Linux - Server 1 09-14-2007 02:00 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
maintenance and performance tuning? groovin Linux - General 3 06-30-2003 09:20 PM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:15 AM.

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