Go Back   CodeCall Programming Forum > Software Development > Tutorials > Linux Tutorials, Guides and Tips
Register Blogs Search Today's Posts Mark Forums Read

Linux Tutorials, Guides and Tips Member submitted guides, tips, tricks and tutorials for Linux.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-08-2009, 12:36 PM
phpforfun's Avatar
Speaks fluent binary
 
Join Date: Feb 2008
Posts: 1,202
phpforfun has a spectacular aura aboutphpforfun has a spectacular aura about
MySQL Tuner Optimization

Hey guys, if you are having MySQL issues on a linux box, try using this, its called MySQL Tuner. Its a neat little tool that tells you why your MySQL Configuration sucks, and it tells you how to fix it. Idiot proof

CD To Src
cd /usr/local/src/

Download it
wget http://mysqltuner.com/mysqltuner.pl

Chmod it
chmod +x mysqltuner.pl

Run It
./mysqltuner.pl

Here is what it will output.. atleast for my server before I optimized it

Quote:
[root@svr2 src]# ./mysqltuner.pl

>> MySQLTuner 1.0.0 - Major Hayden <major@mhtx.net>
>> Bug reports, feature requests, and downloads at MySQLTuner - MySQLTuner
>> Run with '--help' for additional options and output filtering

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.81-community-log
[!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 708M (Tables: 4947)
[--] Data in InnoDB tables: 107M (Tables: 157)
[--] Data in MEMORY tables: 756K (Tables: 8)
[!!] Total fragmented tables: 176

-------- Performance Metrics -------------------------------------------------
[--] Up for: 1d 6h 11m 0s (8M q [77.526 qps], 287K conn, TX: 4B, RX: 994M)
[--] Reads / Writes: 48% / 52%
[--] Total buffers: 587.0M global + 2.7M per thread (500 max threads)
[OK] Maximum possible memory usage: 1.9G (47% of installed RAM)
[OK] Slow queries: 0% (36/8M)
[OK] Highest usage of available connections: 6% (30/500)
[OK] Key buffer size / total MyISAM indexes: 409.0M/412.5M
[OK] Key buffer hit rate: 98.1% (64M cached / 1M reads)
[OK] Query cache efficiency: 64.6% (3M cached / 5M selects)
[!!] Query cache prunes per day: 41878
[OK] Sorts requiring temporary tables: 1% (4K temp sorts / 320K sorts)
[!!] Joins performed without indexes: 1594
[!!] Temporary tables created on disk: 36% (36K on disk / 98K total)
[OK] Thread cache hit rate: 98% (5K created / 287K connections)
[!!] Table cache hit rate: 0% (70 open / 170K opened)
[OK] Open file limit used: 3% (132/4K)
[OK] Table locks acquired immediately: 99% (4M immediate / 4M locks)
[!!] InnoDB data size / buffer pool: 107.3M/106.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
Adjust your join queries to always utilize indexes
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
query_cache_size (> 40M)
join_buffer_size (> 128.0K, or always use indexes with joins)
tmp_table_size (> 50M)
max_heap_table_size (> 30M)
table_cache (> 70)
innodb_buffer_pool_size (>= 107M)

Last edited by phpforfun; 07-08-2009 at 03:57 PM..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-08-2009, 01:27 PM
BlaineSch's Avatar
Code Warrior
 
Join Date: Apr 2009
Location: Trapped in my own little world.
Age: 19
Posts: 2,169
BlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of light
Send a message via MSN to BlaineSch
Re: MySQL Tuner Optimization

I got a 404 is it only accessible through the linux command line?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-08-2009, 02:44 PM
Jordan's Avatar
Administrator
 
Join Date: Nov 2005
Location: Hendersonville, NC
Posts: 24,556
Jordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to allJordan is a name known to all
Send a message via ICQ to Jordan Send a message via AIM to Jordan Send a message via MSN to Jordan Send a message via Yahoo to Jordan
Re: MySQL Tuner Optimization

Very cool script, thanks for the share! +rep

@Blaine: I think he wrote the URL wrong. It should be http://mysqltuner.com/mysqltuner.pl
(note the u instead of an i).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-08-2009, 03:05 PM
BlaineSch's Avatar
Code Warrior
 
Join Date: Apr 2009
Location: Trapped in my own little world.
Age: 19
Posts: 2,169
BlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of lightBlaineSch is a glorious beacon of light
Send a message via MSN to BlaineSch
Re: MySQL Tuner Optimization

Good eye jordan lol
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 07-08-2009, 03:57 PM
phpforfun's Avatar
Speaks fluent binary
 
Join Date: Feb 2008
Posts: 1,202
phpforfun has a spectacular aura aboutphpforfun has a spectacular aura about
Re: MySQL Tuner Optimization

Fixed
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 10-12-2009, 02:56 AM
whwmia's Avatar
Newbie
 
Join Date: Aug 2009
Posts: 20
whwmia is an unknown quantity at this point
Re: MySQL Tuner Optimization

Nice one ! Thank You !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Storing Images in MySQL with PHP Jordan PHP Tutorials 43 01-16-2010 11:35 AM
MySQL Resources dirkfirst Database & Database Programming 2 08-25-2009 05:46 AM
MySQL Column count does not match value count at row 1 dink PHP Forum 3 09-07-2008 01:49 PM
MYSQL CheatSheet - A must for MySQL Users reachpradeep Database & Database Programming 1 03-03-2007 04:05 PM
MySQL Optimization? Void Database & Database Programming 6 01-07-2007 02:06 PM


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


vBulletin v3.8.0 ©2010, Jelsoft Enterprises Ltd.


no new posts

LinkBacks Enabled by vBSEO 3.1.0