ITPub博客

首页 > 数据库 > MySQL > 检查配置参数脚本。tuning-primer.sh

检查配置参数脚本。tuning-primer.sh

MySQL 作者:G8bao7 时间:2014-01-22 14:10:07 0 删除 编辑
参考:
脚本源码
https://launchpadlibrarian.net/78745738/tuning-primer.sh
http://www.cnblogs.com/zuoxingyu/archive/2013/04/09/3010024.html


环境
    my.cnf中[client]需要配置使用的用户,执行show status/variables权限,可以给super
        user = myadmin
        password = myadmin

输出结果

点击(此处)折叠或打开

  1. -- MYSQL PERFORMANCE TUNING PRIMER --
  2. - By: Matthew Montgomery -
  3. MySQL Version 5.5.19-log x86_64
  4. Uptime = 23 days 3 hrs 17 min 8 sec
  5. Avg. qps = 2
  6. Total Questions = 4543819
  7. Threads Connected = 10
  8. Server has been running for over 48hrs.
  9. It should be safe to follow these recommendations
  10. To find out more information on how each of these
  11. runtime variables effects performance visit:
  12. http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.html
  13. Visit http://www.mysql.com/products/enterprise/advisors.html
  14. for info about MySQL\'s Enterprise Monitoring and Advisory Service
  15. SLOW QUERIES
  16. The slow query log is NOT enabled.
  17. Current long_query_time = 10.000000 sec.
  18. You have 21 out of 4543840 that take longer than 10.000000 sec. to complete
  19. Your long_query_time seems to be fine
  20. BINARY UPDATE LOG
  21. The binary update log is enabled
  22. The expire_logs_days is not set.
  23. The mysqld will retain the entire binary log until RESET MASTER or PURGE MASTER LOGS commands are run manually
  24. Setting expire_logs_days will allow you to remove old binary logs automatically
  25. See http://dev.mysql.com/doc/refman/5.5/en/purge-master-logs.html
  26. Binlog sync is not enabled, you could loose binlog records during a server crash
  27. WORKER THREADS
  28. Current thread_cache_size = 0
  29. Current threads_cached = 0
  30. Current threads_per_sec = 1
  31. Historic threads_per_sec = 0
  32. Your thread_cache_size is fine
  33. MAX CONNECTIONS
  34. Current max_connections = 151
  35. Current threads_connected = 10
  36. Historic max_used_connections = 152
  37. The number of used connections is 100% of the configured maximum.
  38. You should raise max_connections
  39. INNODB STATUS
  40. Current InnoDB index space = 0 bytes
  41. Current InnoDB data space = 0 bytes
  42. Current InnoDB buffer pool free = 0 %
  43. Current innodb_buffer_pool_size = 128 M
  44. Depending on how much space your innodb indexes take up it may be safe
  45. to increase this value to up to 2 / 3 of total system memory
  46. MEMORY USAGE
  47. Max Memory Ever Allocated : 411 M
  48. Configured Max Per-thread Buffers : 250 M
  49. Configured Max Global Buffers : 160 M
  50. Configured Max Memory Limit : 410 M
  51. Physical Memory : 3.73 G
  52. Max memory limit seem to be within acceptable norms
  53. KEY BUFFER
  54. Current MyISAM index space = 9 K
  55. Current key_buffer_size = 16 M
  56. Key cache miss rate is 1 : 659
  57. Key buffer free ratio = 81 %
  58. Your key_buffer_size seems to be fine
  59. QUERY CACHE
  60. Query cache is supported but not enabled
  61. Perhaps you should set the query_cache_size
  62. SORT OPERATIONS
  63. Current sort_buffer_size = 512 K
  64. Current read_rnd_buffer_size = 512 K
  65. Sort buffer seems to be fine
  66. JOINS
  67. Current join_buffer_size = 132.00 K
  68. You have had 398 queries where a join could not use an index properly
  69. You should enable \"log-queries-not-using-indexes\"
  70. Then look for non indexed joins in the slow query log.
  71. If you are unable to optimize your queries you may want to increase your
  72. join_buffer_size to accommodate larger joins in one pass.
  73. Note! This script will still suggest raising the join_buffer_size when
  74. ANY joins not using indexes are found.
  75. OPEN FILES LIMIT
  76. Current open_files_limit = 60000 files
  77. The open_files_limit should typically be set to at least 2x-3x
  78. that of table_cache if you have heavy MyISAM usage.
  79. Your open_files_limit value seems to be fine
  80. TABLE CACHE
  81. Current table_open_cache = 64 tables
  82. Current table_definition_cache = 400 tables
  83. You have a total of 0 tables
  84. You have 64 open tables.
  85. Current table_cache hit rate is 0%
  86. , while 100% of your table cache is in use
  87. You should probably increase your table_cache
  88. TEMP TABLES
  89. Current max_heap_table_size = 16 M
  90. Current tmp_table_size = 16 M
  91. Of 303828 temp tables, 1% were created on disk
  92. Created disk tmp tables ratio seems fine
  93. TABLE SCANS
  94. Current read_buffer_size = 256 K
  95. Current table scan ratio = 60 : 1
  96. read_buffer_size seems to be fine
  97. TABLE LOCKING
  98. Current Lock Wait ratio = 1 : 12920
  99. Your table locking seems to be fine


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26250550/viewspace-1073948/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-11-04

  • 博文量
    486
  • 访问量
    1184123