{"id":234911,"date":"2022-02-04T09:41:48","date_gmt":"2022-02-04T01:41:48","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=234911"},"modified":"2022-01-29T15:42:27","modified_gmt":"2022-01-29T07:42:27","slug":"proc-diskstats","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/proc-diskstats.html","title":{"rendered":"\/proc\/diskstats\u5404\u5b57\u6bb5\u89e3\u6790"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4eca\u5929\u6765\u8bf4\u8bf4\/proc\/diskstats\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u7528\u4e8e\u663e\u793a\u78c1\u76d8\u3001\u5206\u533a\u548c\u7edf\u8ba1\u4fe1\u606f<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

    [root@VM_54_118_centos ~]# cat \/proc\/diskstats\r\n    253 0 vda 222026 464 14148933 2387763 15975930 14162283 261012993 54210046 0 3186549 56602267\r\n    253 1 vda1 221980 464 14145765 2387590 15807400 14162283 261012993 54192784 0 3173037 56597649\r\n    253 16 vdb 1946 1 1330738 4704 332744 328392 9197624 303420 0 98203 308117\r\n    11 0 sr0 122 0 2012 92 0 0 0 0 0 91 92\r\n    7 0 loop0 0 0 0 0 0 0 0 0 0 0 0\r\n<\/pre>\n

\uff08\u63d0\u524d\u8bf4\u660e\uff1a\u7531\u4e8e\u6211\u7684\u6d4b\u8bd5\u4e3b\u673a\u662f\u4e91\u4e3b\u673a\uff0c\u6240\u4ee5\u78c1\u76d8\u7684\u683c\u5f0f\u662fvdX,\u5982\u679c\u662f\u672c\u5730\u78c1\u76d8\u663e\u793a\u7684\u5e94\u8be5\u662fsdX\uff09
\nvda\u4e3a\u6574\u4e2a\u865a\u62df\u78c1\u76d8\u7684\u7edf\u8ba1\u4fe1\u606f\uff0cvda1\u4e3a\u7b2c\u4e00\u4e2a\u5206\u533a\u7684\u7edf\u8ba1\u4fe1\u606f\uff1b<\/p>\n

\u4e0a\u9762\u8fd9\u4e32\u5b57\u7b26\u4ece\u5de6\u5f80\u53f3\u4f9d\u6b21\u8868\u793a:<\/p>\n

253\uff1a\u4e3b\u8bbe\u5907\u53f7\uff0c\u4e0d\u540c\u7c7b\u522b\u8bbe\u5907\u7f16\u53f7\u4e0d\u4e00\u6837\uff0c\u865a\u62df\u78c1\u76d8\u7edf\u4e00\u4e3a253\uff0c\u78c1\u76d8\u7edf\u4e00\u4e3a8\uff0c\u73af\u56de\u8bbe\u5907\u7edf\u4e00\u4e3a7<\/p>\n

1\uff1a\u6b21\u8bbe\u5907\u53f7,\u6bd4\u5982vda\u7684vda\u4e3a0,vda1\u4f4d1\uff0cvda2\u4e3a2.\u4e5f\u5c31\u662f\u4e00\u4e2a\u7269\u7406\u78c1\u76d8\u540e\u9762\u7684\u5206\u533a\uff0c\u7f16\u53f7\u4f9d\u6b21\u9012\u589e<\/p>\n

vda\uff1a\u8bbe\u5907\u540d\u3002\u4e00\u822cide\u63a5\u53e3\u7684\u4ee5hd[a-d]\u53e3\u547d\u540d\uff0cscsi\u548csata\u63a5\u53e3\u7684\u4ee5sd[a-z]\u547d\u540d\u3002<\/p>\n

\u8f93\u51fa\u4fe1\u606f\u8bf4\u660e\uff1a<\/p>\n

\/proc\/diskstats\u6587\u4ef6\u6bd4\/sys\/block\/sda\/stat\u6587\u4ef6\u591a3\u4e2a\u57df\uff0c\u4ece\u5de6\u81f3\u53f3\u5206\u522b\u5bf9\u5e94\u4e3b\u8bbe\u5907\u53f7\uff0c\u6b21\u8bbe\u5907\u53f7\u548c\u8bbe\u5907\u540d\u79f0\u3002\u540e\u7eed\u768411\u4e2a\u57df\u5728\u8fd9\u4e24\u4e2a\u6587\u4ef6\u91cc\u662f\u76f8\u540c\u7684\uff0c\u5b83\u4eec\u7684\u51fd\u4e49\u5c06\u5728\u4e0b\u9762\u89e3\u91ca\u3002\u9664\u4e86\u7b2c9\u4e2a\u57df\uff0c\u6240\u6709\u7684\u57df\u90fd\u662f\u4ece\u542f\u52a8\u65f6\u7684\u7d2f\u79ef\u503c\u3002<\/p>\n

    [root@VM_54_118_centos ~]# cat \/sys\/block\/vda\/stat\r\n    222026 464 14148933 2387763 15979071 14164711 261058873 54244380 0 3187473 56636601\r\n<\/pre>\n

\u4e0b\u9762\u662f\u540e\u9762\u768411\u4e2a\u57df\u7684\u8f93\u51fa\u89e3\u91ca<\/p>\n

\u7b2c1\u4e2a\u57df\uff1a\u8bfb\u5b8c\u6210\u6b21\u6570 \u2014\u2013 \u8bfb\u78c1\u76d8\u7684\u6b21\u6570\uff0c\u6210\u529f\u5b8c\u6210\u8bfb\u7684\u603b\u6b21\u6570\u3002<\/strong><\/span><\/div>\n
  \uff08number of issued reads. This is the total number of reads completed successfully.\uff09<\/pre>\n
\u7b2c2\u4e2a\u57df\uff1a\u5408\u5e76\u8bfb\u5b8c\u6210\u6b21\u6570\uff0c \u7b2c6\u4e2a\u57df\uff1a\u5408\u5e76\u5199\u5b8c\u6210\u6b21\u6570\u3002\u4e3a\u4e86\u6548\u7387\u53ef\u80fd\u4f1a\u5408\u5e76\u76f8\u90bb\u7684\u8bfb\u548c\u5199\u3002\u4ece\u800c\u4e24\u6b214K\u7684\u8bfb\u5728\u5b83\u6700\u7ec8\u88ab\u5904\u7406\u5230\u78c1\u76d8\u4e0a\u4e4b\u524d\u53ef\u80fd\u4f1a\u53d8\u6210\u4e00\u6b218K\u7684\u8bfb\uff0c\u624d\u88ab\u8ba1\u6570\uff08\u548c\u6392\u961f\uff09\uff0c\u56e0\u6b64\u53ea\u6709\u4e00\u6b21I\/O\u64cd\u4f5c\u3002\u8fd9\u4e2a\u57df\u4f7f\u4f60\u77e5\u9053\u8fd9\u6837\u7684\u64cd\u4f5c\u6709\u591a\u9891\u7e41\u3002<\/strong><\/span><\/div>\n
 \uff08number of reads merged\uff09<\/pre>\n
\u7b2c3\u4e2a\u57df\uff1a\u8bfb\u6247\u533a\u7684\u6b21\u6570\uff0c\u6210\u529f\u8bfb\u8fc7\u7684\u6247\u533a\u603b\u6b21\u6570\u3002<\/strong><\/span><\/div>\n
\uff08number of sectors read. This is the total number of sectors read successfully.\uff09<\/pre>\n
\u7b2c4\u4e2a\u57df\uff1a\u8bfb\u82b1\u8d39\u7684\u6beb\u79d2\u6570\uff0c\u8fd9\u662f\u6240\u6709\u8bfb\u64cd\u4f5c\u6240\u82b1\u8d39\u7684\u6beb\u79d2\u6570\uff08\u7528__make_request()\u5230end_that_request_last()\u6d4b\u91cf\uff09\u3002<\/strong><\/span><\/div>\n
\uff08number of milliseconds spent reading. This is the total number of milliseconds spent by all reads (as measured from __make_request() to end_that_request_last()).\uff09<\/pre>\n
\u7b2c5\u4e2a\u57df\uff1a\u5199\u5b8c\u6210\u6b21\u6570 \u2014-\u5199\u5b8c\u6210\u7684\u6b21\u6570\uff0c\u6210\u529f\u5199\u5b8c\u6210\u7684\u603b\u6b21\u6570\u3002<\/strong><\/span><\/div>\n
 \uff08number of writes completed. This is the total number of writes completed successfully.\uff09<\/pre>\n
\u7b2c6\u4e2a\u57df\uff1a\u5408\u5e76\u5199\u5b8c\u6210\u6b21\u6570 \u2014\u2013\u5408\u5e76\u5199\u6b21\u6570\u3002<\/strong><\/span><\/div>\n
\uff08number of writes merged Reads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I\/O. This field lets you know how often this was done.\uff09<\/pre>\n
\u7b2c7\u4e2a\u57df\uff1a\u5199\u6247\u533a\u6b21\u6570 \u2014- \u5199\u6247\u533a\u7684\u6b21\u6570\uff0c\u6210\u529f\u5199\u6247\u533a\u603b\u6b21\u6570\u3002<\/strong><\/span><\/div>\n
 \uff08number of sectors written. This is the total number of sectors written successfully.\uff09<\/pre>\n
\u7b2c8\u4e2a\u57df\uff1a\u5199\u64cd\u4f5c\u82b1\u8d39\u7684\u6beb\u79d2\u6570 \u2014 \u5199\u82b1\u8d39\u7684\u6beb\u79d2\u6570\uff0c\u8fd9\u662f\u6240\u6709\u5199\u64cd\u4f5c\u6240\u82b1\u8d39\u7684\u6beb\u79d2\u6570\uff08\u7528__make_request()\u5230end_that_request_last()\u6d4b\u91cf\uff09\u3002<\/strong><\/span><\/div>\n
\uff08number of milliseconds spent writing This is the total number of milliseconds spent by all writes (as measured from __make_request() to end_that_request_last()).\uff09<\/pre>\n
\u7b2c9\u4e2a\u57df\uff1a\u6b63\u5728\u5904\u7406\u7684\u8f93\u5165\/\u8f93\u51fa\u8bf7\u6c42\u6570 \u2014 -I\/O\u7684\u5f53\u524d\u8fdb\u5ea6\uff0c\u53ea\u6709\u8fd9\u4e2a\u57df\u5e94\u8be5\u662f0\u3002\u5f53\u8bf7\u6c42\u88ab\u4ea4\u7ed9\u9002\u5f53\u7684request_queue_t\u65f6\u589e\u52a0\u548c\u8bf7\u6c42\u5b8c\u6210\u65f6\u51cf\u5c0f\u3002<\/strong><\/span><\/div>\n
 \uff08number of I\/Os currently in progress. The only field that should go to zero. Incremented as requests are given to appropriate request_queue_t and decremented as they finish.\uff09<\/pre>\n
\u7b2c10\u4e2a\u57df\uff1a\u8f93\u5165\/\u8f93\u51fa\u64cd\u4f5c\u82b1\u8d39\u7684\u6beb\u79d2\u6570 \u2014-\u82b1\u5728I\/O\u64cd\u4f5c\u4e0a\u7684\u6beb\u79d2\u6570\uff0c\u8fd9\u4e2a\u57df\u4f1a\u589e\u957f\u53ea\u8981field 9\u4e0d\u4e3a0\u3002<\/strong><\/span><\/div>\n
\uff08number of milliseconds spent doing I\/Os. This field is increased so long as field 9 is nonzero.\uff09<\/pre>\n
\u7b2c11\u4e2a\u57df\uff1a\u8f93\u5165\/\u8f93\u51fa\u64cd\u4f5c\u82b1\u8d39\u7684\u52a0\u6743\u6beb\u79d2\u6570 \u2014\u2013 \u52a0\u6743\uff0c \u82b1\u5728I\/O\u64cd\u4f5c\u4e0a\u7684\u6beb\u79d2\u6570\uff0c\u5728\u6bcf\u6b21I\/O\u5f00\u59cb\uff0cI\/O\u7ed3\u675f\uff0cI\/O\u5408\u5e76\u65f6\u8fd9\u4e2a\u57df\u90fd\u4f1a\u589e\u52a0\u3002\u8fd9\u53ef\u4ee5\u7ed9I\/O\u5b8c\u6210\u65f6\u95f4\u548c\u5b58\u50a8\u90a3\u4e9b\u53ef\u4ee5\u7d2f\u79ef\u7684\u63d0\u4f9b\u4e00\u4e2a\u4fbf\u5229\u7684\u6d4b\u91cf\u6807\u51c6\u3002<\/strong><\/span><\/div>\n
 \uff08number of milliseconds spent doing I\/Os. This field is incremented at each I\/O start, I\/O completion, I\/O merge, or read of these stats by the number of I\/Os in progress (field 9) times the number of milliseconds spent doing I\/O since the last update of this field. This can provide an easy measure of both I\/O completion time and the backlog that may be accumulating.\uff09<\/pre>\n","protected":false},"excerpt":{"rendered":"

[root@VM_54_118_centos ~]# cat \/proc\/diskstats 253 0 vd […]<\/p>\n","protected":false},"author":1469,"featured_media":234914,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-234911","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/234911","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1469"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=234911"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/234911\/revisions"}],"predecessor-version":[{"id":235180,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/234911\/revisions\/235180"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/234914"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=234911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=234911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=234911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}