Jump to content

MySQL tuner : don't understand everyhting


Recommended Posts

Hello ! :)

I've ran mysqltuner and I got this result :

-------- General Statistics --------------------------------------------------


[--] Skipped version check for MySQLTuner script


[OK] Currently running supported MySQL version 5.0.89-community-log


[OK] Operating on 64-bit architecture



-------- Storage Engine Statistics -------------------------------------------


[--] Status: +Archive -BDB -Federated -InnoDB -ISAM -NDBCluster


[--] Data in MyISAM tables: 4G (Tables: 250)


[!!] Total fragmented tables: 43



-------- Performance Metrics -------------------------------------------------


[--] Up for: 7d 10h 25m 47s (47M q [73.815 qps], 2M conn, TX: 2149B, RX: 44B)


[--] Reads / Writes: 32% / 68%


[--] Total buffers: 4.0G global + 8.6M per thread (1000 max threads)


[OK] Maximum possible memory usage: 12.4G (79% of installed RAM)


[OK] Slow queries: 0% (4K/47M)


[OK] Highest usage of available connections: 15% (150/1000)


[OK] Key buffer size / total MyISAM indexes: 3.0G/2.5G


[OK] Key buffer hit rate: 100.0% (2B cached / 762K reads)


[OK] Query cache efficiency: 53.8% (11M cached / 21M selects)


[OK] Query cache prunes per day: 0


[OK] Sorts requiring temporary tables: 0% (925 temp sorts / 431K sorts)


[!!] Temporary tables created on disk: 26% (8K on disk / 30K total)


[OK] Thread cache hit rate: 99% (150 created / 2M connections)


[OK] Table cache hit rate: 49% (1K open / 3K opened)


[OK] Open file limit used: 27% (1K/7K)


[!!] Table locks acquired immediately: 75%



-------- Recommendations -----------------------------------------------------


General recommendations:


Run OPTIMIZE TABLE to defragment tables for better performance


Temporary table size is already large - reduce result set size


Reduce your SELECT DISTINCT queries without LIMIT clauses


Optimize queries and/or use InnoDB to reduce lock wait



It seems like I have a problem with temporary tables ? I don't understand what "result set size" means in " Temporary table size is already large - reduce result set size". Can you explain to me, please ?
Do you see anything else which is said to be ok that I could change (for instance not to waste ressources) ?

I only have one board on my server, with not more than 700 users at peak times, at the moment.

Thank you ! :)
Link to comment
Share on other sites

  • 3 months later...

You have to download and install it on your server first. Then, as for me, you type :

perl mysqltuner.pl in order to run MySQL Tuner

or

./tuning-primer.sh in order to run Tuning Primer.

The output is something like this :

root@server [~]# perl mysqltuner.pl



>> MySQLTuner 1.0.1 - Major Hayden <major@mhtx.net>


>> Bug reports, feature requests, and downloads at http://mysqltuner.com/


>> 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.91-community-log


[OK] Operating on 64-bit architecture



-------- Storage Engine Statistics -------------------------------------------


[--] Status: +Archive -BDB -Federated -InnoDB -ISAM -NDBCluster


[--] Data in MyISAM tables: 4G (Tables: 250)


[!!] Total fragmented tables: 27



-------- Performance Metrics -------------------------------------------------


[--] Up for: 7h 46m 39s (1M q [66.917 qps], 87K conn, TX: 26B, RX: 1B)


[--] Reads / Writes: 23% / 77%


[--] Total buffers: 7.1G global + 26.2M per thread (400 max threads)


[!!] Maximum possible memory usage: 17.4G (111% of installed RAM)


[OK] Slow queries: 0% (38/1M)


[OK] Highest usage of available connections: 30% (122/400)


[OK] Key buffer size / total MyISAM indexes: 3.0G/2.5G


[OK] Key buffer hit rate: 99.9% (97M cached / 120K reads)


[OK] Query cache efficiency: 53.3% (356K cached / 668K selects)


[OK] Query cache prunes per day: 0


[OK] Sorts requiring temporary tables: 0% (12 temp sorts / 9K sorts)


[!!] Temporary tables created on disk: 27% (529 on disk / 1K total)


[OK] Thread cache hit rate: 99% (122 created / 87K connections)


[OK] Table cache hit rate: 89% (709 open / 792 opened)


[OK] Open file limit used: 5% (975/16K)


[!!] Table locks acquired immediately: 67%



-------- Recommendations -----------------------------------------------------


