mysql狀態(tài)怎么查看

這篇文章主要介紹“MySQL狀態(tài)怎么查看”,在日常操作中,相信很多人在mysql狀態(tài)怎么查看問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”mysql狀態(tài)怎么查看”的疑惑有所幫助!接下來,請跟著小編一起來學(xué)習(xí)吧!

創(chuàng)新互聯(lián)專注為客戶提供全方位的互聯(lián)網(wǎng)綜合服務(wù),包含不限于網(wǎng)站設(shè)計、成都網(wǎng)站制作、瓊山網(wǎng)絡(luò)推廣、小程序制作、瓊山網(wǎng)絡(luò)營銷、瓊山企業(yè)策劃、瓊山品牌公關(guān)、搜索引擎seo、人物專訪、企業(yè)宣傳片、企業(yè)代運(yùn)營等,從售前售中售后,我們都將竭誠為您服務(wù),您的肯定,是我們最大的嘉獎;創(chuàng)新互聯(lián)為所有大學(xué)生創(chuàng)業(yè)者提供瓊山建站搭建服務(wù),24小時服務(wù)熱線:18980820575,官方網(wǎng)址:muchs.cn

運(yùn)行中的mysql狀態(tài)查看

對正在運(yùn)行的mysql進(jìn)行監(jiān)控,其中一個方式就是查看mysql運(yùn)行狀態(tài)。 

(1)QPS(每秒Query量) 

QPS = Questions(or Queries) / seconds 

mysql > show  global  status like 'Question%'; 

(2)TPS(每秒事務(wù)量) 

TPS = (Com_commit + Com_rollback) / seconds 

mysql > show global status like 'Com_commit'; 

mysql > show global status like 'Com_rollback'; 

(3)key Buffer 命中率 

mysql>show  global   status  like   'key%'; 

key_buffer_read_hits = (1-key_reads / key_read_requests) * 100% 

key_buffer_write_hits = (1-key_writes / key_write_requests) * 100% 

(4)InnoDB Buffer命中率 

mysql> show status like 'innodb_buffer_pool_read%'; 

innodb_buffer_read_hits = (1 - innodb_buffer_pool_reads / innodb_buffer_pool_read_requests) * 100% 

(5)Query Cache命中率 

mysql> show status like 'Qcache%'; 

Query_cache_hits = (Qcahce_hits / (Qcache_hits + Qcache_inserts )) * 100%; 

(6)Table Cache狀態(tài)量 

mysql> show global  status like 'open%'; 

比較 open_tables  與 opend_tables 值 

(7)Thread Cache 命中率 

mysql> show global status like 'Thread%'; 

mysql> show global status like 'Connections'; 

Thread_cache_hits = (1 - Threads_created / connections ) * 100% 

(8)鎖定狀態(tài) 

mysql> show global  status like '%lock%'; 

Table_locks_waited/Table_locks_immediate=0.3%  如果這個比值比較大的話,說明表鎖造成的阻塞比較嚴(yán)重 

Innodb_row_lock_waits innodb行鎖,太大可能是間隙鎖造成的 

(9)復(fù)制延時量 

mysql > show slave status 

查看延時時間 

(10) Tmp Table 狀況(臨時表狀況) 

mysql > show status like 'Create_tmp%'; 

Created_tmp_disk_tables/Created_tmp_tables比值最好不要超過10%,如果Created_tmp_tables值比較大, 

可能是排序句子過多或者是連接句子不夠優(yōu)化 

(11) Binlog Cache 使用狀況 

mysql > show status like 'Binlog_cache%'; 

如果Binlog_cache_disk_use值不為0 ,可能需要調(diào)大 binlog_cache_size大小 

(12) Innodb_log_waits 量 

mysql > show status like 'innodb_log_waits'; 

Innodb_log_waits值不等于0的話,表明 innodb log  buffer 因為空間不足而等待 

比如命令: 

>#show global status; 

雖然可以使用: 

>#show global status like %...%; 

來過濾,但是對應(yīng)長長的list,每一項都代表什么意思,還是有必要弄清楚。

到此,關(guān)于“mysql狀態(tài)怎么查看”的學(xué)習(xí)就結(jié)束了,希望能夠解決大家的疑惑。理論與實(shí)踐的搭配能更好的幫助大家學(xué)習(xí),快去試試吧!若想繼續(xù)學(xué)習(xí)更多相關(guān)知識,請繼續(xù)關(guān)注創(chuàng)新互聯(lián)網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬?shí)用的文章!

網(wǎng)站標(biāo)題:mysql狀態(tài)怎么查看
當(dāng)前地址:http://muchs.cn/article30/ighhso.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動網(wǎng)站建設(shè)、建站公司、企業(yè)建站品牌網(wǎng)站制作、網(wǎng)站營銷、手機(jī)網(wǎng)站建設(shè)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

營銷型網(wǎng)站建設(shè)