Chinaunix首页 | 论坛 | 博客
  • 博客访问: 490126
  • 博文数量: 99
  • 博客积分: 3621
  • 博客等级: 中校
  • 技术积分: 1089
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-22 16:29
文章存档

2012年(21)

2011年(28)

2010年(50)

分类: Mysql/postgreSQL

2011-05-18 09:46:52

今天在网上逛,偶然发现一个比mysqlreport更好的MYSQL调优的监控工具,就是turn-primer.sh。赶紧下载下来尝试,挺强悍的。
  1. [root@ldc2095 Bruce]# wget http://launchpad.net/mysql-tuning-primer/trunk/1.5-r5/+download/tuning-primer.sh
  2. [root@ldc2095 Bruce]# chmod +x tuning-primer.sh
  3. [root@ldc2095 Bruce]# ./tuning-primer.sh
然后它会提示你一些配置项,简单的YES和NO.
  1. -- MYSQL PERFORMANCE TUNING PRIMER --
  2.              - By: Matthew Montgomery -
  3.  
  4. MySQL Version 5.1.56-community-log x86_64
  5.  
  6. Uptime = 11 days 22 hrs 38 min 41 sec
  7. Avg. qps = 112
  8. Total Questions = 116587054
  9. Threads Connected = 7
  10.  
  11. Server has been running for over 48hrs.
  12. It should be safe to follow these recommendations
  13.  
  14. To find out more information on how each of these
  15. runtime variables effects performance visit:
  16. http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html
  17. Visit http://www.mysql.com/products/enterprise/advisors.html
  18. for info about MySQL's Enterprise Monitoring and Advisory Service
  19.  
  20. SLOW QUERIES
  21. The slow query log is enabled.
  22. Current long_query_time = 10.000000 sec.
  23. You have 49490 out of 116587098 that take longer than 10.000000 sec. to complete
  24. Your long_query_time seems to be fine
  25.  
  26. BINARY UPDATE LOG
  27. The binary update log is enabled
  28. The expire_logs_days is not set.
  29. The mysqld will retain the entire binary log until RESET MASTER or PURGE MASTER LOGS commands are run manually
  30. Setting expire_logs_days will allow you to remove old binary logs automatically
  31. See http://dev.mysql.com/doc/refman/5.1/en/purge-master-logs.html
  32. Binlog sync is not enabled, you could loose binlog records during a server crash
  33.  
  34. WORKER THREADS
  35. Current thread_cache_size = 16
  36. Current threads_cached = 12
  37. Current threads_per_sec = 0
  38. Historic threads_per_sec = 0
  39. Your thread_cache_size is fine
  40.  
  41. MAX CONNECTIONS
  42. Current max_connections = 1000
  43. Current threads_connected = 5
  44. Historic max_used_connections = 52
  45. The number of used connections is 5% of the configured maximum.
  46. You are using less than 10% of your configured max_connections.
  47. Lowering max_connections could help to avoid an over-allocation of memory
  48. See "MEMORY USAGE" section to make sure you are not over-allocating
  49.  
  50. INNODB STATUS
  51. Current InnoDB index space = 3.21 G
  52. Current InnoDB data space = 3.76 G
  53. Current InnoDB buffer pool free = 0 %
  54. Current innodb_buffer_pool_size = 1.00 G
  55. Depending on how much space your innodb indexes take up it may be safe
  56. to increase this value to up to 2 / 3 of total system memory
  57.  
  58. MEMORY USAGE
  59. Max Memory Ever Allocated : 7.33 G
  60. Configured Max Per-thread Buffers : 110.53 G
  61. Configured Max Global Buffers : 1.58 G
  62. Configured Max Memory Limit : 112.12 G
  63. Physical Memory : 15.67 G
  64.  
  65. nMax memory limit exceeds 90% of physical memory
  66.  
  67. KEY BUFFER
  68. Current MyISAM index space = 4 M
  69. Current key_buffer_size = 64 M
  70. Key cache miss rate is 1 : 162
  71. Key buffer free ratio = 44 %
  72. Your key_buffer_size seems to be too high.
  73. Perhaps you can use these resources elsewhere
  74.  
  75. QUERY CACHE
  76. Query cache is enabled
  77. Current query_cache_size = 512 M
  78. Current query_cache_used = 180 M
  79. Current query_cache_limit = 2 M
  80. Current Query cache Memory fill ratio = 35.21 %
  81. Current query_cache_min_res_unit = 4 K
  82. MySQL won't cache query results that are larger than query_cache_limit in size
  83.  
  84. SORT OPERATIONS
  85. Current sort_buffer_size = 16 M
  86. Current read_rnd_buffer_size = 64 M
  87. Sort buffer seems to be fine
  88.  
  89. JOINS
  90. Current join_buffer_size = 16.00 M
  91. You have had 126 queries where a join could not use an index properly
  92. join_buffer_size >= 4 M
  93. This is not advised
  94. You should enable "log-queries-not-using-indexes"
  95. Then look for non indexed joins in the slow query log.
  96.  
  97. OPEN FILES LIMIT
  98. Current open_files_limit = 65535 files
  99. The open_files_limit should typically be set to at least 2x-3x
  100. that of table_cache if you have heavy MyISAM usage.
  101. Your open_files_limit value seems to be fine
  102.  
  103. TABLE CACHE
  104. Current table_open_cache = 4096 tables
  105. Current table_definition_cache = 256 tables
  106. You have a total of 427 tables
  107. You have 840 open tables.
  108. The table_cache value seems to be fine
  109. You should probably increase your table_definition_cache value.
  110.  
  111. TEMP TABLES
  112. Current max_heap_table_size = 64 M
  113. Current tmp_table_size = 1.00 G
  114. Of 749131 temp tables, 0% were created on disk
  115. Effective in-memory tmp_table_size is limited to max_heap_table_size.
  116. Created disk tmp tables ratio seems fine
  117.  
  118. TABLE SCANS
  119. Current read_buffer_size = 16 M
  120. Current table scan ratio = 647 : 1
  121. read_buffer_size is over 8 MB there is probably no need for such a large read_buffer
  122.  
  123. TABLE LOCKING
  124. Current Lock Wait ratio = 1 : 3828971
  125. Your table locking seems to be fine
在命令行下是有颜色区分的,贴到这里都看不出来了。
阅读(839) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

9094133352011-05-18 10:06:33

这脚本很强悍,能够把它认为有问题的参数用红色标注出来,并给出建议。
但好像里面有些统计值并不那么准确,比如tmp_table on disk  .10W个TMP TABLE有一个ON DISK的话,比率太低,就认为是0了.