{"id":40488,"date":"2025-05-29T09:37:44","date_gmt":"2025-05-29T01:37:44","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/40488.html"},"modified":"2025-05-29T09:37:44","modified_gmt":"2025-05-29T01:37:44","slug":"%e6%af%8f%e5%a4%a9%e6%8e%8c%e6%8f%a1%e4%b8%80%e4%b8%aalinux%e5%91%bd%e4%bb%a4-ab%ef%bc%88apache-benchmark%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/40488.html","title":{"rendered":"\u6bcf\u5929\u638c\u63e1\u4e00\u4e2aLinux\u547d\u4ee4 - ab\uff08Apache Benchmark\uff09"},"content":{"rendered":"<h2>Linux \u547d\u4ee4\u5de5\u5177 ab \u4f7f\u7528\u6307\u5357<\/h2>\n<h3>\u4e00\u3001\u5de5\u5177\u6982\u8ff0<\/h3>\n<p>ab&#xff08;Apache Benchmark&#xff09; \u662f Apache \u5b98\u65b9\u63d0\u4f9b\u7684\u5f00\u6e90\u538b\u529b\u6d4b\u8bd5\u5de5\u5177&#xff0c;\u7528\u4e8e\u8861\u91cf Web \u670d\u52a1\u5668\u7684\u6027\u80fd\u3002\u5b83\u901a\u8fc7\u6a21\u62df\u591a\u5e76\u53d1\u8bf7\u6c42&#xff0c;\u6d4b\u8bd5\u670d\u52a1\u5668\u5728\u9ad8\u8d1f\u8f7d\u4e0b\u7684\u54cd\u5e94\u901f\u5ea6\u3001\u541e\u5410\u91cf\u548c\u7a33\u5b9a\u6027&#xff0c;\u5e38\u7528\u4e8e\u8bc4\u4f30\u7f51\u7ad9\u6216 API \u7684\u6027\u80fd\u8868\u73b0\u3002<\/p>\n<p>\u6838\u5fc3\u7279\u70b9&#xff1a;<\/p>\n<ul>\n<li>\u8f7b\u91cf\u7ea7&#xff1a;\u65e0\u9700\u590d\u6742\u5b89\u88c5&#xff0c;\u9002\u5408\u5feb\u901f\u6d4b\u8bd5\u3002<\/li>\n<li>\u9ad8\u53ef\u914d\u7f6e\u6027&#xff1a;\u652f\u6301\u81ea\u5b9a\u4e49\u5e76\u53d1\u6570\u3001\u8bf7\u6c42\u6b21\u6570\u3001\u8bf7\u6c42\u5934\u3001\u8d85\u65f6\u65f6\u95f4\u7b49\u53c2\u6570\u3002<\/li>\n<li>\u7ed3\u679c\u6e05\u6670&#xff1a;\u8f93\u51fa\u5305\u542b\u8bf7\u6c42\u603b\u6570\u3001\u5931\u8d25\u7387\u3001\u541e\u5410\u91cf\u3001\u5e73\u5747\u54cd\u5e94\u65f6\u95f4\u7b49\u5173\u952e\u6307\u6807\u3002<\/li>\n<\/ul>\n<h3>\u4e8c\u3001\u5b89\u88c5\u65b9\u5f0f<\/h3>\n<h4>1. Debian\/Ubuntu \u7cfb\u7edf<\/h4>\n<p><span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> update<br \/>\n<span class=\"token function\">sudo<\/span> <span class=\"token function\">apt<\/span> <span class=\"token function\">install<\/span> apache2-utils  <span class=\"token comment\"># ab \u5305\u542b\u5728\u8be5\u8f6f\u4ef6\u5305\u4e2d<\/span><\/p>\n<h4>2. CentOS\/RHEL \u7cfb\u7edf<\/h4>\n<p><span class=\"token function\">sudo<\/span> yum <span class=\"token function\">install<\/span> httpd-tools<\/p>\n<h4>3. \u6e90\u7801\u7f16\u8bd1\u5b89\u88c5&#xff08;\u9002\u7528\u4e8e\u5176\u4ed6 Linux \u7cfb\u7edf&#xff09;<\/h4>\n<p><span class=\"token comment\"># \u4e0b\u8f7d Apache \u6e90\u7801\u5305<\/span><br \/>\n<span class=\"token function\">wget<\/span> https:\/\/downloads.apache.org\/apr\/apr-1.7.0.tar.gz<br \/>\n<span class=\"token function\">wget<\/span> https:\/\/downloads.apache.org\/apr\/apr-util-1.6.1.tar.gz<br \/>\n<span class=\"token function\">wget<\/span> https:\/\/downloads.apache.org\/httpd\/httpd-2.4.57.tar.gz<\/p>\n<p><span class=\"token comment\"># \u7f16\u8bd1\u5b89\u88c5 APR \u548c APR-Util<\/span><br \/>\n<span class=\"token function\">tar<\/span> <span class=\"token parameter variable\">-zxvf<\/span> apr-1.7.0.tar.gz<br \/>\n<span class=\"token builtin class-name\">cd<\/span> apr-1.7.0<br \/>\n.\/configure<br \/>\n<span class=\"token function\">make<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">make<\/span> <span class=\"token function\">install<\/span><\/p>\n<p><span class=\"token builtin class-name\">cd<\/span> <span class=\"token punctuation\">..<\/span><br \/>\n<span class=\"token function\">tar<\/span> <span class=\"token parameter variable\">-zxvf<\/span> apr-util-1.6.1.tar.gz<br \/>\n<span class=\"token builtin class-name\">cd<\/span> apr-util-1.6.1<br \/>\n.\/configure &#8211;with-apr<span class=\"token operator\">&#061;<\/span>\/usr\/local\/apr<br \/>\n<span class=\"token function\">make<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">make<\/span> <span class=\"token function\">install<\/span><\/p>\n<p><span class=\"token comment\"># \u7f16\u8bd1\u5b89\u88c5 httpd&#xff08;\u542b ab \u5de5\u5177&#xff09;<\/span><br \/>\n<span class=\"token builtin class-name\">cd<\/span> <span class=\"token punctuation\">..<\/span><br \/>\n<span class=\"token function\">tar<\/span> <span class=\"token parameter variable\">-zxvf<\/span> httpd-2.4.57.tar.gz<br \/>\n<span class=\"token builtin class-name\">cd<\/span> httpd-2.4.57<br \/>\n.\/configure &#8211;with-apr<span class=\"token operator\">&#061;<\/span>\/usr\/local\/apr &#8211;with-apr-util<span class=\"token operator\">&#061;<\/span>\/usr\/local\/apr-util<br \/>\n<span class=\"token function\">make<\/span> <span class=\"token operator\">&amp;&amp;<\/span> <span class=\"token function\">sudo<\/span> <span class=\"token function\">make<\/span> <span class=\"token function\">install<\/span><br \/>\n<span class=\"token comment\"># ab \u5de5\u5177\u8def\u5f84&#xff1a;\/usr\/local\/apache2\/bin\/ab<\/span><\/p>\n<h3>\u4e09\u3001\u6838\u5fc3\u529f\u80fd<\/h3>\n<table>\n<tr>\u529f\u80fd\u5206\u7c7b\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>\u5e76\u53d1\u6d4b\u8bd5<\/td>\n<td>\u6a21\u62df\u591a\u7528\u6237\u540c\u65f6\u8bbf\u95ee&#xff0c;\u6d4b\u8bd5\u670d\u52a1\u5668\u5bf9\u5e76\u53d1\u8fde\u63a5\u7684\u5904\u7406\u80fd\u529b\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u541e\u5410\u91cf\u7edf\u8ba1<\/td>\n<td>\u8ba1\u7b97\u670d\u52a1\u5668\u6bcf\u79d2\u5904\u7406\u7684\u8bf7\u6c42\u6570&#xff08;Requests per second&#xff09;\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u54cd\u5e94\u65f6\u95f4\u5206\u6790<\/td>\n<td>\u7edf\u8ba1\u8bf7\u6c42\u7684\u5e73\u5747\u54cd\u5e94\u65f6\u95f4\u3001\u6700\u5927\/\u6700\u5c0f\u54cd\u5e94\u65f6\u95f4\u53ca\u65f6\u95f4\u5206\u5e03&#xff08;\u5982 50%\/95% \u8017\u65f6&#xff09;\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u81ea\u5b9a\u4e49\u8bf7\u6c42<\/td>\n<td>\u652f\u6301\u8bbe\u7f6e\u8bf7\u6c42\u65b9\u6cd5&#xff08;GET\/POST&#xff09;\u3001\u8bf7\u6c42\u5934\u3001\u8bf7\u6c42\u4f53\u3001URL \u53c2\u6570\u7b49\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u957f\u8fde\u63a5\u6d4b\u8bd5<\/td>\n<td>\u652f\u6301\u4fdd\u6301 HTTP \u8fde\u63a5&#xff08;-k \u53c2\u6570&#xff09;&#xff0c;\u6d4b\u8bd5\u6301\u4e45\u8fde\u63a5\u6027\u80fd\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u56db\u3001\u57fa\u7840\u7528\u6cd5<\/h3>\n<h4>\u57fa\u672c\u8bed\u6cd5<\/h4>\n<p>ab <span class=\"token punctuation\">[<\/span>\u9009\u9879<span class=\"token punctuation\">]<\/span> <span class=\"token punctuation\">[<\/span>\u76ee\u6807 URL<span class=\"token punctuation\">]<\/span><\/p>\n<h4>\u5e38\u7528\u9009\u9879\u8bf4\u660e<\/h4>\n<table>\n<tr>\u9009\u9879\u63cf\u8ff0<\/tr>\n<tbody>\n<tr>\n<td>-n<\/td>\n<td>\u603b\u8bf7\u6c42\u6b21\u6570&#xff08;\u5fc5\u586b&#xff09;\u3002<\/td>\n<\/tr>\n<tr>\n<td>-c<\/td>\n<td>\u5e76\u53d1\u7528\u6237\u6570&#xff08;\u5fc5\u586b&#xff09;\u3002<\/td>\n<\/tr>\n<tr>\n<td>-t<\/td>\n<td>\u6d4b\u8bd5\u6301\u7eed\u65f6\u95f4&#xff08;\u79d2&#xff09;&#xff0c;\u4e0e -n \u4e8c\u9009\u4e00\u3002<\/td>\n<\/tr>\n<tr>\n<td>-k<\/td>\n<td>\u542f\u7528 HTTP \u957f\u8fde\u63a5&#xff08;keep-alive&#xff09;\u3002<\/td>\n<\/tr>\n<tr>\n<td>-H<\/td>\n<td>\u6dfb\u52a0\u8bf7\u6c42\u5934&#xff0c;\u683c\u5f0f&#xff1a;-H &#034;Header: Value&#034;&#xff08;\u53ef\u591a\u6b21\u4f7f\u7528&#xff09;\u3002<\/td>\n<\/tr>\n<tr>\n<td>-p<\/td>\n<td>\u6307\u5b9a POST \u8bf7\u6c42\u7684\u53c2\u6570\u6587\u4ef6&#xff08;\u6587\u4ef6\u5185\u5bb9\u4e3a\u53c2\u6570&#xff0c;\u5982 key&#061;value&#xff09;\u3002<\/td>\n<\/tr>\n<tr>\n<td>-T<\/td>\n<td>\u8bbe\u7f6e POST \u8bf7\u6c42\u7684 Content-Type&#xff0c;\u5982 -T &#034;application\/x-www-form-urlencoded&#034;\u3002<\/td>\n<\/tr>\n<tr>\n<td>-v<\/td>\n<td>\u8f93\u51fa\u8be6\u7ec6\u4fe1\u606f&#xff0c;\u6570\u503c\u8d8a\u5927\u8d8a\u8be6\u7ec6&#xff08;\u5982 -v 4&#xff09;\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u793a\u4f8b&#xff1a;GET \u8bf7\u6c42\u57fa\u7840\u6d4b\u8bd5<\/h4>\n<p><span class=\"token comment\"># \u6d4b\u8bd5\u767e\u5ea6\u9996\u9875&#xff0c;100 \u4e2a\u8bf7\u6c42&#xff0c;5 \u4e2a\u5e76\u53d1<\/span><br \/>\nab <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">100<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token number\">5<\/span> http:\/\/www.baidu.com\/<\/p>\n<p>\u8f93\u51fa\u7ed3\u679c\u89e3\u8bfb&#xff1a;<\/p>\n<p>Concurrency Level:      5        # \u5e76\u53d1\u6570<br \/>\nTime taken for tests:   0.323\u79d2   # \u603b\u8017\u65f6<br \/>\nComplete requests:      100      # \u5b8c\u6210\u8bf7\u6c42\u6570<br \/>\nFailed requests:        0        # \u5931\u8d25\u8bf7\u6c42\u6570&#xff08;\u975e 2xx\/3xx \u72b6\u6001\u7801&#xff09;<br \/>\nTotal transferred:      138700 bytes # \u4f20\u8f93\u603b\u6570\u636e\u91cf<br \/>\nHTML transferred:       131610 bytes # HTML \u5185\u5bb9\u5927\u5c0f<br \/>\nRequests per second:    309.60 [#\/sec] (mean) # \u541e\u5410\u91cf&#xff08;QPS&#xff09;<br \/>\nTime per request:       16.150 [ms] (mean)   # \u5e73\u5747\u6bcf\u4e2a\u8bf7\u6c42\u7684\u8017\u65f6&#xff08;\u6240\u6709\u5e76\u53d1&#xff09;<br \/>\nTime per request:       3.230 [ms] (mean, across all concurrent requests) # \u5355\u4e2a\u5e76\u53d1\u7684\u5e73\u5747\u8017\u65f6<br \/>\nTransfer rate:          417.57 [Kbytes\/sec] received # \u6570\u636e\u4f20\u8f93\u901f\u7387<\/p>\n<h3>\u4e94\u3001\u8fdb\u9636\u64cd\u4f5c<\/h3>\n<h4>1. POST \u8bf7\u6c42\u6d4b\u8bd5<\/h4>\n<p><span class=\"token comment\"># \u901a\u8fc7 -p \u6307\u5b9a\u53c2\u6570\u6587\u4ef6&#xff08;post_data.txt \u5185\u5bb9&#xff1a;username&#061;test&amp;password&#061;123&#xff09;<\/span><br \/>\nab <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">50<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token number\">10<\/span> <span class=\"token parameter variable\">-p<\/span> post_data.txt <span class=\"token parameter variable\">-T<\/span> <span class=\"token string\">&#034;application\/x-www-form-urlencoded&#034;<\/span> http:\/\/api.example.com\/login<\/p>\n<h4>2. \u81ea\u5b9a\u4e49\u8bf7\u6c42\u5934<\/h4>\n<p><span class=\"token comment\"># \u6dfb\u52a0\u81ea\u5b9a\u4e49\u8ba4\u8bc1\u5934\u548c Content-Type<\/span><br \/>\nab <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">100<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token number\">20<\/span> <span class=\"token parameter variable\">-H<\/span> <span class=\"token string\">&#034;Authorization: Bearer your_token&#034;<\/span> <span class=\"token parameter variable\">-H<\/span> <span class=\"token string\">&#034;Content-Type: application\/json&#034;<\/span> http:\/\/api.example.com\/data<\/p>\n<h4>3. \u957f\u8fde\u63a5\u6d4b\u8bd5&#xff08;-k&#xff09;<\/h4>\n<p>ab <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">500<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token number\">50<\/span> <span class=\"token parameter variable\">-k<\/span> http:\/\/example.com\/static-files<\/p>\n<h4>4. \u9650\u5236\u6d4b\u8bd5\u65f6\u95f4&#xff08;-t&#xff09;<\/h4>\n<p><span class=\"token comment\"># \u6301\u7eed\u6d4b\u8bd5 30 \u79d2&#xff0c;\u81ea\u52a8\u8ba1\u7b97\u8bf7\u6c42\u6b21\u6570<\/span><br \/>\nab <span class=\"token parameter variable\">-c<\/span> <span class=\"token number\">100<\/span> <span class=\"token parameter variable\">-t<\/span> <span class=\"token number\">30<\/span> http:\/\/video.example.com\/stream<\/p>\n<h4>5. \u8f93\u51fa\u8be6\u7ec6\u8c03\u8bd5\u4fe1\u606f&#xff08;-v&#xff09;<\/h4>\n<p>ab <span class=\"token parameter variable\">-v<\/span> <span class=\"token number\">4<\/span> <span class=\"token parameter variable\">-n<\/span> <span class=\"token number\">10<\/span> <span class=\"token parameter variable\">-c<\/span> <span class=\"token number\">2<\/span> http:\/\/localhost:8080\/api <span class=\"token comment\"># \u663e\u793a\u8bf7\u6c42\u5934\u3001\u54cd\u5e94\u72b6\u6001\u7801\u7b49\u7ec6\u8282<\/span><\/p>\n<h3>\u516d\u3001\u5b9e\u6218\u6848\u4f8b<\/h3>\n<h4>\u6848\u4f8b&#xff1a;\u6d4b\u8bd5 Nginx \u9759\u6001\u6587\u4ef6\u670d\u52a1\u5668\u6027\u80fd<\/h4>\n<p>\u573a\u666f&#xff1a;\u6a21\u62df 200 \u4e2a\u5e76\u53d1\u7528\u6237&#xff0c;\u6301\u7eed\u8bf7\u6c42 60 \u79d2&#xff0c;\u6d4b\u8bd5 \/images \u76ee\u5f55\u4e0b\u7684\u56fe\u7247\u6587\u4ef6\u3002<\/p>\n<p>ab <span class=\"token parameter variable\">-c<\/span> <span class=\"token number\">200<\/span> <span class=\"token parameter variable\">-t<\/span> <span class=\"token number\">60<\/span> <span class=\"token parameter variable\">-k<\/span> http:\/\/nginx-server\/images\/<\/p>\n<p>\u9884\u671f\u76ee\u6807&#xff1a;<\/p>\n<ul>\n<li>\u541e\u5410\u91cf&#xff08;QPS&#xff09;\u7a33\u5b9a\u5728 5000&#043;<\/li>\n<li>\u5e73\u5747\u54cd\u5e94\u65f6\u95f4 &lt; 50ms<\/li>\n<li>\u5931\u8d25\u8bf7\u6c42\u6570\u4e3a 0<\/li>\n<\/ul>\n<p>\u4f18\u5316\u65b9\u5411&#xff1a;<\/p>\n<ul>\n<li>\u82e5 QPS \u4e0d\u8db3&#xff0c;\u53ef\u8c03\u6574 Nginx \u7684 worker_connections \u6216\u5f00\u542f\u7f13\u5b58&#xff08;proxy_cache&#xff09;\u3002<\/li>\n<li>\u82e5\u54cd\u5e94\u65f6\u95f4\u8fc7\u9ad8&#xff0c;\u68c0\u67e5\u78c1\u76d8 I\/O \u6216\u7f51\u7edc\u5e26\u5bbd\u74f6\u9888\u3002<\/li>\n<\/ul>\n<h3>\u4e03\u3001\u6ce8\u610f\u4e8b\u9879<\/h3>\n<h4>1. \u670d\u52a1\u5668\u5b89\u5168<\/h4>\n<ul>\n<li>\u907f\u514d\u5bf9\u751f\u4ea7\u73af\u5883\u76f4\u63a5\u8fdb\u884c\u538b\u6d4b&#xff0c;\u5efa\u8bae\u5148\u5728\u9884\u53d1\u5e03\u73af\u5883\u6d4b\u8bd5\u3002<\/li>\n<li>\u63a7\u5236\u5e76\u53d1\u6570\u548c\u8bf7\u6c42\u9891\u7387&#xff0c;\u9632\u6b62\u538b\u6d4b\u5bfc\u81f4\u670d\u52a1\u5d29\u6e83&#xff08;\u53ef\u9010\u6b65\u589e\u52a0 -c \u53c2\u6570&#xff09;\u3002<\/li>\n<\/ul>\n<h4>2. \u6d4b\u8bd5\u5c40\u9650\u6027<\/h4>\n<ul>\n<li>ab \u662f\u5355\u8fdb\u7a0b\u5de5\u5177&#xff0c;\u65e0\u6cd5\u5b8c\u5168\u6a21\u62df\u771f\u5b9e\u7528\u6237\u884c\u4e3a&#xff08;\u5982\u6d4f\u89c8\u5668\u6e32\u67d3\u3001JS \u6267\u884c&#xff09;\u3002<\/li>\n<li>\u9ad8\u5e76\u53d1\u4e0b\u53ef\u80fd\u53d7\u9650\u4e8e\u5ba2\u6237\u7aef\u673a\u5668\u6027\u80fd&#xff08;\u5982 CPU\/\u7f51\u7edc\u5e26\u5bbd&#xff09;&#xff0c;\u9700\u786e\u4fdd\u5ba2\u6237\u7aef\u8d44\u6e90\u5145\u8db3\u3002<\/li>\n<\/ul>\n<h4>3. \u53c2\u6570\u8c03\u4f18<\/h4>\n<ul>\n<li>\u82e5\u51fa\u73b0 connect() failed \u9519\u8bef&#xff0c;\u53ef\u80fd\u662f\u5ba2\u6237\u7aef\u7aef\u53e3\u8017\u5c3d&#xff0c;\u53ef\u4e34\u65f6\u8c03\u6574\u7cfb\u7edf\u53c2\u6570&#xff1a;<span class=\"token function\">sudo<\/span> <span class=\"token function\">sysctl<\/span> <span class=\"token parameter variable\">-w<\/span> <span class=\"token assign-left variable\">net.ipv4.ip_local_port_range<\/span><span class=\"token operator\">&#061;<\/span><span class=\"token string\">&#034;1024 65535&#034;<\/span>\n <\/li>\n<li>\u5bf9\u4e8e HTTPS \u6d4b\u8bd5&#xff0c;\u9700\u4f7f\u7528 -S&#xff08;SSL \u8bc1\u4e66&#xff09;\u548c -P&#xff08;\u5ba2\u6237\u7aef\u8bc1\u4e66&#xff09;\u53c2\u6570&#xff0c;\u6216\u6539\u7528\u5176\u4ed6\u5de5\u5177&#xff08;\u5982 wrk&#xff09;\u3002<\/li>\n<\/ul>\n<h4>4. \u7ed3\u679c\u89e3\u8bfb<\/h4>\n<ul>\n<li>\u5173\u6ce8 \u5931\u8d25\u8bf7\u6c42\u6570&#xff08;\u975e 2xx\/3xx \u72b6\u6001\u7801&#xff09;\u548c \u5f02\u5e38\u8017\u65f6\u5206\u5e03&#xff08;\u5982 95% \u8017\u65f6\u7a81\u7136\u5347\u9ad8&#xff09;\u3002<\/li>\n<li>\u591a\u6b21\u6d4b\u8bd5\u53d6\u5e73\u5747\u503c&#xff0c;\u907f\u514d\u5355\u6b21\u7ed3\u679c\u53d7\u4e34\u65f6\u56e0\u7d20\u5e72\u6270\u3002<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u6307\u5357&#xff0c;\u53ef\u5feb\u901f\u638c\u63e1 ab \u7684\u6838\u5fc3\u7528\u6cd5&#xff0c;\u7ed3\u5408\u5b9e\u9645\u573a\u666f\u8fdb\u884c\u6027\u80fd\u6d4b\u8bd5\u548c\u4f18\u5316\u3002\u5bf9\u4e8e\u66f4\u590d\u6742\u7684\u8d1f\u8f7d\u573a\u666f&#xff0c;\u53ef\u8003\u8651\u4f7f\u7528 wrk\u3001JMeter \u7b49\u4e13\u4e1a\u5de5\u5177\u8865\u5145\u6d4b\u8bd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb833\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u4f60\u662f\u5426\u9047\u5230\u8fc7\u7f51\u7ad9\u7a81\u7136\u6d8c\u5165\u5927\u91cf\u7528\u6237\u65f6\u5361\u987f\u5d29\u6e83\u7684\u60c5\u51b5\uff1f\u60f3\u77e5\u9053\u81ea\u5bb6\u670d\u52a1\u5668\u80fd\u625b\u4f4f\u591a\u5c11\u5e76\u53d1\u8bf7\u6c42\u5417\uff1f**`ab`\uff08Apache Benchmark\uff09\u5c31\u662f\u4e13\u4e3a\u89e3\u51b3\u8fd9\u7c7b\u95ee\u9898\u800c\u751f\u7684\u201c\u6027\u80fd\u4f53\u68c0\u4eea\u201d**\u3002\u5b83\u80fd\u6a21\u62df\u6210\u767e\u4e0a\u5343\u7528\u6237\u540c\u65f6\u8bbf\u95ee\u7f51\u7ad9\u6216API\uff0c\u50cf\u201c\u538b\u529b\u6d4b\u8bd5\u4eea\u201d\u4e00\u6837\u5e2e\u4f60\u5feb\u901f\u68c0\u6d4b\u670d\u52a1\u5668\u5728\u9ad8\u8d1f\u8f7d\u4e0b\u7684\u54cd\u5e94\u901f\u5ea6\u3001\u541e\u5410\u91cf\u548c\u7a33\u5b9a\u6027\u3002\u65e0\u8bba\u662f\u65b0\u5f00\u53d1\u7684\u5e94\u7528\u4e0a\u7ebf\u524d\u505a\u201c\u6297\u538b\u6d4b\u8bd5\u201d\uff0c\u8fd8\u662f\u8001\u7cfb\u7edf\u4f18\u5316\u524d\u6478\u6e05\u695a\u6027\u80fd\u74f6\u9888\uff0c\u7528`ab`\u7b80\u5355\u51e0\u884c\u547d\u4ee4\u5c31\u80fd\u8f7b\u677e\u5b8c\u6210\u57fa\u7840\u6027\u80fd\u8bc4\u4f30\uff0c\u8ba9\u4f60\u5bf9\u670d\u52a1\u5668\u7684\u201c\u6297\u538b\u80fd\u529b\u201d\u5fc3\u91cc\u6709\u6570\uff0c\u907f\u514d\u5173\u952e\u65f6\u523b\u201c\u6389\u94fe\u5b50\u201d\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3702,331,58,1002,3701,44],"topic":[],"class_list":["post-40488","post","type-post","status-publish","format-standard","hentry","category-server","tag-ab","tag-apache","tag-linux","tag-1002","tag-linux-","tag-44"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u6bcf\u5929\u638c\u63e1\u4e00\u4e2aLinux\u547d\u4ee4 - ab\uff08Apache Benchmark\uff09 - \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\/40488.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u6bcf\u5929\u638c\u63e1\u4e00\u4e2aLinux\u547d\u4ee4 - ab\uff08Apache Benchmark\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb833\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u4f60\u662f\u5426\u9047\u5230\u8fc7\u7f51\u7ad9\u7a81\u7136\u6d8c\u5165\u5927\u91cf\u7528\u6237\u65f6\u5361\u987f\u5d29\u6e83\u7684\u60c5\u51b5\uff1f\u60f3\u77e5\u9053\u81ea\u5bb6\u670d\u52a1\u5668\u80fd\u625b\u4f4f\u591a\u5c11\u5e76\u53d1\u8bf7\u6c42\u5417\uff1f**`ab`\uff08Apache Benchmark\uff09\u5c31\u662f\u4e13\u4e3a\u89e3\u51b3\u8fd9\u7c7b\u95ee\u9898\u800c\u751f\u7684\u201c\u6027\u80fd\u4f53\u68c0\u4eea\u201d**\u3002\u5b83\u80fd\u6a21\u62df\u6210\u767e\u4e0a\u5343\u7528\u6237\u540c\u65f6\u8bbf\u95ee\u7f51\u7ad9\u6216API\uff0c\u50cf\u201c\u538b\u529b\u6d4b\u8bd5\u4eea\u201d\u4e00\u6837\u5e2e\u4f60\u5feb\u901f\u68c0\u6d4b\u670d\u52a1\u5668\u5728\u9ad8\u8d1f\u8f7d\u4e0b\u7684\u54cd\u5e94\u901f\u5ea6\u3001\u541e\u5410\u91cf\u548c\u7a33\u5b9a\u6027\u3002\u65e0\u8bba\u662f\u65b0\u5f00\u53d1\u7684\u5e94\u7528\u4e0a\u7ebf\u524d\u505a\u201c\u6297\u538b\u6d4b\u8bd5\u201d\uff0c\u8fd8\u662f\u8001\u7cfb\u7edf\u4f18\u5316\u524d\u6478\u6e05\u695a\u6027\u80fd\u74f6\u9888\uff0c\u7528`ab`\u7b80\u5355\u51e0\u884c\u547d\u4ee4\u5c31\u80fd\u8f7b\u677e\u5b8c\u6210\u57fa\u7840\u6027\u80fd\u8bc4\u4f30\uff0c\u8ba9\u4f60\u5bf9\u670d\u52a1\u5668\u7684\u201c\u6297\u538b\u80fd\u529b\u201d\u5fc3\u91cc\u6709\u6570\uff0c\u907f\u514d\u5173\u952e\u65f6\u523b\u201c\u6389\u94fe\u5b50\u201d\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/40488.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-29T01:37:44+00:00\" \/>\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\/40488.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/40488.html\",\"name\":\"\u6bcf\u5929\u638c\u63e1\u4e00\u4e2aLinux\u547d\u4ee4 - ab\uff08Apache Benchmark\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-29T01:37:44+00:00\",\"dateModified\":\"2025-05-29T01:37:44+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/40488.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/40488.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40488.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u6bcf\u5929\u638c\u63e1\u4e00\u4e2aLinux\u547d\u4ee4 - ab\uff08Apache Benchmark\uff09\"}]},{\"@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":"\u6bcf\u5929\u638c\u63e1\u4e00\u4e2aLinux\u547d\u4ee4 - ab\uff08Apache Benchmark\uff09 - \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\/40488.html","og_locale":"zh_CN","og_type":"article","og_title":"\u6bcf\u5929\u638c\u63e1\u4e00\u4e2aLinux\u547d\u4ee4 - ab\uff08Apache Benchmark\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb833\u6b21\uff0c\u70b9\u8d5e27\u6b21\uff0c\u6536\u85cf9\u6b21\u3002\u4f60\u662f\u5426\u9047\u5230\u8fc7\u7f51\u7ad9\u7a81\u7136\u6d8c\u5165\u5927\u91cf\u7528\u6237\u65f6\u5361\u987f\u5d29\u6e83\u7684\u60c5\u51b5\uff1f\u60f3\u77e5\u9053\u81ea\u5bb6\u670d\u52a1\u5668\u80fd\u625b\u4f4f\u591a\u5c11\u5e76\u53d1\u8bf7\u6c42\u5417\uff1f**`ab`\uff08Apache Benchmark\uff09\u5c31\u662f\u4e13\u4e3a\u89e3\u51b3\u8fd9\u7c7b\u95ee\u9898\u800c\u751f\u7684\u201c\u6027\u80fd\u4f53\u68c0\u4eea\u201d**\u3002\u5b83\u80fd\u6a21\u62df\u6210\u767e\u4e0a\u5343\u7528\u6237\u540c\u65f6\u8bbf\u95ee\u7f51\u7ad9\u6216API\uff0c\u50cf\u201c\u538b\u529b\u6d4b\u8bd5\u4eea\u201d\u4e00\u6837\u5e2e\u4f60\u5feb\u901f\u68c0\u6d4b\u670d\u52a1\u5668\u5728\u9ad8\u8d1f\u8f7d\u4e0b\u7684\u54cd\u5e94\u901f\u5ea6\u3001\u541e\u5410\u91cf\u548c\u7a33\u5b9a\u6027\u3002\u65e0\u8bba\u662f\u65b0\u5f00\u53d1\u7684\u5e94\u7528\u4e0a\u7ebf\u524d\u505a\u201c\u6297\u538b\u6d4b\u8bd5\u201d\uff0c\u8fd8\u662f\u8001\u7cfb\u7edf\u4f18\u5316\u524d\u6478\u6e05\u695a\u6027\u80fd\u74f6\u9888\uff0c\u7528`ab`\u7b80\u5355\u51e0\u884c\u547d\u4ee4\u5c31\u80fd\u8f7b\u677e\u5b8c\u6210\u57fa\u7840\u6027\u80fd\u8bc4\u4f30\uff0c\u8ba9\u4f60\u5bf9\u670d\u52a1\u5668\u7684\u201c\u6297\u538b\u80fd\u529b\u201d\u5fc3\u91cc\u6709\u6570\uff0c\u907f\u514d\u5173\u952e\u65f6\u523b\u201c\u6389\u94fe\u5b50\u201d\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/40488.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-29T01:37:44+00:00","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\/40488.html","url":"https:\/\/www.wsisp.com\/helps\/40488.html","name":"\u6bcf\u5929\u638c\u63e1\u4e00\u4e2aLinux\u547d\u4ee4 - ab\uff08Apache Benchmark\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-29T01:37:44+00:00","dateModified":"2025-05-29T01:37:44+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/40488.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/40488.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/40488.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u6bcf\u5929\u638c\u63e1\u4e00\u4e2aLinux\u547d\u4ee4 - ab\uff08Apache Benchmark\uff09"}]},{"@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\/40488","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=40488"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/40488\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=40488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=40488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=40488"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=40488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}