mysql檢測工具tuning-primer.sh
mysql檢測工具tuning-primer.sh
tuning-primer.sh幫助我們去檢視一下mysql執行情況,產生報告,給出一些最佳化建議;
下載及使用:
1.wget
2.將tuning-primer.sh複製到my.cnf同級目錄
3.chmod +x tuning-primer.sh 執行:sh tuning-primer.sh
報告如下:
root@dbhostname:/opt/mysq/data> sh tuning-primer.sh all
Using login values from ~/.my.cnf
- INITIAL LOGIN ATTEMPT FAILED -
Testing for stored webmin passwords:
None Found
Could not auto detect login info!
Found potential sockets: /data/mysql/mysql.sock
/opt/mysql/data/mysql3307.sock
Using: /var/lib/mysql/mysql.sock
Would you like to provide a different socket?: [y/N] y //指定mysql自己的socket目錄
Socket: /opt/mysql/data/mysql3307.sock
Do you have your login handy ? [y/N] : y //輸入username/passwd
User: root
Password: 123456
Would you like me to create a ~/.my.cnf file for you? [y/N] : n //不要再建立my.cnf 檔案
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
MySQL Version 5.1.48-mysql5148-log x86_64
Uptime = 14 days 5 hrs 41 min 11 sec
Avg. qps = 0
Total Questions = 279
Threads Connected = 2
Server has been running for over 48hrs.
It should be safe to follow these recommendations
To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html
Visit
for info about MySQL's Enterprise Monitoring and Advisory Service
SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 1.000000 sec.
You have 0 out of 300 that take longer than 1.000000 sec. to complete
Your long_query_time seems to be fine
BINARY UPDATE LOG
The binary update log is enabled
WORKER THREADS
Current thread_cache_size = 0
Current threads_cached = 0
Current threads_per_sec = 1
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 151
Current threads_connected = 2
Historic max_used_connections = 2
The number of used connections is 1% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating
INNODB STATUS
Current InnoDB index space = 52 M
Current InnoDB data space = 58 M
Current InnoDB buffer pool free = 77 %
Current innodb_buffer_pool_size = 16 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory
MEMORY USAGE
Max Memory Ever Allocated : 45 M
Configured Max Per-thread Buffers : 250 M
Configured Max Global Buffers : 42 M
Configured Max Memory Limit : 292 M
Physical Memory : 7.79 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 338 K
Current key_buffer_size = 16 M
Key cache miss rate is 1 : 2
Key buffer free ratio = 81 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is supported but not enabled
Perhaps you should set the query_cache_size
SORT OPERATIONS
Current sort_buffer_size = 512 K
Current read_rnd_buffer_size = 512 K
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly
OPEN FILES LIMIT
Current open_files_limit = 100001 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_open_cache = 64 tables
Current table_definition_cache = 256 tables
You have a total of 90 tables
You have 64 open tables.
Current table_cache hit rate is 3%
, while 100% of your table cache is in use
You should probably increase your table_cache
TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 16 M
Of 2310 temp tables, 9% were created on disk
Created disk tmp tables ratio seems fine
TABLE SCANS
Current read_buffer_size = 256 K
Current table scan ratio = 5 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 0 : 558
Your table locking seems to be fine
zz:作者:海底蒼鷹
地址:http://blog.51yip.com/mysql/1224.html
tuning-primer.sh幫助我們去檢視一下mysql執行情況,產生報告,給出一些最佳化建議;
下載及使用:
1.wget
2.將tuning-primer.sh複製到my.cnf同級目錄
3.chmod +x tuning-primer.sh 執行:sh tuning-primer.sh
報告如下:
root@dbhostname:/opt/mysq/data> sh tuning-primer.sh all
Using login values from ~/.my.cnf
- INITIAL LOGIN ATTEMPT FAILED -
Testing for stored webmin passwords:
None Found
Could not auto detect login info!
Found potential sockets: /data/mysql/mysql.sock
/opt/mysql/data/mysql3307.sock
Using: /var/lib/mysql/mysql.sock
Would you like to provide a different socket?: [y/N] y //指定mysql自己的socket目錄
Socket: /opt/mysql/data/mysql3307.sock
Do you have your login handy ? [y/N] : y //輸入username/passwd
User: root
Password: 123456
Would you like me to create a ~/.my.cnf file for you? [y/N] : n //不要再建立my.cnf 檔案
-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -
MySQL Version 5.1.48-mysql5148-log x86_64
Uptime = 14 days 5 hrs 41 min 11 sec
Avg. qps = 0
Total Questions = 279
Threads Connected = 2
Server has been running for over 48hrs.
It should be safe to follow these recommendations
To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.1/en/server-system-variables.html
Visit
for info about MySQL's Enterprise Monitoring and Advisory Service
SLOW QUERIES
The slow query log is NOT enabled.
Current long_query_time = 1.000000 sec.
You have 0 out of 300 that take longer than 1.000000 sec. to complete
Your long_query_time seems to be fine
BINARY UPDATE LOG
The binary update log is enabled
WORKER THREADS
Current thread_cache_size = 0
Current threads_cached = 0
Current threads_per_sec = 1
Historic threads_per_sec = 0
Your thread_cache_size is fine
MAX CONNECTIONS
Current max_connections = 151
Current threads_connected = 2
Historic max_used_connections = 2
The number of used connections is 1% of the configured maximum.
You are using less than 10% of your configured max_connections.
Lowering max_connections could help to avoid an over-allocation of memory
See "MEMORY USAGE" section to make sure you are not over-allocating
INNODB STATUS
Current InnoDB index space = 52 M
Current InnoDB data space = 58 M
Current InnoDB buffer pool free = 77 %
Current innodb_buffer_pool_size = 16 M
Depending on how much space your innodb indexes take up it may be safe
to increase this value to up to 2 / 3 of total system memory
MEMORY USAGE
Max Memory Ever Allocated : 45 M
Configured Max Per-thread Buffers : 250 M
Configured Max Global Buffers : 42 M
Configured Max Memory Limit : 292 M
Physical Memory : 7.79 G
Max memory limit seem to be within acceptable norms
KEY BUFFER
Current MyISAM index space = 338 K
Current key_buffer_size = 16 M
Key cache miss rate is 1 : 2
Key buffer free ratio = 81 %
Your key_buffer_size seems to be fine
QUERY CACHE
Query cache is supported but not enabled
Perhaps you should set the query_cache_size
SORT OPERATIONS
Current sort_buffer_size = 512 K
Current read_rnd_buffer_size = 512 K
Sort buffer seems to be fine
JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly
OPEN FILES LIMIT
Current open_files_limit = 100001 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_open_cache = 64 tables
Current table_definition_cache = 256 tables
You have a total of 90 tables
You have 64 open tables.
Current table_cache hit rate is 3%
, while 100% of your table cache is in use
You should probably increase your table_cache
TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 16 M
Of 2310 temp tables, 9% were created on disk
Created disk tmp tables ratio seems fine
TABLE SCANS
Current read_buffer_size = 256 K
Current table scan ratio = 5 : 1
read_buffer_size seems to be fine
TABLE LOCKING
Current Lock Wait ratio = 0 : 558
Your table locking seems to be fine
zz:作者:海底蒼鷹
地址:http://blog.51yip.com/mysql/1224.html
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29514088/viewspace-1801699/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Mysql效能檢測指令碼tuning-primer.sh 使用MySql指令碼
- 文章相似度檢測,相似度檢測工具,原創度檢測工具
- 【工具】MySQL 壓測工具之mydbtestMySql
- CMS漏洞檢測工具 – CMSmap
- 原創文章檢測工具,原創文章檢測軟體,檢測文章相似度
- 文章檢測工具有哪些?檢測文章,分發更快捷
- ESlint語法檢測工具EsLint
- PWA 可用性檢測工具
- 手機流量檢測工具GlassWire
- php程式碼檢測工具使用PHP
- web效能檢測工具lighthouseWeb
- 硬碟檢測工具:SMART Utility for mac硬碟Mac
- MySQL 效能測試工具mysqlslapMySql
- 微信域名檢測線上批次檢測如何實現?——利用域名檢測api介面實現批次檢測工具教程API
- 多語言檢測工具實踐
- 映象規範檢測工具釋出
- 【Sonar程式碼質量檢測工具】
- 檔案包含漏洞檢測工具fimap
- Linux命令列效能檢測工具Linux命令列
- mysql行鎖和死鎖檢測MySql
- 檢測mysql狀態的指令碼MySql指令碼
- MySQL基準測試工具sysbenchMySql
- Mysql 壓力測試工具sysbenchMySql
- 【Mysql】sysbench基準測試工具MySql
- 【工具】基準測試工具之tpcc-mysqlMySql
- mysql效能測試工具之tpcc-mysql薦MySql
- SSL證書檢測工具有什麼用?如何檢測SSL證書?
- Nima谷蛋白檢測工具:谷蛋白過敏患者可用這個檢測食物
- [原創]發一個批量檢測xcode ghost病毒的檢測工具XCode
- 使用pt工具檢測MySQL主從延遲(r12筆記第7天)MySql筆記
- 免費文章原創度檢測工具
- CrazyDiskInfo硬碟檢測工具 安裝記錄硬碟
- [PHP 安全] pcc —— PHP 安全配置檢測工具PHP
- 瀏覽器開發者工具開啟檢測瀏覽器
- 網路入侵檢測規避工具fragrouter
- 快取區溢位檢測工具BED快取
- 11款網站死鏈檢測工具網站
- JavaScript記憶體洩漏檢測工具JavaScript記憶體