{"id":27472,"date":"2021-12-04T05:16:30","date_gmt":"2021-12-03T21:16:30","guid":{"rendered":"http:\/\/www.idc.net\/help\/27472\/"},"modified":"2021-12-04T05:16:30","modified_gmt":"2021-12-03T21:16:30","slug":"%e9%80%9a%e8%bf%87sysbench-%e5%af%b9-linux-%e8%bf%9b%e8%a1%8c%e6%80%a7%e8%83%bd%e6%b5%8b%e8%af%95","status":"publish","type":"post","link":"https:\/\/idc.net\/help\/27472\/","title":{"rendered":"\u901a\u8fc7Sysbench \u5bf9 Linux \u8fdb\u884c\u6027\u80fd\u6d4b\u8bd5"},"content":{"rendered":"<div class=\"idc_table\">\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\">sysbench\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u3001\u6a21\u5757\u5316\u7684\u3001\u8de8\u5e73\u53f0\u7684\u591a\u7ebf\u7a0b\u6027\u80fd\u6d4b\u8bd5\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u8fdb\u884cCPU\u3001\u5185\u5b58\u3001\u78c1\u76d8I\/O\u3001\u7ebf\u7a0b\u3001\u6570\u636e\u5e93\u7684\u6027\u80fd\u6d4b\u8bd5\u3002\u76ee\u524d\u652f\u6301\u7684\u6570\u636e\u5e93\u6709MySQL\u3001Oracle\u548cPostgreSQL\u3002\u4ee5\u4e0b\u64cd\u4f5c\u90fd\u5c06\u4ee5\u652f\u6301MySQL\u6570\u636e\u5e93\u4e3a\u4f8b\u8fdb\u884c\u3002<\/p>\n<h2><span style=\"font-size: 18px;font-weight: bold;color: #222;padding-left: 10px;border-left: 5px solid #f83929\">\u7cfb\u7edf\u73af\u5883<\/span><\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\">Centos8<\/p>\n<h2><span style=\"font-size: 18px;font-weight: bold;color: #222;padding-left: 10px;border-left: 5px solid #f83929\">\u5b89\u88c5sysbench<\/span><\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\">\u9996\u5148\u5b89\u88c5epel\u6e90\uff0c\u7136\u540e\u8fdb\u884c\u5b89\u88c5<code>sysbench<\/code><\/p>\n<pre><code>[root@server1&nbsp;~]<span style=\"color: #998;font-style: italic;line-height: 26px\">#&nbsp;rpm&nbsp;-ivh&nbsp;https:\/\/mirrors.tuna.tsinghua.edu.cn\/epel\/epel-release-latest-8.noarch.rpm<\/span>\r\n[root@server1&nbsp;~]<span style=\"color: #998;font-style: italic;line-height: 26px\">#&nbsp;yum&nbsp;-y&nbsp;install&nbsp;sysbench<\/span>\r\n<\/code><\/pre>\n<p><img decoding=\"async\" class=\"aligncenter\" style=\"border-radius: 6px;margin: 20px auto;max-width: 95%\" src=\"https:\/\/lxlinux.superbed.verylink.top\/item\/618e80852ab3f51d910506bb.png\">  <\/p>\n<h2><span style=\"font-size: 18px;font-weight: bold;color: #222;padding-left: 10px;border-left: 5px solid #f83929\">\u4f7f\u7528 sysbench \u5de5\u5177\u6267\u884c CPU \u57fa\u51c6\u6d4b\u8bd5<\/span><\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\">\u8981\u8bc4\u4f30 CPU \u6027\u80fd\uff0c\u8bf7\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u884c CPU \u57fa\u51c6\u6d4b\u8bd5\uff1a<\/p>\n<pre><code>[root@server1&nbsp;~]<span style=\"color: #998;font-style: italic;line-height: 26px\">#&nbsp;sysbench&nbsp;--test=cpu&nbsp;run<\/span>\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\"><img decoding=\"async\" style=\"border-radius: 6px;margin: 20px auto;max-width: 95%\" src=\"https:\/\/lxlinux.superbed.verylink.top\/item\/618e80842ab3f51d910505a6.png\" class=\"aligncenter\"> \u5b8c\u6574\u7684\u62a5\u8868\u7edf\u8ba1\u4f1a\u663e\u793a\u5728\u7ec8\u7aef\u4e0a\uff0c\u4f46\u8fd9\u91cc\u91cd\u8981\u7684\u662f<code>total time<\/code>\u4f1a\u663e\u793a\u5728<code>General statistics<\/code>\u4e0b\uff0c\u7528\u4e8e\u6d4b\u8bd5CPU\u6027\u80fd\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\">\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u83b7\u53d6 CPU \u57fa\u51c6\u6d4b\u8bd5\u9009\u9879\uff1a<\/p>\n<pre><code>[root@server1&nbsp;~]<span style=\"color: #998;font-style: italic;line-height: 26px\">#&nbsp;sysbench&nbsp;--test=cpu&nbsp;help<\/span>\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\"><img decoding=\"async\" style=\"border-radius: 6px;margin: 20px auto;max-width: 95%\" src=\"https:\/\/lxlinux.superbed.verylink.top\/item\/618e80842ab3f51d9105061e.png\" class=\"aligncenter\"> \u547d\u4ee4\u53c2\u6570\u53ef\u4ee5\u6839\u636e\u4f60\u7684\u8981\u6c42\u8fdb\u884c\u4fee\u6539\u3002\u4f8b\u5982\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5bf9 CPU \u6027\u80fd\u8fdb\u884c\u57fa\u51c6\u6d4b\u8bd5\uff1a<\/p>\n<pre><code>[root@server1&nbsp;~]<span style=\"color: #998;font-style: italic;line-height: 26px\">#&nbsp;sysbench&nbsp;--test=cpu&nbsp;--cpu-max-prime=20000&nbsp;run<\/span>\r\n<\/code><\/pre>\n<p><img decoding=\"async\" style=\"border-radius: 6px;margin: 20px auto;max-width: 95%\" src=\"https:\/\/lxlinux.superbed.verylink.top\/item\/618e80842ab3f51d91050597.png\" class=\"aligncenter\">  <\/p>\n<h2><span style=\"font-size: 18px;font-weight: bold;color: #222;padding-left: 10px;border-left: 5px solid #f83929\">\u4f7f\u7528 sysbench \u5de5\u5177\u5bf9\u5185\u5b58\u8fdb\u884c\u57fa\u51c6\u6d4b\u8bd5<\/span><\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\">\u8981\u6d4b\u8bd5\u5185\u5b58\u6027\u80fd\uff0c\u8bf7\u5728\u7ec8\u7aef\u4e0a\u952e\u5165\u4ee5\u4e0b\u57fa\u672c\u547d\u4ee4\uff1a<\/p>\n<pre><code>[root@server1&nbsp;~]<span style=\"color: #998;font-style: italic;line-height: 26px\">#&nbsp;sysbench&nbsp;--test=memory&nbsp;run<\/span>\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\"><img decoding=\"async\" style=\"border-radius: 6px;margin: 20px auto;max-width: 95%\" src=\"https:\/\/lxlinux.superbed.verylink.top\/item\/618e80842ab3f51d910505de.png\" class=\"aligncenter\"> \u53ef\u4ee5\u901a\u8fc7\u68c0\u67e5<code>Total operations<\/code>\u548c\u4f20\u8f93\u6570\u636e\u91cf\u8fd9\u4e24\u4e2a\u53c2\u6570\u6765\u6d4b\u8bd5\u5185\u5b58\u6027\u80fd\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\">\u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\u67e5\u770b\u548c\u6d4b\u8bd5\u5185\u5b58\u6027\u80fd\u76f8\u5173\u7684\u9009\u9879\uff1a<\/p>\n<pre><code>[root@server1&nbsp;~]<span style=\"color: #998;font-style: italic;line-height: 26px\">#&nbsp;sysbench&nbsp;--test=memory&nbsp;help<\/span>\r\n<\/code><\/pre>\n<p><img decoding=\"async\" style=\"border-radius: 6px;margin: 20px auto;max-width: 95%\" src=\"https:\/\/lxlinux.superbed.verylink.top\/item\/618e80842ab3f51d910505ed.png\" class=\"aligncenter\">  <\/p>\n<h2><span style=\"font-size: 18px;font-weight: bold;color: #222;padding-left: 10px;border-left: 5px solid #f83929\">\u4f7f\u7528 sysbench \u5de5\u5177\u5bf9 I\/O \u8fdb\u884c\u57fa\u51c6\u6d4b\u8bd5<\/span><\/h2>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\">I\/O \u6027\u80fd\u6d4b\u8bd5\u4e0e CPU \u548c\u5185\u5b58\u6d4b\u8bd5\u7565\u6709\u4e0d\u540c\u3002\u5728\u6587\u4ef6 I\/O \u6d4b\u8bd5\u4e2d\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u5927\u4e8e RAM \u5927\u5c0f\u7684\u6d4b\u8bd5\u6587\u4ef6\u3002\u4e00\u822c\u7684\u987a\u5e8f\u5199\u5165 I\/O \u6027\u80fd\u6d4b\u8bd5\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5b8c\u6210\uff1a<\/p>\n<pre><code>[root@server1&nbsp;~]<span style=\"color: #998;font-style: italic;line-height: 26px\">#&nbsp;sysbench&nbsp;--test=fileio&nbsp;--file-test-mode=seqwr&nbsp;run<\/span>\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\"><img decoding=\"async\" style=\"border-radius: 6px;margin: 20px auto;max-width: 95%\" src=\"https:\/\/lxlinux.superbed.verylink.top\/item\/618e80832ab3f51d9105056e.png\" class=\"aligncenter\"> \u4f7f\u7528\u4e0b\u9762\u547d\u4ee4\u83b7\u53d6I\/O\u6d4b\u8bd5\u7684\u66f4\u591a\u9009\u9879\uff1a<\/p>\n<pre><code>[root@server1&nbsp;~]<span style=\"color: #998;font-style: italic;line-height: 26px\">#&nbsp;sysbench&nbsp;--test=fileio&nbsp;--file-test-mode=seqwr&nbsp;help<\/span>\r\n<\/code><\/pre>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\"><img decoding=\"async\" style=\"border-radius: 6px;margin: 20px auto;max-width: 95%\" src=\"https:\/\/lxlinux.superbed.verylink.top\/item\/618e80842ab3f51d91050583.png\" class=\"aligncenter\"> \u4e0a\u9762\u663e\u793a\u8bb8\u591a\u9009\u9879\u3002\u53ea\u9700\u6839\u636e\u4f60\u7684\u8981\u6c42\u8bbe\u7f6e\u53c2\u6570\u503c\uff0c\u5e76\u6d4b\u8bd5\u4f60\u7684 Linux \u7cfb\u7edf\u7684 I\/O \u6027\u80fd\u3002<\/p>\n<p style=\"padding-top: 8px;padding-bottom: 8px;line-height: 1.75;margin: 0.8em 0;font-size: 16px;color: #353535\">\u6027\u80fd\u6d4b\u8bd5\u5b8c\u6210\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5220\u9664\u6d4b\u8bd5\u6587\u4ef6\uff1a<\/p>\n<pre><code>[root@server1&nbsp;~]<span style=\"color: #998;font-style: italic;line-height: 26px\">#&nbsp;sysbench&nbsp;--test=fileio&nbsp;cleanup<\/span>\r\n<\/code><\/pre>\n<p><img decoding=\"async\" style=\"border-radius: 6px;margin: 20px auto;max-width: 95%\" src=\"https:\/\/lxlinux.superbed.verylink.top\/item\/618e80842ab3f51d91050607.png\" class=\"aligncenter\">  <\/p>\n","protected":false},"excerpt":{"rendered":"<p>sysbench\u662f\u4e00\u4e2a\u5f00\u6e90\u7684\u3001\u6a21\u5757\u5316\u7684\u3001\u8de8\u5e73\u53f0\u7684\u591a\u7ebf\u7a0b\u6027\u80fd\u6d4b\u8bd5\u5de5\u5177\uff0c\u53ef\u4ee5\u7528\u6765\u8fdb\u884cCPU\u3001\u5185\u5b58\u3001\u78c1\u76d8I\/O\u3001\u7ebf\u7a0b [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":27473,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-27472","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/27472","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/comments?post=27472"}],"version-history":[{"count":0,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/posts\/27472\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media\/27473"}],"wp:attachment":[{"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/media?parent=27472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/categories?post=27472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/idc.net\/help\/wp-json\/wp\/v2\/tags?post=27472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}