It's key to remember that MySQLTuner is a script which can assist you with your server, but it is not the solution to a badly performing MySQL server. The best performance gains come from a thorough review of the queries sent to the server, and an evaluation of the MySQL server itself. A qualified developer in your application's programming or scripting language should be able to work with a MySQL database administrator to find improvements for your server. Once the server and application are optimized well, you may need to consider hardware upgrades to the physical server itself.
This is a really useful tool for helping to optimize MySQL performance.Understanding the various my.cnf variables and how they affect performance can seem really complicated but this tool takes some of the pain away and makes it easier to understand the effects of each variable.It is especially useful to be able to see the global memory usage, memory usage per thread and the maximum possible memory usage -- that is really valuable information that is otherwise complex to calculate.
* Memory Usage: Calculates MySQL memory usage at max load and makes recommendations for increasing or decreasing the MySQL memory footprint. Per-thread and server-wide buffer data is calculated
separately for an accurate snapshot of the server?s configuration.
* Slow Queries: Reviews the amount of slow queries relative to the total queries. Slow query time limits are also analyzed and recommendations are made.
* Connections: Current and historical connection counts are reviewed.
* Key Buffer: Takes configuration data and compares it to the actual indexes found in MyISAM tables. Key cache hit rates are calculated and variable adjustments are suggested.
* Query Cache: Query cache hit rates and usage percentages are used to make recommendations for the query cache configuration variables.
* Sorting & Joins: Per-thread buffers that affect sorts and joins are reviewed along with the statistics from the queries run against the server.
* Temporary Tables: Variable recommendations are made to reduce temporary tables that are written to the disk.
* Table Cache: Compares total tables opened to the currently open tables. Calculates the table cache hit rate in order to make suggestions.
* Open Files: Determines if the server will approach or run into the open file limit set by the operating system or the MySQL server itself.
* Table Locks: Finds table locking that forces queries to wait and makes suggestions for reducing locks that require a wait.
* Thread Cache: Calculates how many times MySQL must create a new thread to respond to a query.
* Aborted Connections: Finds applications that are not closing connections to MySQL properly.
* Read/Write Ratios: Calculates the percentage of read and write operations on your MySQL installation.
Install Mysqltuner in Ubuntu Intrepid
sudo aptitude install mysqltuner
Or using the following method
Run MySQLTuner in Ubuntu
Download MySQLTuner using the following command
To run the script, simply make it executable and run it:
chmod +x mysqltuner.pl
Enter your administrative username and password
Output you can see as follows
You need to check mainly recommendations section at the end. It shows which variables you should adjust in the section of your my.cnf (on Ubuntu file located at /etc/mysql/my.cnf).