{"id":111645,"date":"2026-10-01T12:57:06","date_gmt":"2026-10-01T04:57:06","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/111645.html"},"modified":"2026-10-01T12:57:06","modified_gmt":"2026-10-01T04:57:06","slug":"8-i-o%e6%80%a7%e8%83%bd%e4%bc%98%e5%8c%96%ef%bc%9a%e5%bc%82%e6%ad%a5i-o%e3%80%81io_uring%e3%80%81%e9%9b%b6%e6%8b%b7%e8%b4%9d%e3%80%81%e7%a3%81%e7%9b%98%e8%b0%83%e5%ba%a6","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/111645.html","title":{"rendered":"8. I\/O\u6027\u80fd\u4f18\u5316\uff1a\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6"},"content":{"rendered":"<p>\u804a\u5230I\/O\u6027\u80fd\u4f18\u5316&#xff0c;\u6211\u5f97\u5148\u5766\u767d\u4e00\u4ef6\u4e8b\u3002\u65e9\u4e9b\u5e74\u6211\u505a\u540e\u7aef\u670d\u52a1\u65f6&#xff0c;\u603b\u628a\u7cbe\u529b\u653e\u5728CPU\u8ba1\u7b97\u548c\u5185\u5b58\u4e0a&#xff0c;\u89c9\u5f97\u78c1\u76d8I\/O\u561b&#xff0c;\u6162\u5c31\u6162\u70b9&#xff0c;\u5fcd\u5fcd\u5c31\u8fc7\u53bb\u4e86\u3002\u76f4\u5230\u6709\u4e00\u6b21\u7ebf\u4e0a\u670d\u52a1\u56e0\u4e3a\u65e5\u5fd7\u5199\u5165\u628a\u6574\u4e2a\u7cfb\u7edf\u5361\u6b7b&#xff0c;\u6211\u624d\u771f\u6b63\u610f\u8bc6\u5230\u2014\u2014I\/O\u624d\u662f\u73b0\u4ee3\u7cfb\u7edf\u7684\u9690\u5f62\u74f6\u9888\u3002<\/p>\n<p>\u4eca\u5929\u54b1\u4eec\u5c31\u628a\u8fd9\u5757\u786c\u9aa8\u5934\u5543\u4e0b\u6765\u3002\u6211\u4f1a\u4ece\u56db\u4e2a\u7ef4\u5ea6\u5c55\u5f00&#xff1a;\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6\u3002\u6bcf\u4e2a\u90fd\u662f\u5b9e\u6218\u4e2d\u9ad8\u9891\u51fa\u73b0\u7684\u4f18\u5316\u70b9\u3002<\/p>\n<p>\u6838\u5fc3\u89c2\u70b9&#xff1a;I\/O\u4f18\u5316\u7684\u672c\u8d28&#xff0c;\u662f\u51cf\u5c11\u7b49\u5f85\u3001\u51cf\u5c11\u62f7\u8d1d\u3001\u51cf\u5c11\u4e0a\u4e0b\u6587\u5207\u6362\u3002\u8bf4\u767d\u4e86&#xff0c;\u5c31\u662f\u8ba9CPU\u522b\u95f2\u7740\u7b49\u6570\u636e&#xff0c;\u8ba9\u6570\u636e\u522b\u5728\u5185\u5b58\u91cc\u6765\u56de\u5012\u817e\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"598\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261001045705-6abde821153ad.png\" width=\"1097\" \/><\/p>\n<h4>8.1 \u5f02\u6b65I\/O&#xff1a;\u522b\u518d\u8ba9CPU\u50bb\u7b49\u4e86<\/h4>\n<p>\u4f20\u7edf\u7684\u540c\u6b65I\/O\u6a21\u578b&#xff0c;\u8bf4\u767d\u4e86\u5c31\u662f\u300c\u53d1\u4e00\u4e2a\u8bf7\u6c42&#xff0c;\u7b49\u4e00\u4e2a\u7ed3\u679c\u300d\u3002CPU\u5728\u8fd9\u671f\u95f4\u5565\u4e5f\u5e72\u4e0d\u4e86&#xff0c;\u53ea\u80fd\u5e72\u77aa\u773c\u3002\u6211\u89c1\u8fc7\u4e0d\u5c11\u65b0\u624b\u5199\u7684\u7f51\u7edc\u670d\u52a1&#xff0c;\u4e00\u4e2a\u7ebf\u7a0b\u5904\u7406\u4e00\u4e2a\u8fde\u63a5&#xff0c;\u8fde\u63a5\u591a\u4e86\u7ebf\u7a0b\u6c60\u7206\u70b8&#xff0c;\u6027\u80fd\u76f4\u7ebf\u4e0b\u964d\u3002<\/p>\n<p>\u5f02\u6b65I\/O\u7684\u6838\u5fc3\u601d\u8def\u662f&#xff1a;\u4f60\u53d1\u4f60\u7684\u8bf7\u6c42&#xff0c;\u6211\u5e72\u6211\u7684\u6d3b&#xff0c;\u6570\u636e\u51c6\u5907\u597d\u4e86\u901a\u77e5\u6211\u3002\u8fd9\u6837CPU\u5c31\u80fd\u5728\u7b49\u5f85\u671f\u95f4\u5904\u7406\u5176\u4ed6\u4efb\u52a1&#xff0c;\u541e\u5410\u91cf\u81ea\u7136\u4e0a\u53bb\u4e86\u3002<\/p>\n<p>\u6211\u7684\u7ecf\u9a8c&#xff1a;\u5728Linux\u4e0b\u505a\u5f02\u6b65I\/O&#xff0c;\u6211\u4e60\u60ef\u7528epoll\u914d\u5408\u975e\u963b\u585esocket\u3002Windows\u4e0b\u5219\u662fIOCP\u3002\u9009\u5bf9\u5e73\u53f0\u7684\u539f\u751f\u673a\u5236&#xff0c;\u6bd4\u5957\u4e00\u5c42\u62bd\u8c61\u5c42\u8981\u9ad8\u6548\u5f97\u591a\u3002\u66fe\u7ecf\u6709\u4e2a\u9879\u76ee\u7528\u4e86libuv\u505a\u8de8\u5e73\u53f0&#xff0c;\u7ed3\u679c\u6027\u80fd\u53cd\u800c\u4e0d\u5982\u76f4\u63a5\u7528epoll\u2014\u2014\u62bd\u8c61\u5c42\u5e26\u6765\u7684\u5f00\u9500\u6709\u65f6\u5019\u5f97\u4e0d\u507f\u5931\u3002<\/p>\n<p>\u5f02\u6b65I\/O\u7684\u5178\u578b\u5b9e\u73b0\u65b9\u5f0f&#xff1a;<\/p>\n<ul>\n<li>select\/poll&#xff1a;\u8001\u724c\u65b9\u6848&#xff0c;\u4f46\u8fde\u63a5\u6570\u591a\u4e86\u6027\u80fd\u4e0b\u964d\u660e\u663e\u3002\u6211\u5efa\u8bae1000\u8fde\u63a5\u4ee5\u5185\u53ef\u4ee5\u8003\u8651\u3002<\/li>\n<li>epoll&#xff1a;Linux\u4e0b\u7684\u4e8b\u5b9e\u6807\u51c6\u3002\u4e8b\u4ef6\u9a71\u52a8&#xff0c;\u53ea\u8fd4\u56de\u5c31\u7eea\u7684fd&#xff0c;\u6548\u7387\u6781\u9ad8\u3002<\/li>\n<li>kqueue&#xff1a;BSD\/macOS\u4e0b\u7684\u65b9\u6848&#xff0c;\u529f\u80fd\u548cepoll\u7c7b\u4f3c\u3002<\/li>\n<li>IOCP&#xff1a;Windows\u4e0b\u7684\u5f02\u6b65I\/O\u6a21\u578b&#xff0c;\u771f\u6b63\u610f\u4e49\u4e0a\u7684\u300c\u5f02\u6b65\u300d\u2014\u2014\u8fde\u7b49\u5f85\u90fd\u4e0d\u9700\u8981\u3002<\/li>\n<\/ul>\n<p>\u55ef&#xff0c;\u8fd9\u91cc\u8981\u6ce8\u610f&#xff1a;\u5f02\u6b65I\/O\u867d\u7136\u597d&#xff0c;\u4f46\u4ee3\u7801\u590d\u6742\u5ea6\u4f1a\u4e0a\u5347\u3002\u56de\u8c03\u5730\u72f1\u3001\u72b6\u6001\u7ba1\u7406\u3001\u9519\u8bef\u5904\u7406&#xff0c;\u90fd\u662f\u5751\u3002\u6211\u5efa\u8bae\u7528\u534f\u7a0b\u6216\u8005future\/promise\u6a21\u5f0f\u6765\u5c01\u88c5&#xff0c;\u4ee3\u7801\u53ef\u8bfb\u6027\u4f1a\u597d\u5f88\u591a\u3002<\/p>\n<h4>8.2 io_uring&#xff1a;Linux\u4e0b\u7684\u5f02\u6b65I\/O\u65b0\u8d35<\/h4>\n<p>\u8bf4\u5230io_uring&#xff0c;\u6211\u5f97\u597d\u597d\u5938\u5938\u5b83\u3002\u8fd9\u662fLinux 5.1\u5f15\u5165\u7684\u5f02\u6b65I\/O\u6846\u67b6&#xff0c;\u53ef\u4ee5\u8bf4\u662f\u8fd1\u5e74\u6765Linux I\/O\u5b50\u7cfb\u7edf\u6700\u5927\u7684\u9769\u65b0\u3002<\/p>\n<p>\u4f20\u7edf\u5f02\u6b65I\/O&#xff08;\u6bd4\u5982libaio&#xff09;\u6709\u4e2a\u95ee\u9898&#xff1a;\u6bcf\u6b21\u63d0\u4ea4I\/O\u8bf7\u6c42\u8fd8\u662f\u8981\u505a\u7cfb\u7edf\u8c03\u7528\u3002\u7cfb\u7edf\u8c03\u7528\u8fd9\u73a9\u610f\u513f&#xff0c;\u4e00\u6b21\u4e24\u6b21\u8fd8\u597d&#xff0c;\u9891\u7e41\u4e86\u5c31\u662f\u6027\u80fd\u6740\u624b\u3002io_uring\u7684\u601d\u8def\u5f88\u5de7\u5999\u2014\u2014\u7528\u5171\u4eab\u5185\u5b58\u7684\u73af\u5f62\u961f\u5217\u6765\u901a\u4fe1\u3002<\/p>\n<p>\u5177\u4f53\u6765\u8bf4&#xff0c;io_uring\u7ef4\u62a4\u4e86\u4e24\u4e2a\u961f\u5217&#xff1a;<\/p>\n<ul>\n<li>\u63d0\u4ea4\u961f\u5217&#xff08;SQ&#xff09;&#xff1a;\u5e94\u7528\u7a0b\u5e8f\u628aI\/O\u8bf7\u6c42\u653e\u8fdb\u53bb\u3002<\/li>\n<li>\u5b8c\u6210\u961f\u5217&#xff08;CQ&#xff09;&#xff1a;\u5185\u6838\u628a\u5904\u7406\u7ed3\u679c\u653e\u8fdb\u53bb\u3002<\/li>\n<\/ul>\n<p>\u5e94\u7528\u7a0b\u5e8f\u53ea\u9700\u8981\u5f80SQ\u91cc\u5199\u6570\u636e&#xff0c;\u7136\u540e\u4eceCQ\u91cc\u8bfb\u7ed3\u679c\u3002\u6574\u4e2a\u8fc7\u7a0b\u53ef\u4ee5\u505a\u5230\u96f6\u7cfb\u7edf\u8c03\u7528\u2014\u2014\u9664\u4e86\u521d\u59cb\u5316\u7684\u65f6\u5019\u3002\u8fd9\u6bd4\u4f20\u7edf\u65b9\u5f0f\u7701\u4e86\u591a\u5c11\u4e0a\u4e0b\u6587\u5207\u6362&#xff1f;\u4f60\u60f3\u60f3\u770b\u3002<\/p>\n<p>\u6027\u80fd\u5bf9\u6bd4&#xff1a;\u6211\u5728\u4e00\u4e2a\u9ad8\u5e76\u53d1\u65e5\u5fd7\u7cfb\u7edf\u9879\u76ee\u4e2d\u505a\u8fc7\u6d4b\u8bd5\u3002\u7528epoll&#043;\u540c\u6b65\u5199&#xff0c;\u5355\u673a\u541e\u5410\u7ea68\u4e07QPS\u3002\u6362\u6210io_uring\u540e&#xff0c;\u76f4\u63a5\u98d9\u523022\u4e07QPS\u3002\u63d0\u5347\u63a5\u8fd13\u500d\u3002\u5f53\u7136&#xff0c;\u8fd9\u8ddf\u573a\u666f\u6709\u5173&#xff0c;\u4f46io_uring\u7684\u6f5c\u529b\u53ef\u89c1\u4e00\u6591\u3002<\/p>\n<p>\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684io_uring\u4f7f\u7528\u793a\u4f8b&#xff1a;<\/p>\n<p>\/\/ \u521d\u59cb\u5316io_uring<br \/>\nstruct io_uring ring;<br \/>\nio_uring_queue_init(1024, &amp;ring, 0);<\/p>\n<p>\/\/ \u51c6\u5907\u4e00\u4e2a\u8bfb\u8bf7\u6c42<br \/>\nstruct io_uring_sqe *sqe &#061; io_uring_get_sqe(&amp;ring);<br \/>\nio_uring_prep_read(sqe, fd, buf, size, offset);<\/p>\n<p>\/\/ \u63d0\u4ea4\u8bf7\u6c42<br \/>\nio_uring_submit(&amp;ring);<\/p>\n<p>\/\/ \u7b49\u5f85\u5b8c\u6210<br \/>\nstruct io_uring_cqe *cqe;<br \/>\nio_uring_wait_cqe(&amp;ring, &amp;cqe);<\/p>\n<p>\/\/ \u5904\u7406\u7ed3\u679c<br \/>\nif (cqe-&gt;res &gt; 0) {<br \/>\n \/\/ \u8bfb\u53d6\u6210\u529f<br \/>\n}<\/p>\n<p>\/\/ \u6807\u8bb0\u5b8c\u6210<br \/>\nio_uring_cqe_seen(&amp;ring, cqe);<\/p>\n<p>\u907f\u5751\u6307\u5357&#xff1a;\u6211\u66fe\u7ecf\u5728\u4e00\u4e2a\u9879\u76ee\u91cc\u76f4\u63a5\u7528io_uring\u7684raw syscall\u63a5\u53e3&#xff0c;\u7ed3\u679c\u8e29\u4e86\u5185\u5b58\u5c4f\u969c\u7684\u5751\u3002\u5efa\u8bae\u7528liburing\u5e93&#xff0c;\u5b83\u5e2e\u4f60\u5904\u7406\u4e86\u8fd9\u4e9b\u5e95\u5c42\u7ec6\u8282\u3002\u53e6\u5916&#xff0c;io_uring\u7684SQ\u548cCQ\u662f\u5171\u4eab\u5185\u5b58&#xff0c;\u591a\u7ebf\u7a0b\u73af\u5883\u4e0b\u8981\u6ce8\u610f\u540c\u6b65\u2014\u2014\u867d\u7136io_uring\u672c\u8eab\u652f\u6301\u591a\u751f\u4ea7\u8005\/\u591a\u6d88\u8d39\u8005\u6a21\u5f0f&#xff0c;\u4f46\u7528\u4e0d\u597d\u5bb9\u6613\u51fa\u6570\u636e\u7ade\u4e89\u3002<\/p>\n<h4>8.3 \u96f6\u62f7\u8d1d&#xff1a;\u6570\u636e\u522b\u5728\u5185\u5b58\u91cc\u6765\u56de\u5012\u817e<\/h4>\n<p>\u96f6\u62f7\u8d1d&#xff0c;\u540d\u5b57\u542c\u7740\u7384\u4e4e&#xff0c;\u5176\u5b9e\u9053\u7406\u5f88\u7b80\u5355&#xff1a;\u51cf\u5c11\u6570\u636e\u5728\u5185\u6838\u6001\u548c\u7528\u6237\u6001\u4e4b\u95f4\u7684\u62f7\u8d1d\u6b21\u6570\u3002<\/p>\n<p>\u4f20\u7edf\u7684\u6587\u4ef6\u53d1\u9001\u6d41\u7a0b\u662f\u8fd9\u6837\u7684&#xff1a;<\/p>\n<li>\u78c1\u76d8 \u2192 \u5185\u6838\u7f13\u51b2\u533a&#xff08;DMA\u62f7\u8d1d&#xff09;<\/li>\n<li>\u5185\u6838\u7f13\u51b2\u533a \u2192 \u7528\u6237\u7f13\u51b2\u533a&#xff08;CPU\u62f7\u8d1d&#xff09;<\/li>\n<li>\u7528\u6237\u7f13\u51b2\u533a \u2192 \u5185\u6838socket\u7f13\u51b2\u533a&#xff08;CPU\u62f7\u8d1d&#xff09;<\/li>\n<li>\u5185\u6838socket\u7f13\u51b2\u533a \u2192 \u7f51\u5361&#xff08;DMA\u62f7\u8d1d&#xff09;<\/li>\n<p>\u4e00\u51714\u6b21\u62f7\u8d1d&#xff0c;\u5176\u4e2d2\u6b21\u662fCPU\u53c2\u4e0e\u7684\u3002CPU\u5e72\u8fd9\u79cd\u642c\u8fd0\u5de5\u7684\u6d3b&#xff0c;\u4f60\u8bf4\u6d6a\u8d39\u4e0d\u6d6a\u8d39&#xff1f;<\/p>\n<p>\u96f6\u62f7\u8d1d\u7684\u601d\u8def\u5c31\u662f\u8df3\u8fc7\u7528\u6237\u6001\u7f13\u51b2\u533a&#xff0c;\u8ba9\u6570\u636e\u76f4\u63a5\u4ece\u5185\u6838\u7f13\u51b2\u533a\u5230socket\u7f13\u51b2\u533a&#xff0c;\u751a\u81f3\u76f4\u63a5\u5230\u7f51\u5361\u3002Linux\u63d0\u4f9b\u4e86\u51e0\u4e2a\u7cfb\u7edf\u8c03\u7528\u6765\u5b9e\u73b0&#xff1a;<\/p>\n<table>\n<tbody>\n<tr>\u7cfb\u7edf\u8c03\u7528\u9002\u7528\u573a\u666f\u62f7\u8d1d\u6b21\u6570<\/tr>\n<tr>\n<td>sendfile<\/td>\n<td>\u6587\u4ef6\u2192socket<\/td>\n<td>2\u6b21&#xff08;DMA&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>splice<\/td>\n<td>\u4e24\u4e2a\u6587\u4ef6\u63cf\u8ff0\u7b26\u4e4b\u95f4<\/td>\n<td>2\u6b21&#xff08;DMA&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>mmap &#043; write<\/td>\n<td>\u6587\u4ef6\u2192socket&#xff08;\u9700\u6ce8\u610f\u9875\u7f13\u5b58&#xff09;<\/td>\n<td>3\u6b21&#xff08;\u542b1\u6b21CPU\u62f7\u8d1d&#xff09;<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u6211\u6700\u5e38\u7528\u7684\u662fsendfile\u3002\u6bd4\u5982\u9759\u6001\u6587\u4ef6\u670d\u52a1\u5668&#xff0c;\u7528sendfile\u6bd4\u7528read&#043;write\u5feb30%\u4ee5\u4e0a\u3002\u6211\u8bb0\u5f97\u6709\u4e00\u6b21\u4f18\u5316\u4e00\u4e2a\u56fe\u7247\u670d\u52a1&#xff0c;\u628aread\/write\u6539\u6210sendfile\u540e&#xff0c;CPU\u4f7f\u7528\u7387\u76f4\u63a5\u4ece70%\u964d\u5230\u4e8625%\u3002<\/p>\n<p>\u5c0f\u6280\u5de7&#xff1a;\u96f6\u62f7\u8d1d\u867d\u7136\u597d&#xff0c;\u4f46\u4e0d\u662f\u4e07\u80fd\u7684\u3002\u5982\u679c\u6570\u636e\u9700\u8981\u88ab\u5e94\u7528\u7a0b\u5e8f\u5904\u7406&#xff08;\u6bd4\u5982\u538b\u7f29\u3001\u52a0\u5bc6\u3001\u683c\u5f0f\u8f6c\u6362&#xff09;&#xff0c;\u90a3\u96f6\u62f7\u8d1d\u5c31\u7528\u4e0d\u4e86\u3002\u8fd9\u65f6\u5019\u53ef\u4ee5\u8003\u8651\u7528\u300c\u5f02\u6b65I\/O &#043; \u5185\u5b58\u6c60\u300d\u6765\u51cf\u5c11\u62f7\u8d1d\u5f00\u9500\u3002<\/p>\n<h4>8.4 \u78c1\u76d8\u8c03\u5ea6&#xff1a;\u8ba9\u78c1\u5934\u5c11\u8dd1\u51a4\u6789\u8def<\/h4>\n<p>\u78c1\u76d8\u8c03\u5ea6&#xff0c;\u8bf4\u767d\u4e86\u5c31\u662f\u51b3\u5b9a\u5148\u5904\u7406\u54ea\u4e2aI\/O\u8bf7\u6c42\u3002\u5bf9\u4e8e\u673a\u68b0\u786c\u76d8\u6765\u8bf4&#xff0c;\u78c1\u5934\u5bfb\u9053\u662f\u6700\u5927\u7684\u6027\u80fd\u74f6\u9888\u3002\u4e00\u4e2a\u597d\u7684\u8c03\u5ea6\u7b97\u6cd5\u80fd\u663e\u8457\u51cf\u5c11\u5bfb\u9053\u65f6\u95f4\u3002<\/p>\n<p>Linux\u5185\u6838\u63d0\u4f9b\u4e86\u51e0\u79cd\u78c1\u76d8\u8c03\u5ea6\u5668&#xff1a;<\/p>\n<ul>\n<li>CFQ&#xff08;\u5b8c\u5168\u516c\u5e73\u961f\u5217&#xff09;&#xff1a;\u6bcf\u4e2a\u8fdb\u7a0b\u4e00\u4e2a\u961f\u5217&#xff0c;\u6309\u65f6\u95f4\u7247\u8f6e\u8f6c\u3002\u9002\u5408\u684c\u9762\u73af\u5883&#xff0c;\u4f46\u670d\u52a1\u5668\u573a\u666f\u6027\u80fd\u4e00\u822c\u3002<\/li>\n<li>Deadline&#xff08;\u622a\u6b62\u65f6\u95f4\u8c03\u5ea6\u5668&#xff09;&#xff1a;\u7ed9\u6bcf\u4e2a\u8bf7\u6c42\u8bbe\u7f6e\u622a\u6b62\u65f6\u95f4&#xff0c;\u8bfb\u8bf7\u6c42\u4f18\u5148\u3002\u6211\u6bd4\u8f83\u63a8\u8350\u8fd9\u4e2a&#xff0c;\u5c24\u5176\u662f\u6570\u636e\u5e93\u573a\u666f\u3002<\/li>\n<li>NOOP&#xff08;\u5148\u8fdb\u5148\u51fa&#xff09;&#xff1a;\u6700\u7b80\u5355\u7684\u8c03\u5ea6\u5668&#xff0c;\u6309\u8bf7\u6c42\u5230\u8fbe\u987a\u5e8f\u5904\u7406\u3002\u9002\u5408SSD\u548cNVMe&#xff0c;\u56e0\u4e3a\u8fd9\u7c7b\u8bbe\u5907\u6ca1\u6709\u5bfb\u9053\u5f00\u9500\u3002<\/li>\n<li>BFQ&#xff08;\u9884\u7b97\u516c\u5e73\u961f\u5217&#xff09;&#xff1a;CFQ\u7684\u6539\u8fdb\u7248&#xff0c;\u66f4\u6ce8\u91cd\u5ef6\u8fdf\u516c\u5e73\u6027\u3002<\/li>\n<\/ul>\n<p>\u55ef&#xff0c;\u8fd9\u91cc\u8981\u6ce8\u610f&#xff1a;NVMe\u56fa\u6001\u786c\u76d8\u4e0d\u9700\u8981\u590d\u6742\u7684\u78c1\u76d8\u8c03\u5ea6\u3002\u56e0\u4e3aNVMe\u7684\u5e76\u884c\u5ea6\u6781\u9ad8&#xff0c;\u5bfb\u9053\u65f6\u95f4\u51e0\u4e4e\u4e3a\u96f6\u3002\u7528NOOP\u6216\u8005none\u8c03\u5ea6\u5668\u5c31\u591f\u4e86\u3002\u6211\u66fe\u7ecf\u5728\u4e00\u4e2aNVMe\u96c6\u7fa4\u4e0a\u8bef\u7528\u4e86CFQ&#xff0c;\u7ed3\u679cIOPS\u4ece80\u4e07\u6389\u5230\u4e8630\u4e07\u2014\u2014\u8c03\u5ea6\u5668\u7684\u5f00\u9500\u53cd\u800c\u6210\u4e86\u74f6\u9888\u3002<\/p>\n<p>\u6211\u7684\u9009\u62e9\u5efa\u8bae&#xff1a;<\/p>\n<ul>\n<li>\u673a\u68b0\u786c\u76d8 &#043; \u6570\u636e\u5e93 \u2192 Deadline<\/li>\n<li>\u673a\u68b0\u786c\u76d8 &#043; \u684c\u9762 \u2192 BFQ<\/li>\n<li>SSD \/ NVMe \u2192 NOOP \u6216 none<\/li>\n<li>\u865a\u62df\u5316\u73af\u5883 \u2192 \u901a\u5e38\u7528none&#xff0c;\u8ba9\u5bbf\u4e3b\u673a\u8c03\u5ea6<\/li>\n<\/ul>\n<p>\u6700\u540e\u8bf4\u4e00\u53e5&#xff1a;I\/O\u4f18\u5316\u6ca1\u6709\u94f6\u5f39\u3002\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6&#xff0c;\u6bcf\u4e2a\u5de5\u5177\u90fd\u6709\u5b83\u7684\u9002\u7528\u573a\u666f\u3002\u6211\u5efa\u8bae\u4f60\u5148\u505a\u6027\u80fd\u5206\u6790&#xff0c;\u627e\u5230\u771f\u6b63\u7684\u74f6\u9888\u5728\u54ea&#xff0c;\u518d\u5bf9\u75c7\u4e0b\u836f\u3002\u522b\u4e00\u4e0a\u6765\u5c31\u4e0aio_uring&#xff0c;\u7ed3\u679c\u53d1\u73b0\u74f6\u9888\u5728\u78c1\u76d8\u672c\u8eab\u2014\u2014\u90a3\u5c31\u5c34\u5c2c\u4e86\u3002<\/p>\n<p>\u63a8\u8350\u5de5\u5177&#xff1a;iostat\u3001blktrace\u3001perf\u3001strace\u3002\u8fd9\u4e9b\u5de5\u5177\u80fd\u5e2e\u4f60\u5b9a\u4f4dI\/O\u74f6\u9888\u3002\u6211\u4e2a\u4eba\u4e60\u60ef\u5148\u7528iostat\u770b\u6574\u4f53\u60c5\u51b5&#xff0c;\u518d\u7528blktrace\u6df1\u5165\u5206\u6790\u5355\u4e2a\u8bf7\u6c42\u7684\u5ef6\u8fdf\u5206\u5e03\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u804a\u5230I\/O\u6027\u80fd\u4f18\u5316&#xff0c;\u6211\u5f97\u5148\u5766\u767d\u4e00\u4ef6\u4e8b\u3002\u65e9\u4e9b\u5e74\u6211\u505a\u540e\u7aef\u670d\u52a1\u65f6&#xff0c;\u603b\u628a\u7cbe\u529b\u653e\u5728CPU\u8ba1\u7b97\u548c\u5185\u5b58\u4e0a&#xff0c;\u89c9\u5f97\u78c1\u76d8I\/O\u561b&#xff0c;\u6162\u5c31\u6162\u70b9&#xff0c;\u5fcd\u5fcd\u5c31\u8fc7\u53bb\u4e86\u3002\u76f4\u5230\u6709\u4e00\u6b21\u7ebf\u4e0a\u670d\u52a1\u56e0\u4e3a\u65e5\u5fd7\u5199\u5165\u628a\u6574\u4e2a\u7cfb\u7edf\u5361\u6b7b&#xff0c;\u6211\u624d\u771f\u6b63\u610f\u8bc6\u5230\u2014\u2014I\/O\u624d\u662f\u73b0\u4ee3\u7cfb\u7edf\u7684\u9690\u5f62\u74f6\u9888\u3002\u4eca\u5929\u54b1\u4eec\u5c31\u628a\u8fd9\u5757\u786c\u9aa8\u5934\u5543\u4e0b\u6765\u3002\u6211\u4f1a\u4ece\u56db\u4e2a\u7ef4\u5ea6\u5c55\u5f00&#xff1a;\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6\u3002\u6bcf\u4e2a\u90fd\u662f\u5b9e\u6218\u4e2d\u9ad8\u9891\u51fa\u73b0\u7684\u4f18\u5316\u70b9\u3002\u6838\u5fc3\u89c2\u70b9&#xff1a;<\/p>\n","protected":false},"author":2,"featured_media":111644,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[84,58,56],"topic":[],"class_list":["post-111645","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-android","tag-linux","tag-56"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>8. I\/O\u6027\u80fd\u4f18\u5316\uff1a\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/111645.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"8. I\/O\u6027\u80fd\u4f18\u5316\uff1a\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u804a\u5230I\/O\u6027\u80fd\u4f18\u5316&#xff0c;\u6211\u5f97\u5148\u5766\u767d\u4e00\u4ef6\u4e8b\u3002\u65e9\u4e9b\u5e74\u6211\u505a\u540e\u7aef\u670d\u52a1\u65f6&#xff0c;\u603b\u628a\u7cbe\u529b\u653e\u5728CPU\u8ba1\u7b97\u548c\u5185\u5b58\u4e0a&#xff0c;\u89c9\u5f97\u78c1\u76d8I\/O\u561b&#xff0c;\u6162\u5c31\u6162\u70b9&#xff0c;\u5fcd\u5fcd\u5c31\u8fc7\u53bb\u4e86\u3002\u76f4\u5230\u6709\u4e00\u6b21\u7ebf\u4e0a\u670d\u52a1\u56e0\u4e3a\u65e5\u5fd7\u5199\u5165\u628a\u6574\u4e2a\u7cfb\u7edf\u5361\u6b7b&#xff0c;\u6211\u624d\u771f\u6b63\u610f\u8bc6\u5230\u2014\u2014I\/O\u624d\u662f\u73b0\u4ee3\u7cfb\u7edf\u7684\u9690\u5f62\u74f6\u9888\u3002\u4eca\u5929\u54b1\u4eec\u5c31\u628a\u8fd9\u5757\u786c\u9aa8\u5934\u5543\u4e0b\u6765\u3002\u6211\u4f1a\u4ece\u56db\u4e2a\u7ef4\u5ea6\u5c55\u5f00&#xff1a;\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6\u3002\u6bcf\u4e2a\u90fd\u662f\u5b9e\u6218\u4e2d\u9ad8\u9891\u51fa\u73b0\u7684\u4f18\u5316\u70b9\u3002\u6838\u5fc3\u89c2\u70b9&#xff1a;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/111645.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-01T04:57:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261001045705-6abde821153ad.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/111645.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/111645.html\",\"name\":\"8. I\/O\u6027\u80fd\u4f18\u5316\uff1a\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-01T04:57:06+00:00\",\"dateModified\":\"2026-10-01T04:57:06+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/111645.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/111645.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/111645.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"8. I\/O\u6027\u80fd\u4f18\u5316\uff1a\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"8. I\/O\u6027\u80fd\u4f18\u5316\uff1a\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/111645.html","og_locale":"zh_CN","og_type":"article","og_title":"8. I\/O\u6027\u80fd\u4f18\u5316\uff1a\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u804a\u5230I\/O\u6027\u80fd\u4f18\u5316&#xff0c;\u6211\u5f97\u5148\u5766\u767d\u4e00\u4ef6\u4e8b\u3002\u65e9\u4e9b\u5e74\u6211\u505a\u540e\u7aef\u670d\u52a1\u65f6&#xff0c;\u603b\u628a\u7cbe\u529b\u653e\u5728CPU\u8ba1\u7b97\u548c\u5185\u5b58\u4e0a&#xff0c;\u89c9\u5f97\u78c1\u76d8I\/O\u561b&#xff0c;\u6162\u5c31\u6162\u70b9&#xff0c;\u5fcd\u5fcd\u5c31\u8fc7\u53bb\u4e86\u3002\u76f4\u5230\u6709\u4e00\u6b21\u7ebf\u4e0a\u670d\u52a1\u56e0\u4e3a\u65e5\u5fd7\u5199\u5165\u628a\u6574\u4e2a\u7cfb\u7edf\u5361\u6b7b&#xff0c;\u6211\u624d\u771f\u6b63\u610f\u8bc6\u5230\u2014\u2014I\/O\u624d\u662f\u73b0\u4ee3\u7cfb\u7edf\u7684\u9690\u5f62\u74f6\u9888\u3002\u4eca\u5929\u54b1\u4eec\u5c31\u628a\u8fd9\u5757\u786c\u9aa8\u5934\u5543\u4e0b\u6765\u3002\u6211\u4f1a\u4ece\u56db\u4e2a\u7ef4\u5ea6\u5c55\u5f00&#xff1a;\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6\u3002\u6bcf\u4e2a\u90fd\u662f\u5b9e\u6218\u4e2d\u9ad8\u9891\u51fa\u73b0\u7684\u4f18\u5316\u70b9\u3002\u6838\u5fc3\u89c2\u70b9&#xff1a;","og_url":"https:\/\/www.wsisp.com\/helps\/111645.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-01T04:57:06+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261001045705-6abde821153ad.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/111645.html","url":"https:\/\/www.wsisp.com\/helps\/111645.html","name":"8. I\/O\u6027\u80fd\u4f18\u5316\uff1a\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-01T04:57:06+00:00","dateModified":"2026-10-01T04:57:06+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/111645.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/111645.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/111645.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"8. I\/O\u6027\u80fd\u4f18\u5316\uff1a\u5f02\u6b65I\/O\u3001io_uring\u3001\u96f6\u62f7\u8d1d\u3001\u78c1\u76d8\u8c03\u5ea6"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/111645","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=111645"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/111645\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/111644"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=111645"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=111645"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=111645"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=111645"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}