General recommendations:


Run OPTIMIZE TABLE to defragment tables for better performance


MySQL started within last 24 hours - recommendations may be inaccurate


Reduce your overall MySQL memory footprint for system stability


Temporary table size is already large - reduce result set size


Reduce your SELECT DISTINCT queries without LIMIT clauses


Optimize queries and/or use InnoDB to reduce lock wait



root@server [~]# ./tuning-primer.sh



-- MYSQL PERFORMANCE TUNING PRIMER --


- By: Matthew Montgomery -



MySQL Version 5.0.91-community-log x86_64



Uptime = 0 days 7 hrs 46 min 48 sec


Avg. qps = 66


Total Questions = 1873885


Threads Connected = 3



Warning: Server has not been running for at least 48hrs.


It may not be safe to use these recommendations



To find out more information on how each of these


runtime variables effects performance visit:


http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html


Visit http://www.mysql.com/products/enterprise/advisors.html


for info about MySQL's Enterprise Monitoring and Advisory Service



SLOW QUERIES


The slow query log is enabled.


Current long_query_time = 3 sec.


You have 38 out of 1873918 that take longer than 3 sec. to complete


Your long_query_time seems to be fine



BINARY UPDATE LOG


The binary update log is NOT enabled.


You will not be able to do point in time recovery


See http://dev.mysql.com/doc/refman/5.0/en/point-in-time-recovery.html



WORKER THREADS


Current thread_cache_size = 128


Current threads_cached = 119


Current threads_per_sec = 0


Historic threads_per_sec = 0


Your thread_cache_size is fine



MAX CONNECTIONS


Current max_connections = 400


Current threads_connected = 3


Historic max_used_connections = 122


The number of used connections is 30% of the configured maximum.


Your max_connections variable seems to be fine.



No InnoDB Support Enabled!



MEMORY USAGE


Max Memory Ever Allocated : 6.26 G


Configured Max Per-thread Buffers : 10.25 G


Configured Max Global Buffers : 3.13 G


Configured Max Memory Limit : 13.38 G


Physical Memory : 15.63 G


Max memory limit seem to be within acceptable norms



KEY BUFFER


Current MyISAM index space = 2.53 G


Current key_buffer_size = 3.00 G


Key cache miss rate is 1 : 806


Key buffer free ratio = 78 %


Your key_buffer_size seems to be fine



QUERY CACHE


Query cache is enabled


Current query_cache_size = 128 M


Current query_cache_used = 19 M


Current query_cache_limit = 32 M


Current Query cache Memory fill ratio = 15.53 %


Current query_cache_min_res_unit = 2 K


Your query_cache_size seems to be too high.


Perhaps you can use these resources elsewhere


MySQL won't cache query results that are larger than query_cache_limit in size



SORT OPERATIONS


Current sort_buffer_size = 16 M


Current read_rnd_buffer_size = 4 M


Sort buffer seems to be fine



JOINS


Current join_buffer_size = 2.00 M


You have had 5 queries where a join could not use an index properly


You should enable "log-queries-not-using-indexes"


Then look for non indexed joins in the slow query log.


If you are unable to optimize your queries you may want to increase your


join_buffer_size to accommodate larger joins in one pass.



Note! This script will still suggest raising the join_buffer_size when


ANY joins not using indexes are found.



OPEN FILES LIMIT


Current open_files_limit = 16794 files


The open_files_limit should typically be set to at least 2x-3x


that of table_cache if you have heavy MyISAM usage.


Your open_files_limit value seems to be fine



TABLE CACHE


Current table_cache value = 8192 tables


You have a total of 267 tables


You have 711 open tables.


The table_cache value seems to be fine



TEMP TABLES


Current max_heap_table_size = 4.00 G


Current tmp_table_size = 4.00 G


Of 1480 temp tables, 26% were created on disk


Perhaps you should increase your tmp_table_size and/or max_heap_table_size


to reduce the number of disk-based temporary tables


Note! BLOB and TEXT columns are not allow in memory tables.


If you are using these columns raising these values might not impact your


ratio of on disk temp tables.



TABLE SCANS


Current read_buffer_size = 4 M


Current table scan ratio = 280 : 1


read_buffer_size seems to be fine



TABLE LOCKING


Current Lock Wait ratio = 1 : 2


You may benefit from selective use of InnoDB.


If you have a high concurrency of inserts on Dynamic row-length tables


consider setting 'concurrent_insert=2'.


Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...