{"id":160753,"date":"2019-10-22T12:10:53","date_gmt":"2019-10-22T04:10:53","guid":{"rendered":"https:\/\/gulass.cn\/?p=160753"},"modified":"2019-10-07T18:12:19","modified_gmt":"2019-10-07T10:12:19","slug":"performance-issues-linux-servers","status":"publish","type":"post","link":"https:\/\/gulass.cn\/performance-issues-linux-servers.html","title":{"rendered":"\u65e0\u6c34\u5e72\u8d27-\u5982\u4f55\u5feb\u901f\u5206\u6790Linux\u670d\u52a1\u5668\u7684\u6027\u80fd\u95ee\u9898"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u4f5c\u4e3a\u4e00\u540dlinux\u7cfb\u7edf\u8fd0\u7ef4\u4eba\u5458\uff0c\u6700\u4e3b\u8981\u7684\u5de5\u4f5c\u662f\u4f18\u5316\u7cfb\u7edf\u914d\u7f6e\uff0c\u4f7f\u5e94\u7528\u5728\u7cfb\u7edf\u4e0a\u4ee5\u6700\u4f18\u7684\u72b6\u6001\u8fd0\u884c\uff0c\u4f46\u662f\u7531\u4e8e\u786c\u4ef6\u95ee\u9898\u3001\u8f6f\u4ef6\u95ee\u9898\u3001\u7f51\u7edc\u73af\u5883\u7b49\u7684\u590d\u6742\u6027 \u548c\u591a\u53d8\u6027\uff0c\u5bfc\u81f4\u5bf9\u7cfb\u7edf\u7684\u4f18\u5316\u53d8\u5f97\u5f02\u5e38\u590d\u6742\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u4f5c\u4e3a\u4e00\u540dlinux\u7cfb\u7edf\u8fd0\u7ef4\u4eba\u5458\uff0c\u6700\u4e3b\u8981\u7684\u5de5\u4f5c\u662f\u4f18\u5316\u7cfb\u7edf\u914d\u7f6e\uff0c\u4f7f\u5e94\u7528\u5728\u7cfb\u7edf\u4e0a\u4ee5\u6700\u4f18\u7684\u72b6\u6001\u8fd0\u884c\uff0c\u4f46\u662f\u7531\u4e8e\u786c\u4ef6\u95ee\u9898\u3001\u8f6f\u4ef6\u95ee\u9898\u3001\u7f51\u7edc\u73af\u5883\u7b49\u7684\u590d\u6742\u6027 \u548c\u591a\u53d8\u6027\uff0c\u5bfc\u81f4\u5bf9\u7cfb\u7edf\u7684\u4f18\u5316\u53d8\u5f97\u5f02\u5e38\u590d\u6742\uff0c\u5982\u4f55\u5b9a\u4f4d\u6027\u80fd\u95ee\u9898\u51fa\u5728\u54ea\u4e2a\u65b9\u9762\uff0c\u662f\u6027\u80fd\u4f18\u5316\u7684\u4e00\u5927\u96be\u9898\uff0c \u672c\u7ae0\u4ece\u7cfb\u7edf\u5165\u624b\uff0c\u91cd\u70b9\u8bb2\u8ff0\u7531\u4e8e\u7cfb\u7edf\u8f6f\u3001\u786c\u4ef6\u914d\u7f6e\u4e0d\u5f53\u53ef\u80fd\u9020\u6210\u7684\u6027\u80fd\u95ee\u9898\uff0c\u5e76\u4e14\u7ed9\u51fa\u4e86\u68c0\u6d4b\u7cfb\u7edf\u6545\u969c\u548c\u4f18\u5316\u6027\u80fd\u7684\u4e00\u822c\u65b9\u6cd5\u548c\u6d41\u7a0b\u3002
\n\"\"<\/p>\n

1 cpu\u6027\u80fd\u8bc4\u4f30<\/strong><\/div>\n

Cpu\u662f\u5f71\u54cdLinux\u6027\u80fd\u7684\u4e3b\u8981\u56e0\u7d20\u4e4b\u4e00\uff0c\u4e0b\u9762\u5148\u4ecb\u7ecd\u51e0\u4e2a\u67e5\u770bCPU\u6027\u80fd\u7684\u547d\u4ee4\u3002<\/p>\n

1.1 vmstat\u547d\u4ee4<\/strong><\/span><\/div>\n

\u8be5\u547d\u4ee4\u53ef\u4ee5\u663e\u793a\u5173\u4e8e\u7cfb\u7edf\u5404\u79cd\u8d44\u6e90\u4e4b\u95f4\u76f8\u5173\u6027\u80fd\u7684\u7b80\u8981\u4fe1\u606f\uff0c\u8fd9\u91cc\u6211\u4eec\u4e3b\u8981\u7528\u5b83\u6765\u770bCPU\u7684\u4e00\u4e2a\u8d1f\u8f7d\u60c5\u51b5\u3002<\/p>\n

\u4e0b\u9762\u662fvmstat\u547d\u4ee4\u5728\u67d0\u4e2a\u7cfb\u7edf\u7684\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n

[root@node1 ~]# vmstat 2 3 \r\nprocs \u2014\u2014\u2014\u2013memory\u2014\u2014\u2014- \u2014swap\u2013 \u2014\u2013io\u2014- \u2013system\u2013 \u2014\u2013cpu\u2014\u2014 \r\n r b swpd free buff cache si so bi bo in cs us sy id wa st \r\n 0 0 0 162240 8304 67032 0 0 13 21 1007 23 0 1 98 0 0 \r\n 0 0 0 162240 8304 67032 0 0 1 0 1010 20 0 1 100 0 0 \r\n 0 0 0 162240 8304 67032 0 0 1 1 1009 18 0 1 99 0 0 \r\n<\/pre>\n

\u5bf9\u4e0a\u9762\u6bcf\u9879\u7684\u8f93\u51fa\u89e3\u91ca\u5982\u4e0b\uff1a<\/p>\n

\uf06c procs  \r\n\uf0d8 r\u5217\u8868\u793a\u8fd0\u884c\u548c\u7b49\u5f85cpu\u65f6\u95f4\u7247\u7684\u8fdb\u7a0b\u6570\uff0c\u8fd9\u4e2a\u503c\u5982\u679c\u957f\u671f\u5927\u4e8e\u7cfb\u7edfCPU\u7684\u4e2a\u6570\uff0c\u8bf4\u660eCPU\u4e0d\u8db3\uff0c\u9700\u8981\u589e\u52a0CPU\u3002 \r\n\uf0d8 b\u5217\u8868\u793a\u5728\u7b49\u5f85\u8d44\u6e90\u7684\u8fdb\u7a0b\u6570\uff0c\u6bd4\u5982\u6b63\u5728\u7b49\u5f85I\/O\u3001\u6216\u8005\u5185\u5b58\u4ea4\u6362\u7b49\u3002  \r\n\uf06c memory  \r\n\uf0d8 swpd\u5217\u8868\u793a\u5207\u6362\u5230\u5185\u5b58\u4ea4\u6362\u533a\u7684\u5185\u5b58\u6570\u91cf\uff08\u4ee5k\u4e3a\u5355\u4f4d\uff09\u3002\u5982\u679cswpd\u7684\u503c\u4e0d\u4e3a0\uff0c\u6216\u8005\u6bd4\u8f83\u5927\uff0c\u53ea\u8981si\u3001so\u7684\u503c\u957f\u671f\u4e3a0\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\u4e00\u822c\u4e0d\u7528\u62c5\u5fc3\uff0c\u4e0d\u4f1a\u5f71\u54cd\u7cfb\u7edf\u6027\u80fd\u3002 \r\n\uf0d8 free\u5217\u8868\u793a\u5f53\u524d\u7a7a\u95f2\u7684\u7269\u7406\u5185\u5b58\u6570\u91cf\uff08\u4ee5k\u4e3a\u5355\u4f4d\uff09  \r\n\uf0d8 buff\u5217\u8868\u793abuffers cache\u7684\u5185\u5b58\u6570\u91cf\uff0c\u4e00\u822c\u5bf9\u5757\u8bbe\u5907\u7684\u8bfb\u5199\u624d\u9700\u8981\u7f13\u51b2\u3002  \r\n\uf0d8 cache\u5217\u8868\u793apage cached\u7684\u5185\u5b58\u6570\u91cf\uff0c\u4e00\u822c\u4f5c\u4e3a\u6587\u4ef6\u7cfb\u7edfcached\uff0c\u9891\u7e41\u8bbf\u95ee\u7684\u6587\u4ef6\u90fd\u4f1a\u88abcached\uff0c\u5982\u679ccache\u503c\u8f83\u5927\uff0c\u8bf4\u660ecached\u7684\u6587\u4ef6\u6570\u8f83\u591a\uff0c\u5982\u679c\u6b64\u65f6IO\u4e2dbi\u6bd4\u8f83\u5c0f\uff0c\u8bf4\u660e\u6587\u4ef6\u7cfb\u7edf\u6548\u7387\u6bd4\u8f83\u597d\u3002  \r\n\uf06c swap  \r\n\uf0d8 si\u5217\u8868\u793a\u7531\u78c1\u76d8\u8c03\u5165\u5185\u5b58\uff0c\u4e5f\u5c31\u662f\u5185\u5b58\u8fdb\u5165\u5185\u5b58\u4ea4\u6362\u533a\u7684\u6570\u91cf\u3002  \r\n\uf0d8 so\u5217\u8868\u793a\u7531\u5185\u5b58\u8c03\u5165\u78c1\u76d8\uff0c\u4e5f\u5c31\u662f\u5185\u5b58\u4ea4\u6362\u533a\u8fdb\u5165\u5185\u5b58\u7684\u6570\u91cf\u3002 \r\n<\/pre>\n

\u4e00\u822c\u60c5\u51b5\u4e0b\uff0csi\u3001so\u7684\u503c\u90fd\u4e3a0\uff0c\u5982\u679csi\u3001so\u7684\u503c\u957f\u671f\u4e0d\u4e3a0\uff0c\u5219\u8868\u793a\u7cfb\u7edf\u5185\u5b58\u4e0d\u8db3\u3002\u9700\u8981\u589e\u52a0\u7cfb\u7edf\u5185\u5b58\u3002<\/p>\n

\uf06c IO\u9879\u663e\u793a\u78c1\u76d8\u8bfb\u5199\u72b6\u51b5 \r\n\uf0d8 Bi\u5217\u8868\u793a\u4ece\u5757\u8bbe\u5907\u8bfb\u5165\u6570\u636e\u7684\u603b\u91cf\uff08\u5373\u8bfb\u78c1\u76d8\uff09\uff08\u6bcf\u79d2kb\uff09\u3002 \r\n\uf0d8 Bo\u5217\u8868\u793a\u5199\u5165\u5230\u5757\u8bbe\u5907\u7684\u6570\u636e\u603b\u91cf\uff08\u5373\u5199\u78c1\u76d8\uff09\uff08\u6bcf\u79d2kb\uff09 \r\n<\/pre>\n

\u8fd9\u91cc\u6211\u4eec\u8bbe\u7f6e\u7684bi+bo\u53c2\u8003\u503c\u4e3a1000\uff0c\u5982\u679c\u8d85\u8fc71000\uff0c\u800c\u4e14wa\u503c\u8f83\u5927\uff0c\u5219\u8868\u793a\u7cfb\u7edf\u78c1\u76d8IO\u6709\u95ee\u9898\uff0c\u5e94\u8be5\u8003\u8651\u63d0\u9ad8\u78c1\u76d8\u7684\u8bfb\u5199\u6027\u80fd\u3002<\/p>\n

\uf06c system \u663e\u793a\u91c7\u96c6\u95f4\u9694\u5185\u53d1\u751f\u7684\u4e2d\u65ad\u6570 \r\n\uf0d8 in\u5217\u8868\u793a\u5728\u67d0\u4e00\u65f6\u95f4\u95f4\u9694\u4e2d\u89c2\u6d4b\u5230\u7684\u6bcf\u79d2\u8bbe\u5907\u4e2d\u65ad\u6570\u3002 \r\n\uf0d8 cs\u5217\u8868\u793a\u6bcf\u79d2\u4ea7\u751f\u7684\u4e0a\u4e0b\u6587\u5207\u6362\u6b21\u6570\u3002 \r\n<\/pre>\n

\u4e0a\u9762\u8fd92\u4e2a\u503c\u8d8a\u5927\uff0c\u4f1a\u770b\u5230\u7531\u5185\u6838\u6d88\u8017\u7684CPU\u65f6\u95f4\u4f1a\u8d8a\u591a\u3002<\/p>\n

\uf06c CPU\u9879\u663e\u793a\u4e86CPU\u7684\u4f7f\u7528\u72b6\u6001\uff0c\u6b64\u5217\u662f\u6211\u4eec\u5173\u6ce8\u7684\u91cd\u70b9\u3002 \r\n\uf0d8 us\u5217\u663e\u793a\u4e86\u7528\u6237\u8fdb\u7a0b\u6d88\u8017\u7684CPU \u65f6\u95f4\u767e\u5206\u6bd4\u3002us\u7684\u503c\u6bd4\u8f83\u9ad8\u65f6\uff0c\u8bf4\u660e\u7528\u6237\u8fdb\u7a0b\u6d88\u8017\u7684cpu\u65f6\u95f4\u591a\uff0c\u4f46\u662f\u5982\u679c\u957f\u671f\u5927\u4e8e50%\uff0c\u5c31\u9700\u8981\u8003\u8651\u4f18\u5316\u7a0b\u5e8f\u6216\u7b97\u6cd5\u3002 \r\n\uf0d8 sy\u5217\u663e\u793a\u4e86\u5185\u6838\u8fdb\u7a0b\u6d88\u8017\u7684CPU\u65f6\u95f4\u767e\u5206\u6bd4\u3002Sy\u7684\u503c\u8f83\u9ad8\u65f6\uff0c\u8bf4\u660e\u5185\u6838\u6d88\u8017\u7684CPU\u8d44\u6e90\u5f88\u591a\u3002 \r\n<\/pre>\n

\u6839\u636e\u7ecf\u9a8c\uff0cus+sy\u7684\u53c2\u8003\u503c\u4e3a80%\uff0c\u5982\u679cus+sy\u5927\u4e8e 80%\u8bf4\u660e\u53ef\u80fd\u5b58\u5728CPU\u8d44\u6e90\u4e0d\u8db3\u3002<\/p>\n

\uf0d8 id \u5217\u663e\u793a\u4e86CPU\u5904\u5728\u7a7a\u95f2\u72b6\u6001\u7684\u65f6\u95f4\u767e\u5206\u6bd4\u3002 \r\n\uf0d8 wa\u5217\u663e\u793a\u4e86IO\u7b49\u5f85\u6240\u5360\u7528\u7684CPU\u65f6\u95f4\u767e\u5206\u6bd4\u3002wa\u503c\u8d8a\u9ad8\uff0c\u8bf4\u660eIO\u7b49\u5f85\u8d8a\u4e25\u91cd\uff0c\u6839\u636e\u7ecf\u9a8c\uff0cwa\u7684\u53c2\u8003\u503c\u4e3a20%\uff0c\u5982\u679cwa\u8d85\u8fc720%\uff0c\u8bf4\u660eIO\u7b49\u5f85\u4e25\u91cd\uff0c\u5f15\u8d77IO\u7b49\u5f85\u7684\u539f\u56e0\u53ef\u80fd\u662f\u78c1\u76d8\u5927\u91cf\u968f\u673a\u8bfb\u5199\u9020\u6210\u7684\uff0c\u4e5f\u53ef\u80fd\u662f\u78c1\u76d8\u6216\u8005\u78c1\u76d8\u63a7\u5236\u5668\u7684\u5e26\u5bbd\u74f6\u9888\u9020\u6210\u7684\uff08\u4e3b\u8981\u662f\u5757\u64cd\u4f5c\uff09\u3002 \r\n<\/pre>\n

\u7efc\u4e0a\u6240\u8ff0\uff0c\u5728\u5bf9CPU\u7684\u8bc4\u4f30\u4e2d\uff0c\u9700\u8981\u91cd\u70b9\u6ce8\u610f\u7684\u662fprocs\u9879r\u5217\u7684\u503c\u548cCPU\u9879\u4e2dus\u3001sy\u548cid\u5217\u7684\u503c\u3002<\/p>\n

1.2 sar\u547d\u4ee4<\/strong><\/span><\/div>\n

\u68c0\u67e5CPU\u6027\u80fd\u7684\u7b2c\u4e8c\u4e2a\u5de5\u5177\u662fsar\uff0csar\u529f\u80fd\u5f88\u5f3a\u5927\uff0c\u53ef\u4ee5\u5bf9\u7cfb\u7edf\u7684\u6bcf\u4e2a\u65b9\u9762\u8fdb\u884c\u5355\u72ec\u7684\u7edf\u8ba1\uff0c\u4f46\u662f\u4f7f\u7528sar\u547d\u4ee4\u4f1a\u589e\u52a0\u7cfb\u7edf\u5f00\u9500\uff0c\u4e0d\u8fc7\u8fd9\u4e9b\u5f00\u9500\u662f\u53ef\u4ee5\u8bc4\u4f30\u7684\uff0c\u5bf9\u7cfb\u7edf\u7684\u7edf\u8ba1\u7ed3\u679c\u4e0d\u4f1a\u6709\u5f88\u5927\u5f71\u54cd\u3002
\n\u4e0b\u9762\u662fsar\u547d\u4ee4\u5bf9\u67d0\u4e2a\u7cfb\u7edf\u7684CPU\u7edf\u8ba1\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# sar -u 3 5 \r\nLinux 2.6.9-42.ELsmp (webserver) 11\/28\/2008 _i686_ (8 CPU) \r\n11:41:24 AM CPU %user %nice %system %iowait %steal %idle \r\n11:41:27 AM all 0.88 0.00 0.29 0.00 0.00 98.83 \r\n11:41:30 AM all 0.13 0.00 0.17 0.21 0.00 99.50 \r\n11:41:33 AM all 0.04 0.00 0.04 0.00 0.00 99.92 \r\n11:41:36 AM all 0.29 0.00 0.13 0.00 0.00 99.58 \r\n11:41:39 AM all 0.38 0.00 0.17 0.04 0.00 99.41 \r\nAverage: all 0.34 0.00 0.16 0.05 0.00 99.45 \r\n<\/pre>\n

\u5bf9\u4e0a\u9762\u6bcf\u9879\u7684\u8f93\u51fa\u89e3\u91ca\u5982\u4e0b\uff1a<\/p>\n

\uf06c %user\u5217\u663e\u793a\u4e86\u7528\u6237\u8fdb\u7a0b\u6d88\u8017\u7684CPU \u65f6\u95f4\u767e\u5206\u6bd4\u3002 \r\n\uf06c %nice\u5217\u663e\u793a\u4e86\u8fd0\u884c\u6b63\u5e38\u8fdb\u7a0b\u6240\u6d88\u8017\u7684CPU \u65f6\u95f4\u767e\u5206\u6bd4\u3002 \r\n\uf06c %system\u5217\u663e\u793a\u4e86\u7cfb\u7edf\u8fdb\u7a0b\u6d88\u8017\u7684CPU\u65f6\u95f4\u767e\u5206\u6bd4\u3002 \r\n\uf06c %iowait\u5217\u663e\u793a\u4e86IO\u7b49\u5f85\u6240\u5360\u7528\u7684CPU\u65f6\u95f4\u767e\u5206\u6bd4 \r\n\uf06c %steal\u5217\u663e\u793a\u4e86\u5728\u5185\u5b58\u76f8\u5bf9\u7d27\u5f20\u7684\u73af\u5883\u4e0bpagein\u5f3a\u5236\u5bf9\u4e0d\u540c\u7684\u9875\u9762\u8fdb\u884c\u7684steal\u64cd\u4f5c \u3002 \r\n\uf06c %idle\u5217\u663e\u793a\u4e86CPU\u5904\u5728\u7a7a\u95f2\u72b6\u6001\u7684\u65f6\u95f4\u767e\u5206\u6bd4\u3002\r\n<\/pre>\n

\u8fd9\u4e2a\u8f93\u51fa\u662f\u5bf9\u7cfb\u7edf\u6574\u4f53CPU\u4f7f\u7528\u72b6\u51b5\u7684\u7edf\u8ba1\uff0c\u6bcf\u9879\u7684\u8f93\u51fa\u90fd\u975e\u5e38\u76f4\u89c2\uff0c\u5e76\u4e14\u6700\u540e\u4e00\u884cAverage\u662f\u4e2a\u6c47\u603b\u884c\uff0c\u662f\u4e0a\u9762\u7edf\u8ba1\u4fe1\u606f\u7684\u4e00\u4e2a\u5e73\u5747\u503c\u3002
\n\u9700\u8981\u6ce8\u610f\u7684\u4e00\u70b9\u662f\uff1a\u7b2c\u4e00\u884c\u7684\u7edf\u8ba1\u4fe1\u606f\u4e2d\u5305\u542b\u4e86sar\u672c\u8eab\u7684\u7edf\u8ba1\u6d88\u8017\uff0c\u6240\u4ee5%user\u5217\u7684\u503c\u4f1a\u504f\u9ad8\u4e00\u70b9\uff0c\u4e0d\u8fc7\uff0c\u8fd9\u4e0d\u4f1a\u5bf9\u7edf\u8ba1\u7ed3\u679c\u4ea7\u751f\u591a\u5927\u5f71\u54cd\u3002
\n\u5728\u4e00\u4e2a\u591aCPU\u7684\u7cfb\u7edf\u4e2d\uff0c\u5982\u679c\u7a0b\u5e8f\u4f7f\u7528\u4e86\u5355\u7ebf\u7a0b\uff0c\u4f1a\u51fa\u73b0\u8fd9\u4e48\u4e00\u4e2a\u73b0\u8c61\uff0cCPU\u7684\u6574\u4f53\u4f7f\u7528\u7387\u4e0d\u9ad8\uff0c\u4f46\u662f\u7cfb\u7edf\u5e94\u7528\u5374\u54cd\u5e94\u7f13\u6162\uff0c\u8fd9\u53ef\u80fd\u662f\u7531\u4e8e\u7a0b\u5e8f\u4f7f\u7528\u5355\u7ebf\u7a0b\u7684\u539f\u56e0\uff0c\u5355\u7ebf\u7a0b\u53ea\u4f7f\u7528\u4e00\u4e2aCPU\uff0c\u5bfc\u81f4\u8fd9\u4e2aCPU\u5360\u7528\u7387\u4e3a100%\uff0c\u65e0\u6cd5\u5904\u7406\u5176\u5b83\u8bf7\u6c42\uff0c\u800c\u5176\u5b83\u7684CPU\u5374\u95f2\u7f6e\uff0c\u8fd9\u5c31\u5bfc\u81f4 \u4e86\u6574\u4f53CPU\u4f7f\u7528\u7387\u4e0d\u9ad8\uff0c\u800c\u5e94\u7528\u7f13\u6162 \u73b0\u8c61\u7684\u53d1\u751f \u3002
\n\u9488\u5bf9\u8fd9\u4e2a\u95ee\u9898\uff0c\u53ef\u4ee5\u5bf9\u7cfb\u7edf\u7684\u6bcf\u4e2aCPU\u5206\u5f00\u67e5\u8be2\uff0c\u7edf\u8ba1\u6bcf\u4e2aCPU\u7684\u4f7f\u7528\u60c5\u51b5\uff1a<\/p>\n

[root@webserver ~]# sar -P 0 3 5 \r\nLinux 2.6.9-42.ELsmp (webserver) 11\/29\/2008 _i686_ (8 CPU) \r\n06:29:33 PM CPU %user %nice %system %iowait %steal %idle \r\n06:29:36 PM 0 3.00 0.00 0.33 0.00 0.00 96.67 \r\n06:29:39 PM 0 0.67 0.00 0.33 0.00 0.00 99.00 \r\n06:29:42 PM 0 0.00 0.00 0.33 0.00 0.00 99.67 \r\n06:29:45 PM 0 0.67 0.00 0.33 0.00 0.00 99.00 \r\n06:29:48 PM 0 1.00 0.00 0.33 0.33 0.00 98.34 \r\nAverage: 0 1.07 0.00 0.33 0.07 0.00 98.53 \r\n<\/pre>\n

\u8fd9\u4e2a\u8f93\u51fa\u662f\u5bf9\u7cfb\u7edf\u7684\u7b2c\u4e00\u9897CPU\u7684\u4fe1\u606f\u7edf\u8ba1\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0csar\u4e2d\u5bf9CPU\u7684\u8ba1\u6570\u662f\u4ece0\u5f00\u59cb\u7684\uff0c\u56e0\u6b64\uff0c\u201csar -P 0 3 5\u201d\u8868\u793a\u5bf9\u7cfb\u7edf\u7684\u7b2c\u4e00\u9897CPU\u8fdb\u884c\u4fe1\u606f\u7edf\u8ba1\uff0c\u201csar -P 4 3 5\u201d\u5219\u8868\u793a\u5bf9\u7cfb\u7edf\u7684\u7b2c\u4e94\u9897CPU\u8fdb\u884c\u7edf\u8ba1\u3002\u4f9d\u6b21\u7c7b\u63a8\u3002\u53ef\u4ee5\u770b\u51fa\uff0c\u4e0a\u9762\u7684\u7cfb\u7edf\u6709\u516b\u9897CPU\u3002<\/p>\n

1.3 iostat\u547d\u4ee4<\/strong><\/span><\/div>\n

iostat\u6307\u4ee4\u4e3b\u8981\u7528\u4e8e\u7edf\u8ba1\u78c1\u76d8IO\u72b6\u6001\uff0c\u4f46\u662f\u4e5f\u80fd\u67e5\u770bCPU\u7684\u4f7f\u7528\u4fe1\u606f\uff0c\u5b83\u7684\u5c40\u9650\u6027\u662f\u53ea\u80fd\u663e\u793a\u7cfb\u7edf\u6240\u6709CPU\u7684\u5e73\u5747\u4fe1\u606f\uff0c\u770b\u4e0b\u9762\u7684\u4e00\u4e2a\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# iostat -c \r\nLinux 2.6.9-42.ELsmp (webserver) 11\/29\/2008 _i686_ (8 CPU) \r\navg-cpu: %user %nice %system %iowait %steal %idle \r\n2.52 0.00 0.30 0.24 0.00 96.96 \r\n<\/pre>\n

\u5728\u8fd9\u91cc\uff0c\u6211\u4eec\u4f7f\u7528\u4e86\u201c-c\u201d\u53c2\u6570\uff0c\u53ea\u663e\u793a\u7cfb\u7edfCPU\u7684\u7edf\u8ba1\u4fe1\u606f\uff0c\u8f93\u51fa\u4e2d\u6bcf\u9879\u4ee3\u8868\u7684\u542b\u4e49\u4e0esar\u547d\u4ee4\u7684\u8f93\u51fa\u9879\u5b8c\u5168\u76f8\u540c\uff0c\u4e0d\u518d\u8be6\u8ff0\u3002<\/p>\n

1.4 uptime\u547d\u4ee4<\/strong><\/span><\/div>\n

uptime\u662f\u76d1\u63a7\u7cfb\u7edf\u6027\u80fd\u6700\u5e38\u7528\u7684\u4e00\u4e2a\u547d\u4ee4\uff0c\u4e3b\u8981\u7528\u6765\u7edf\u8ba1\u7cfb\u7edf\u5f53\u524d\u7684\u8fd0\u884c\u72b6\u51b5\uff0c\u8f93\u51fa\u7684\u4fe1\u606f\u4f9d\u6b21\u4e3a\uff1a\u7cfb\u7edf\u73b0\u5728\u7684\u65f6\u95f4\u3001\u7cfb\u7edf\u4ece\u4e0a\u6b21\u5f00\u673a\u5230\u73b0\u5728\u8fd0\u884c\u4e86\u591a\u957f\u65f6\u95f4\u3001\u7cfb\u7edf\u76ee\u524d\u6709\u591a\u5c11\u767b\u9646\u7528\u6237\u3001\u7cfb\u7edf\u5728\u4e00\u5206\u949f\u5185\u3001\u4e94\u5206\u949f\u5185\u3001\u5341\u4e94\u5206\u949f\u5185\u7684\u5e73\u5747\u8d1f\u8f7d\u3002\u770b\u4e0b\u9762\u7684\u4e00\u4e2a\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# uptime \r\n18:52:11 up 27 days, 19:44, 2 users, load average: 0.12, 0.08, 0.08 \r\n<\/pre>\n

\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u7684\u662fload average\u8fd9\u4e2a\u8f93\u51fa\u503c\uff0c\u8fd9\u4e09\u4e2a\u503c\u7684\u5927\u5c0f\u4e00\u822c\u4e0d\u80fd\u5927\u4e8e\u7cfb\u7edfCPU\u7684\u4e2a\u6570\uff0c\u4f8b\u5982\uff0c\u672c\u8f93\u51fa\u4e2d\u7cfb\u7edf\u67098\u4e2aCPU,\u5982\u679cload average\u7684\u4e09\u4e2a\u503c\u957f\u671f\u5927\u4e8e8\u65f6\uff0c\u8bf4\u660eCPU\u5f88\u7e41\u5fd9\uff0c\u8d1f\u8f7d\u5f88\u9ad8\uff0c\u53ef\u80fd\u4f1a\u5f71\u54cd\u7cfb\u7edf\u6027\u80fd\uff0c\u4f46\u662f\u5076\u5c14\u5927\u4e8e8\u65f6\uff0c\u5012\u4e0d\u7528\u62c5\u5fc3\uff0c\u4e00\u822c\u4e0d\u4f1a\u5f71\u54cd\u7cfb\u7edf\u6027\u80fd\u3002\u76f8\u53cd\uff0c\u5982\u679cload average\u7684\u8f93\u51fa\u503c\u5c0f\u4e8eCPU\u7684\u4e2a\u6570\uff0c\u5219\u8868\u793aCPU\u8fd8\u6709\u7a7a\u95f2\u7684\u65f6\u95f4\u7247\uff0c\u6bd4\u5982\u672c\u4f8b\u4e2d\u7684\u8f93\u51fa\uff0cCPU\u662f\u975e\u5e38\u7a7a\u95f2\u7684\u3002<\/p>\n

1.5 \u672c\u8282\u5c0f\u7ed3<\/strong><\/span><\/div>\n

\u4e0a\u9762\u4ecb\u7ecd\u4e86\u68c0\u67e5CPU\u4f7f\u7528\u72b6\u51b5\u7684\u56db\u4e2a\u547d\u4ee4\uff0c\u901a\u8fc7\u8fd9\u4e9b\u547d\u4ee4\u9700\u8981\u4e86\u89e3\u7684\u662f\uff1a\u7cfb\u7edfCPU\u662f\u5426\u51fa\u73b0\u6027\u80fd\u74f6\u9888\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u4ee5\u4e0a\u8fd9\u4e9b\u547d\u4ee4\u53ea\u80fd\u67e5\u770bCPU\u662f\u5426\u7e41\u5fd9\uff0c\u8d1f\u8f7d\u662f\u5426\u8fc7\u5927\uff0c\u4f46\u662f\u65e0\u6cd5\u77e5\u9053CPU\u4e3a\u4f55\u8d1f\u8f7d\u8fc7\u5927\uff0c\u56e0\u800c\uff0c\u5224\u65ad\u7cfb\u7edfCPU\u51fa\u73b0\u95ee\u9898\u540e\uff0c\u8981\u7ed3\u5408top\u3001ps\u7b49\u547d\u4ee4\u8fdb\u4e00\u6b65\u68c0\u67e5\u662f\u7531\u90a3\u4e9b\u8fdb\u7a0b\u5bfc\u81f4CPU\u8d1f\u8f7d\u8fc7\u5927\u7684\u3002\u5f15\u8d77CPU\u8d44\u6e90\u7d27\u7f3a\u7684\u539f\u56e0\u53ef\u80fd\u662f\u5e94\u7528\u7a0b\u5e8f\u4e0d\u5408\u7406\u9020\u6210\u7684\uff0c\u4e5f\u53ef\u80fd\u662f\u786c\u4ef6\u8d44\u6e90\u532e\u4e4f\u5f15\u8d77\u7684\uff0c\u6240\u4ee5\uff0c\u8981\u5177\u4f53\u95ee\u9898\u5177\u4f53\u5206\u6790\uff0c\u6216\u8005\u4f18\u5316\u5e94\u7528\u7a0b\u5e8f\uff0c\u6216\u8005\u589e\u52a0\u7cfb\u7edfCPU\u8d44\u6e90\u3002<\/p>\n

2 \u5185\u5b58\u6027\u80fd\u8bc4\u4f30<\/strong><\/div>\n

\u5185\u5b58\u7684\u7ba1\u7406\u548c\u4f18\u5316\u662f\u7cfb\u7edf\u6027\u80fd\u4f18\u5316\u7684\u4e00\u4e2a\u91cd\u8981\u90e8\u5206\uff0c\u5185\u5b58\u8d44\u6e90\u7684\u5145\u8db3\u4e0e\u5426\u76f4\u63a5\u5f71\u54cd\u5e94\u7528\u7cfb\u7edf\u7684\u4f7f\u7528\u6027\u80fd\uff0c\u5728\u8fdb\u884c\u5185\u5b58\u4f18\u5316\u4e4b\u524d\uff0c\u4e00\u5b9a\u8981\u719f\u6089linux\u7684\u5185\u5b58\u7ba1\u7406\u673a\u5236\uff0c\u8fd9\u4e00\u70b9\u6211\u4eec\u5728\u524d\u9762\u7684\u7ae0\u8282\u5df2\u7ecf\u6709\u6df1\u5165\u8bb2\u8ff0\uff0c\u672c\u8282\u7684\u91cd\u70b9\u662f\u5982\u4f55\u901a\u8fc7\u7cfb\u7edf\u547d\u4ee4\u76d1\u63a7linux\u7cfb\u7edf\u7684\u5185\u5b58\u4f7f\u7528\u72b6\u51b5\u3002<\/p>\n

2.1 free \u547d\u4ee4<\/strong><\/span><\/div>\n

free\u662f\u76d1\u63a7linux\u5185\u5b58\u4f7f\u7528\u72b6\u51b5\u6700\u5e38\u7528\u7684\u6307\u4ee4\uff0c\u770b\u4e0b\u9762\u7684\u4e00\u4e2a\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# free -m \r\ntotal used free shared buffers cached \r\nMem: 8111 7185 925 0 243 6299 \r\n-\/+ buffers\/cache: 643 7468 \r\nSwap: 8189 0 8189 \r\n<\/pre>\n

\u201cfree \u2013m\u201d\u8868\u793a\u4ee5M\u4e3a\u5355\u4f4d\u67e5\u770b\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\uff0c\u5728\u8fd9\u4e2a\u8f93\u51fa\u4e2d\uff0c\u6211\u4eec\u91cd\u70b9\u5173\u6ce8\u7684\u5e94\u8be5\u662ffree\u5217\u4e0ecached\u5217\u7684\u8f93\u51fa\u503c\uff0c\u7531\u8f93\u51fa\u53ef\u77e5\uff0c\u6b64\u7cfb\u7edf\u51718G\u5185\u5b58\uff0c\u7cfb\u7edf\u7a7a\u95f2\u5185\u5b58\u8fd8\u6709925M\uff0c\u5176\u4e2d\uff0cBuffer Cache\u5360\u7528\u4e86243M\uff0cPage Cache\u5360\u7528\u4e866299M\uff0c\u7531\u6b64\u53ef\u77e5\u7cfb\u7edf\u7f13\u5b58\u4e86\u5f88\u591a\u7684\u6587\u4ef6\u548c\u76ee\u5f55\uff0c\u800c\u5bf9\u4e8e\u5e94\u7528\u7a0b\u5e8f\u6765\u8bf4\uff0c\u53ef\u4ee5\u4f7f\u7528\u7684\u5185\u5b58\u8fd8\u67097468M\uff0c\u5f53\u7136\u8fd9\u4e2a7468M\u5305\u542b\u4e86Buffer Cache\u548cPage Cache\u7684\u503c\u3002\u5728swap\u9879\u53ef\u4ee5\u770b\u51fa\uff0c\u4ea4\u6362\u5206\u533a\u8fd8\u672a\u4f7f\u7528\u3002\u6240\u4ee5\u4ece\u5e94\u7528\u7684\u89d2\u5ea6\u6765\u8bf4\uff0c\u6b64\u7cfb\u7edf\u5185\u5b58\u8d44\u6e90\u8fd8\u975e\u5e38\u5145\u8db3\u3002<\/p>\n

\u4e00\u822c\u6709\u8fd9\u6837\u4e00\u4e2a\u7ecf\u9a8c\u516c\u5f0f\uff1a\u5e94\u7528\u7a0b\u5e8f\u53ef\u7528\u5185\u5b58\/\u7cfb\u7edf\u7269\u7406\u5185\u5b58>70%\u65f6\uff0c\u8868\u793a\u7cfb\u7edf\u5185\u5b58\u8d44\u6e90\u975e\u5e38\u5145\u8db3\uff0c\u4e0d\u5f71\u54cd\u7cfb\u7edf\u6027\u80fd\uff0c\u5e94\u7528\u7a0b\u5e8f\u53ef\u7528\u5185\u5b58\/\u7cfb\u7edf\u7269\u7406\u5185\u5b58<20%\u65f6\uff0c\u8868\u793a\u7cfb\u7edf\u5185\u5b58\u8d44\u6e90\u7d27\u7f3a\uff0c\u9700\u8981\u589e\u52a0\u7cfb\u7edf\u5185\u5b58\uff0c20%< \u5e94\u7528\u7a0b\u5e8f\u53ef\u7528\u5185\u5b58\/\u7cfb\u7edf\u7269\u7406\u5185\u5b58<70%\u65f6\uff0c\u8868\u793a\u7cfb\u7edf\u5185\u5b58\u8d44\u6e90\u57fa\u672c\u80fd\u6ee1\u8db3\u5e94\u7528\u9700\u6c42\uff0c\u6682\u65f6\u4e0d\u5f71\u54cd\u7cfb\u7edf\u6027\u80fd\u3002<\/p>\n

free\u547d\u4ee4\u8fd8\u53ef\u4ee5\u9002\u65f6\u7684\u76d1\u63a7\u5185\u5b58\u7684\u4f7f\u7528\u72b6\u51b5\uff0c\u4f7f\u7528\u201c-s\u201d\u53c2\u6570\u53ef\u4ee5\u5728\u6307\u5b9a\u7684\u65f6\u95f4\u6bb5\u5185\u4e0d\u95f4\u65ad\u7684\u76d1\u63a7\u5185\u5b58\u7684\u4f7f\u7528\u60c5\u51b5\uff1a<\/p>\n

[root@webserver ~]# free -b -s 5 \r\n total used free shared buffers cached \r\nMem: 8505901056 7528706048 977195008 0 260112384 6601158656 \r\n-\/+ buffers\/cache: 667435008 7838466048 \r\nSwap: 8587149312 163840 8586985472 \r\n     total used free shared buffers cached \r\nMem: 8505901056 7526936576 978964480 0 260128768 6601142272 \r\n-\/+ buffers\/cache: 665665536 7840235520 \r\nSwap: 8587149312 163840 8586985472 \r\n     total used free shared buffers cached \r\nMem: 8505901056 7523987456 981913600 0 260141056 6601129984 \r\n-\/+ buffers\/cache: 662716416 7843184640 \r\nSwap: 8587149312 163840 8586985472 \r\n<\/pre>\n

\u5176\u4e2d\uff0c\u201c-b\u201d\u8868\u793a\u4ee5\u5343\u5b57\u8282(\u4e5f\u5c31\u662f1024\u5b57\u8282\u4e3a\u5355\u4f4d)\u6765\u663e\u793a\u5185\u5b58\u4f7f\u7528\u60c5\u51b5\u3002<\/p>\n

2.2 \u901a\u8fc7watch\u4e0efree\u76f8\u7ed3\u5408\u52a8\u6001\u76d1\u63a7\u5185\u5b58\u72b6\u51b5<\/strong><\/span><\/div>\n

watch\u662f\u4e00\u4e2a\u975e\u5e38\u6709\u7528\u7684\u547d\u4ee4\uff0c\u51e0\u4e4e\u6bcf\u4e2alinux\u53d1\u884c\u7248\u90fd\u5e26\u6709\u8fd9\u4e2a\u5de5\u5177\uff0c\u901a\u8fc7watch\uff0c\u53ef\u4ee5\u52a8\u6001\u7684\u76d1\u63a7\u547d\u4ee4\u7684\u8fd0\u884c\u7ed3\u679c\uff0c\u7701\u53bb\u624b\u52a8\u6267\u884c\u7684\u9ebb\u70e6\u3002<\/p>\n

\u53ef\u4ee5\u5728watch\u540e\u9762\u8ddf\u4e0a\u9700\u8981\u8fd0\u884c\u7684\u547d\u4ee4\uff0cwatch\u5c31\u4f1a\u81ea\u52a8\u91cd\u590d\u53bb\u8fd0\u884c\u8fd9\u4e2a\u547d\u4ee4\uff0c\u9ed8\u8ba4\u662f2\u79d2\u949f\u6267\u884c\u4e00\u6b21\uff0c\u5e76\u628a\u6267\u884c\u7684\u7ed3\u679c\u66f4\u65b0\u5728\u5c4f\u5e55\u4e0a\u3002\u4f8b\u5982\uff1a<\/p>\n

[root@webserver ~]# watch -n 3 -d free \r\n Every 3.0s: free Sun Nov 30 16:23:20 2008 \r\n     total used free shared buffers cached \r\nMem: 8306544 7349548 956996 0 203296 6500024 \r\n-\/+ buffers\/cache: 646228 7660316 \r\nSwap: 8385888 160 8385728 \r\n<\/pre>\n

\u5176\u4e2d\uff0c\u201c-n\u201d\u6307\u5b9a\u91cd\u590d\u6267\u884c\u7684\u65f6\u95f4\uff0c\u201c-d\u201d\u8868\u793a\u9ad8\u4eae\u663e\u793a\u53d8\u52a8\u3002<\/p>\n

2.3 vmstat\u547d\u4ee4\u76d1\u63a7\u5185\u5b58<\/strong><\/span><\/div>\n

vmstat\u547d\u4ee4\u5728\u76d1\u63a7\u7cfb\u7edf\u5185\u5b58\u65b9\u9762\u529f\u80fd\u5f3a\u5927\uff0c\u8bf7\u770b\u4e0b\u9762\u7684\u4e00\u4e2a\u8f93\u51fa\uff1a<\/p>\n

procs \u2014\u2014\u2014\u2013memory\u2014\u2014\u2014- \u2014swap\u2013 \u2014\u2013io\u2014- \u2013system\u2013 \u2014-cpu\u2014- \r\n r b swpd free buff cache si so bi bo in cs us sy id wa \r\n 0 0 906440 22796 155616 1325496 340 180 2 4 1 4 80 0 10 10 \r\n 0 0 906440 42796 155616 1325496 320 289 0 54 1095 287 70 15 0 15 \r\n 0 0 906440 42884 155624 1325748 236 387 2 102 1064 276 78 2 5 15 \r\n<\/pre>\n

\u5bf9\u4e8e\u5185\u5b58\u7684\u76d1\u63a7\uff0c\u5728vmstat\u4e2d\u91cd\u70b9\u5173\u6ce8\u7684\u662fswpd\u3001si\u548cso\u884c\uff0c\u4ece\u8fd9\u4e2a\u8f93\u51fa\u53ef\u4ee5\u770b\u51fa\uff0c\u6b64\u7cfb\u7edf\u5185\u5b58\u8d44\u6e90\u7d27\u7f3a\uff0cswpd\u5360\u7528\u4e86900M\u5de6\u53f3\u5185\u5b58\uff0csi\u548cso\u5360\u7528\u5f88\u5927\uff0c\u800c\u7531\u4e8e\u7cfb\u7edf\u5185\u5b58\u7684\u7d27\u7f3a\uff0c\u5bfc\u81f4\u51fa\u73b015%\u5de6\u53f3\u7684\u7cfb\u7edf\u7b49\u5f85\uff0c\u6b64\u65f6\u589e\u52a0\u7cfb\u7edf\u7684\u5185\u5b58\u662f\u5fc5\u987b\u8981\u505a\u7684\u3002<\/p>\n

2.4 sar -r\u547d\u4ee4\u7ec4\u5408<\/strong><\/span><\/div>\n

sar\u547d\u4ee4\u4e5f\u53ef\u4ee5\u76d1\u63a7linux\u7684\u5185\u5b58\u4f7f\u7528\u72b6\u51b5\uff0c\u53ef\u4ee5\u901a\u8fc7\u201csar \u2013r\u201d\u7ec4\u5408\u67e5\u770b\u7cfb\u7edf\u5185\u5b58\u548c\u4ea4\u6362\u7a7a\u95f4\u7684\u4f7f\u7528\u7387\u3002\u8bf7\u770b\u4e0b\u9762\u7684\u4e00\u4e2a\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# sar -r 2 3 \r\nLinux 2.6.9-42.ELsmp (webserver) 11\/30\/2008 _i686_ (8 CPU) \r\n09:57:33 PM kbmemfree kbmemused %memused kbbuffers kbcached kbcommit %commit \r\n09:57:35 PM 897988 7408556 89.19 249428 6496532 786556 4.71 \r\n09:57:37 PM 898564 7407980 89.18 249428 6496532 784276 4.70 \r\n09:57:39 PM 899196 7407348 89.17 249440 6496520 782132 4.69 \r\nAverage: 898583 7407961 89.18 249432 6496528 784321 4.70 \r\n<\/pre>\n

\u5176\u4e2d\uff1a
\nKbmemfree\u8868\u793a\u7a7a\u95f2\u7269\u7406\u5185\u5b58\u5927\u5c0f\uff0ckbmemused\u8868\u793a\u5df2\u4f7f\u7528\u7684\u7269\u7406\u5185\u5b58\u7a7a\u95f4\u5927\u5c0f\uff0c%memused\u8868\u793a\u5df2\u4f7f\u7528\u5185\u5b58\u5360\u603b\u5185\u5b58\u5927\u5c0f\u7684\u767e\u5206\u6bd4\uff0ckbbuffers\u548ckbcached\u5206\u522b\u8868\u793aBuffer Cache\u548cPage Cache\u7684\u5927\u5c0f\uff0ckbcommit\u548c%commit\u5206\u522b\u8868\u793a\u5e94\u7528\u7a0b\u5e8f\u5f53\u524d\u4f7f\u7528\u7684\u5185\u5b58\u5927\u5c0f\u548c\u4f7f\u7528\u767e\u5206\u6bd4\u3002<\/p>\n

\u53ef\u4ee5\u770b\u51fasar\u7684\u8f93\u51fa\u5176\u5b9e\u4e0efree\u7684\u8f93\u51fa\u5b8c\u5168\u5bf9\u5e94\uff0c\u4e0d\u8fc7sar\u66f4\u52a0\u4eba\u6027\u5316\uff0c\u4e0d\u4f46\u7ed9\u51fa\u4e86\u5185\u5b58\u4f7f\u7528\u91cf\uff0c\u8fd8\u7ed9\u51fa\u4e86\u5185\u5b58\u4f7f\u7528\u7684\u767e\u5206\u6bd4\u4ee5\u53ca\u7edf\u8ba1\u7684\u5e73\u5747\u503c\u3002\u4ece%commit\u9879\u53ef\u77e5\uff0c\u6b64\u7cfb\u7edf\u76ee\u524d\u5185\u5b58\u8d44\u6e90\u5145\u8db3\u3002<\/p>\n

2.5 \u672c\u8282\u5c0f\u7ed3<\/strong><\/span><\/div>\n

\u4e0a\u9762\u4ecb\u7ecd\u4e86\u5185\u5b58\u76d1\u63a7\u5e38\u7528\u7684\u51e0\u4e2a\u6307\u4ee4\u4ee5\u53ca\u4e00\u4e9b\u7ecf\u9a8c\u89c4\u5219\uff0c\u5176\u5b9e\u73b0\u5728\u7684\u7cfb\u7edf\u5728\u5185\u5b58\u65b9\u9762\u51fa\u73b0\u7684\u74f6\u9888\u5df2\u7ecf\u5f88\u5c11\uff0c\u56e0\u4e3a\u5185\u5b58\u4ef7\u683c\u5f88\u4f4e\uff0c\u5145\u8db3\u7684\u5185\u5b58\u5df2\u7ecf\u5b8c\u5168\u80fd\u6ee1\u8db3\u5e94\u7528\u7a0b\u5e8f\u548c\u7cfb\u7edf\u672c\u8eab\u7684\u9700\u8981\uff0c\u5982\u679c\u7cfb\u7edf\u5728\u5185\u5b58\u65b9\u9762\u51fa\u73b0\u74f6\u9888\uff0c\u5f88\u5927\u7684\u53ef\u80fd\u662f\u5e94\u7528\u7a0b\u5e8f\u672c\u8eab\u7684\u95ee\u9898\u9020\u6210\u7684\u3002<\/p>\n

3 \u78c1\u76d8I\/O\u6027\u80fd\u8bc4\u4f30<\/strong><\/div>\n

\u5728\u5bf9\u78c1\u76d8I\/O\u6027\u80fd\u505a\u8bc4\u4f30\u4e4b\u524d\uff0c\u5fc5\u987b\u77e5\u9053\u7684\u51e0\u4e2a\u65b9\u9762\u662f\uff1a<\/p>\n

\u719f\u6089RAID\u5b58\u50a8\u65b9\u5f0f\uff0c\u53ef\u4ee5\u6839\u636e\u5e94\u7528\u7684\u4e0d\u540c\uff0c\u9009\u62e9\u4e0d\u540c\u7684RAID\u65b9\u5f0f\uff0c\u4f8b\u5982\uff0c\u5982\u679c\u4e00\u4e2a\u5e94\u7528\u7ecf\u5e38\u6709\u5927\u91cf\u7684\u8bfb\u64cd\u4f5c\uff0c\u53ef\u4ee5\u9009\u62e9RAID5\u65b9\u5f0f\u6784\u5efa\u78c1\u76d8\u9635\u5217\u5b58\u50a8\u6570\u636e\uff0c\u5982\u679c\u5e94\u7528\u6709\u5927\u91cf\u7684\u3001\u9891\u7e41\u7684\u5199\u64cd\u4f5c\uff0c\u53ef\u4ee5\u9009\u62e9raid0\u5b58\u53d6\u65b9\u5f0f\uff0c\u5982\u679c\u5e94\u7528\u5bf9\u6570\u636e\u5b89\u5168\u8981\u6c42\u5f88\u9ad8\uff0c\u540c\u65f6\u5bf9\u8bfb\u5199\u4e5f\u6709\u8981\u6c42\u7684\u8bdd\uff0c\u53ef\u4ee5\u8003\u8651raid01\u5b58\u53d6\u65b9\u5f0f\u7b49\u7b49\u3002
\n\u5c3d\u53ef\u80fd\u7528\u5185\u5b58\u7684\u8bfb\u5199\u4ee3\u66ff\u76f4\u63a5\u78c1\u76d8I\/O\uff0c\u4f7f\u9891\u7e41\u8bbf\u95ee\u7684\u6587\u4ef6\u6216\u6570\u636e\u653e\u5165\u5185\u5b58\u4e2d\u8fdb\u884c\u64cd\u4f5c\u5904\u7406\uff0c\u56e0\u4e3a\u5185\u5b58\u8bfb\u5199\u64cd\u4f5c\u6bd4\u76f4\u63a5\u78c1\u76d8\u8bfb\u5199\u7684\u6548\u7387\u8981\u9ad8\u5343\u500d\u3002
\n\u5c06\u7ecf\u5e38\u8fdb\u884c\u8bfb\u5199\u7684\u6587\u4ef6\u4e0e\u957f\u671f\u4e0d\u53d8\u7684\u6587\u4ef6\u72ec\u7acb\u51fa\u6765\uff0c\u5206\u522b\u653e\u7f6e\u5230\u4e0d\u540c\u7684\u78c1\u76d8\u8bbe\u5907\u4e0a\u3002
\n\u5bf9\u4e8e\u5199\u64cd\u4f5c\u9891\u7e41\u7684\u6570\u636e\uff0c\u53ef\u4ee5\u8003\u8651\u4f7f\u7528\u88f8\u8bbe\u5907\u4ee3\u66ff\u6587\u4ef6\u7cfb\u7edf\u3002\u8fd9\u91cc\u7b80\u8981\u8bb2\u8ff0\u4e0b\u6587\u4ef6\u7cfb\u7edf\u4e0e\u88f8\u8bbe\u5907\u7684\u5bf9\u6bd4\uff1a
\n\u4f7f\u7528\u88f8\u8bbe\u5907\u7684\u4f18\u70b9\u6709\uff1a<\/p>\n

\u6570\u636e\u53ef\u4ee5\u76f4\u63a5\u8bfb\u5199\uff0c\u4e0d\u9700\u8981\u7ecf\u8fc7\u64cd\u4f5c\u7cfb\u7edf\u7ea7\u7684\u7f13\u5b58\uff0c\u8282\u7701\u4e86\u5185\u5b58\u8d44\u6e90\uff0c\u907f\u514d\u4e86\u5185\u5b58\u8d44\u6e90\u4e89\u7528\u3002
\n\u907f\u514d\u4e86\u6587\u4ef6\u7cfb\u7edf\u7ea7\u7684\u7ef4\u62a4\u5f00\u9500\uff0c\u6bd4\u5982\u6587\u4ef6\u7cfb\u7edf\u9700\u8981\u7ef4\u62a4\u8d85\u7ea7\u5757\u3001I-node\u7b49\u3002
\n\u907f\u514d\u4e86\u64cd\u4f5c\u7cfb\u7edf\u7684cache\u9884\u8bfb\u529f\u80fd\uff0c\u51cf\u5c11\u4e86I\/O\u8bf7\u6c42\u3002
\n\u4f7f\u7528\u88f8\u8bbe\u5907\u7684\u7f3a\u70b9\u662f\uff1a<\/p>\n

\u6570\u636e\u7ba1\u7406\u3001\u7a7a\u95f4\u7ba1\u7406\u4e0d\u7075\u6d3b\uff0c\u9700\u8981\u5f88\u4e13\u4e1a\u7684\u4eba\u6765\u64cd\u4f5c\u3002
\n\u5176\u5b9e\u88f8\u8bbe\u5907\u7684\u4f18\u70b9\u5c31\u662f\u6587\u4ef6\u7cfb\u7edf\u7684\u7f3a\u70b9\uff0c\u53cd\u4e4b\u4e5f\u662f\u5982\u6b64\uff0c\u8fd9\u5c31\u9700\u8981\u6211\u4eec\u505a\u51fa\u5408\u7406\u7684\u89c4\u5212\u548c\u8861\u91cf\uff0c\u6839\u636e\u5e94\u7528\u7684\u9700\u6c42\uff0c\u505a\u51fa\u5bf9\u5e94\u7684\u7b56\u7565\u3002<\/p>\n

\u4e0b\u9762\u63a5\u7740\u4ecb\u7ecd\u5bf9\u78c1\u76d8IO\u7684\u8bc4\u4f30\u6807\u51c6\u3002<\/p>\n

3.1 sar -d\u547d\u4ee4\u7ec4\u5408<\/strong><\/span><\/div>\n

\u901a\u8fc7\u201csar \u2013d\u201d\u7ec4\u5408\uff0c\u53ef\u4ee5\u5bf9\u7cfb\u7edf\u7684\u78c1\u76d8IO\u505a\u4e00\u4e2a\u57fa\u672c\u7684\u7edf\u8ba1\uff0c\u8bf7\u770b\u4e0b\u9762\u7684\u4e00\u4e2a\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# sar -d 2 3 \r\nLinux 2.6.9-42.ELsmp (webserver) 11\/30\/2008 _i686_ (8 CPU) \r\n11:09:33 PM DEV tps rd_sec\/s wr_sec\/s avgrq-sz avgqu-sz await svctm %util \r\n11:09:35 PM dev8-0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 \r\n11:09:35 PM DEV tps rd_sec\/s wr_sec\/s avgrq-sz avgqu-sz await svctm %util \r\n11:09:37 PM dev8-0 1.00 0.00 12.00 12.00 0.00 0.00 0.00 0.00 \r\n11:09:37 PM DEV tps rd_sec\/s wr_sec\/s avgrq-sz avgqu-sz await svctm %util \r\n11:09:39 PM dev8-0 1.99 0.00 47.76 24.00 0.00 0.50 0.25 0.05 \r\nAverage: DEV tps rd_sec\/s wr_sec\/s avgrq-sz avgqu-sz await svctm %util \r\nAverage: dev8-0 1.00 0.00 19.97 20.00 0.00 0.33 0.17 0.02 \r\n<\/pre>\n

\u5bf9\u4e0a\u9762\u6bcf\u9879\u7684\u8f93\u51fa\u89e3\u91ca\u5982\u4e0b\uff1a<\/p>\n

DEV\u8868\u793a\u78c1\u76d8\u8bbe\u5907\u540d\u79f0\u3002
\ntps\u8868\u793a\u6bcf\u79d2\u5230\u7269\u7406\u78c1\u76d8\u7684\u4f20\u9001\u6570\uff0c\u4e5f\u5c31\u662f\u6bcf\u79d2\u7684I\/O\u6d41\u91cf\u3002\u4e00\u4e2a\u4f20\u9001\u5c31\u662f\u4e00\u4e2aI\/O\u8bf7\u6c42\uff0c\u591a\u4e2a\u903b\u8f91\u8bf7\u6c42\u53ef\u4ee5\u88ab\u5408\u5e76\u4e3a\u4e00\u4e2a\u7269\u7406I\/O\u8bf7\u6c42\u3002
\nd_sec\/s\u8868\u793a\u6bcf\u79d2\u4ece\u8bbe\u5907\u8bfb\u53d6\u7684\u6247\u533a\u6570(1\u6247\u533a=512\u5b57\u8282)\u3002
\nwr_sec\/s\u8868\u793a\u6bcf\u79d2\u5199\u5165\u8bbe\u5907\u7684\u6247\u533a\u6570\u76ee\u3002
\navgrq-sz\u8868\u793a\u5e73\u5747\u6bcf\u6b21\u8bbe\u5907I\/O\u64cd\u4f5c\u7684\u6570\u636e\u5927\u5c0f(\u4ee5\u6247\u533a\u4e3a\u5355\u4f4d)\u3002
\navgqu-sz\u8868\u793a\u5e73\u5747I\/O\u961f\u5217\u957f\u5ea6\u3002
\nawait\u8868\u793a\u5e73\u5747\u6bcf\u6b21\u8bbe\u5907I\/O\u64cd\u4f5c\u7684\u7b49\u5f85\u65f6\u95f4(\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d)\u3002
\nsvctm\u8868\u793a\u5e73\u5747\u6bcf\u6b21\u8bbe\u5907I\/O\u64cd\u4f5c\u7684\u670d\u52a1\u65f6\u95f4(\u4ee5\u6beb\u79d2\u4e3a\u5355\u4f4d)\u3002
\n%util\u8868\u793a\u4e00\u79d2\u4e2d\u6709\u767e\u5206\u4e4b\u51e0\u7684\u65f6\u95f4\u7528\u4e8eI\/O\u64cd\u4f5c\u3002
\nLinux\u4e2dI\/O\u8bf7\u6c42\u7cfb\u7edf\u4e0e\u73b0\u5b9e\u751f\u6d3b\u4e2d\u8d85\u5e02\u8d2d\u7269\u6392\u961f\u7cfb\u7edf\u6709\u5f88\u591a\u7c7b\u4f3c\u7684\u5730\u65b9\uff0c\u901a\u8fc7\u5bf9\u8d85\u5e02\u8d2d\u7269\u6392\u961f\u7cfb\u7edf\u7684\u7406\u89e3\uff0c\u53ef\u4ee5\u5f88\u5feb\u638c\u63e1linux\u4e2dI\/O\u8fd0\u884c\u673a\u5236\u3002\u6bd4\u5982\uff1a<\/p>\n

avgrq-sz\u7c7b\u4f3c\u4e0e\u8d85\u5e02\u6392\u961f\u4e2d\u6bcf\u4eba\u6240\u4e70\u4e1c\u897f\u7684\u591a\u5c11\u3002<\/p>\n

avgqu-sz\u7c7b\u4f3c\u4e0e\u8d85\u5e02\u6392\u961f\u4e2d\u5355\u4f4d\u65f6\u95f4\u5185\u5e73\u5747\u6392\u961f\u7684\u4eba\u6570\u3002<\/p>\n

await\u7c7b\u4f3c\u4e0e\u8d85\u5e02\u6392\u961f\u4e2d\u6bcf\u4eba\u7684\u7b49\u5f85\u65f6\u95f4\u3002<\/p>\n

svctm\u7c7b\u4f3c\u4e0e\u8d85\u5e02\u6392\u961f\u4e2d\u6536\u94f6\u5458\u7684\u6536\u6b3e\u901f\u5ea6\u3002<\/p>\n

%util\u7c7b\u4f3c\u4e0e\u8d85\u5e02\u6536\u94f6\u53f0\u524d\u6709\u4eba\u6392\u961f\u7684\u65f6\u95f4\u6bd4\u4f8b\u3002<\/p>\n

\u5bf9\u4ee5\u78c1\u76d8IO\u6027\u80fd\uff0c\u4e00\u822c\u6709\u5982\u4e0b\u8bc4\u5224\u6807\u51c6\uff1a<\/p>\n

\u6b63\u5e38\u60c5\u51b5\u4e0bsvctm\u5e94\u8be5\u662f\u5c0f\u4e8eawait\u503c\u7684\uff0c\u800csvctm\u7684\u5927\u5c0f\u548c\u78c1\u76d8\u6027\u80fd\u6709\u5173\uff0cCPU\u3001\u5185\u5b58\u7684\u8d1f\u8377\u4e5f\u4f1a\u5bf9svctm\u503c\u9020\u6210\u5f71\u54cd\uff0c\u8fc7\u591a\u7684\u8bf7\u6c42\u4e5f\u4f1a\u95f4\u63a5\u7684\u5bfc\u81f4svctm\u503c\u7684\u589e\u52a0\u3002<\/p>\n

await\u503c\u7684\u5927\u5c0f\u4e00\u822c\u53d6\u51b3\u4e0esvctm\u7684\u503c\u548cI\/O\u961f\u5217\u957f\u5ea6\u4ee5\u53caI\/O\u8bf7\u6c42\u6a21\u5f0f\uff0c\u5982\u679csvctm\u7684\u503c\u4e0eawait\u5f88\u63a5\u8fd1\uff0c\u8868\u793a\u51e0\u4e4e\u6ca1\u6709I\/O\u7b49\u5f85\uff0c\u78c1\u76d8\u6027\u80fd\u5f88\u597d\uff0c\u5982\u679cawait\u7684\u503c\u8fdc\u9ad8\u4e8esvctm\u7684\u503c\uff0c\u5219\u8868\u793aI\/O\u961f\u5217\u7b49\u5f85\u592a\u957f\uff0c\u7cfb\u7edf\u4e0a\u8fd0\u884c\u7684\u5e94\u7528\u7a0b\u5e8f\u5c06\u53d8\u6162\uff0c\u6b64\u65f6\u53ef\u4ee5\u901a\u8fc7\u66f4\u6362\u66f4\u5feb\u7684\u786c\u76d8\u6765\u89e3\u51b3\u95ee\u9898\u3002<\/p>\n

%util\u9879\u7684\u503c\u4e5f\u662f\u8861\u91cf\u78c1\u76d8I\/O\u7684\u4e00\u4e2a\u91cd\u8981\u6307\u6807\uff0c\u5982\u679c%util\u63a5\u8fd1100%\uff0c\u8868\u793a\u78c1\u76d8\u4ea7\u751f\u7684I\/O\u8bf7\u6c42\u592a\u591a\uff0cI\/O\u7cfb\u7edf\u5df2\u7ecf\u6ee1\u8d1f\u8377\u7684\u5728\u5de5\u4f5c\uff0c\u8be5\u78c1\u76d8\u53ef\u80fd\u5b58\u5728\u74f6\u9888\u3002\u957f\u671f\u4e0b\u53bb\uff0c\u52bf\u5fc5\u5f71\u54cd\u7cfb\u7edf\u7684\u6027\u80fd\uff0c\u53ef\u4ee5\u901a\u8fc7\u4f18\u5316\u7a0b\u5e8f\u6216\u8005\u901a\u8fc7\u66f4\u6362\u66f4\u9ad8\u3001\u66f4\u5feb\u7684\u78c1\u76d8\u6765\u89e3\u51b3\u6b64\u95ee\u9898\u3002<\/p>\n

3.2 iostat \u2013d\u547d\u4ee4\u7ec4\u5408<\/strong><\/span><\/div>\n

\u901a\u8fc7\u201ciostat \u2013d\u201d\u547d\u4ee4\u7ec4\u5408\u4e5f\u53ef\u4ee5\u67e5\u770b\u7cfb\u7edf\u78c1\u76d8\u7684\u4f7f\u7528\u72b6\u51b5\uff0c\u8bf7\u770b\u5982\u4e0b\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# iostat -d 2 3 \r\ninux 2.6.9-42.ELsmp (webserver) 12\/01\/2008 _i686_ (8 CPU) \r\nDevice: tps Blk_read\/s Blk_wrtn\/s Blk_read Blk_wrtn \r\nda 1.87 2.58 114.12 6479462 286537372 \r\nDevice: tps Blk_read\/s Blk_wrtn\/s Blk_read Blk_wrtn \r\nda 0.00 0.00 0.00 0 0 \r\nDevice: tps Blk_read\/s Blk_wrtn\/s Blk_read Blk_wrtn \r\nda 1.00 0.00 12.00 0 24 \r\n<\/pre>\n

\u5bf9\u4e0a\u9762\u6bcf\u9879\u7684\u8f93\u51fa\u89e3\u91ca\u5982\u4e0b\uff1a
\nBlk_read\/s\u8868\u793a\u6bcf\u79d2\u8bfb\u53d6\u7684\u6570\u636e\u5757\u6570\u3002
\nBlk_wrtn\/s\u8868\u793a\u6bcf\u79d2\u5199\u5165\u7684\u6570\u636e\u5757\u6570\u3002
\nBlk_read\u8868\u793a\u8bfb\u53d6\u7684\u6240\u6709\u5757\u6570
\nBlk_wrtn\u8868\u793a\u5199\u5165\u7684\u6240\u6709\u5757\u6570\u3002
\n\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u7684\u4e00\u70b9\u662f\uff1a\u4e0a\u9762\u8f93\u51fa\u7684\u7b2c\u4e00\u9879\u662f\u7cfb\u7edf\u4ece\u542f\u52a8\u4ee5\u6765\u5230\u7edf\u8ba1\u65f6\u7684\u6240\u6709\u4f20\u8f93\u4fe1\u606f\uff0c\u4ece\u7b2c\u4e8c\u6b21\u8f93\u51fa\u7684\u6570\u636e\u624d\u4ee3\u8868\u5728\u68c0\u6d4b\u7684\u65f6\u95f4\u6bb5\u5185\u7cfb\u7edf\u7684\u4f20\u8f93\u503c\u3002<\/p>\n

\u53ef\u4ee5\u901a\u8fc7Blk_read\/s\u548cBlk_wrtn\/s\u7684\u503c\u5bf9\u78c1\u76d8\u7684\u8bfb\u5199\u6027\u80fd\u6709\u4e00\u4e2a\u57fa\u672c\u7684\u4e86\u89e3\uff0c\u5982\u679cBlk_wrtn\/s\u503c\u5f88\u5927\uff0c\u8868\u793a\u78c1\u76d8\u7684\u5199\u64cd\u4f5c\u5f88\u9891\u7e41\uff0c\u53ef\u4ee5\u8003\u8651\u4f18\u5316\u78c1\u76d8\u6216\u8005\u4f18\u5316\u7a0b\u5e8f\uff0c\u5982\u679cBlk_read\/s\u503c\u5f88\u5927\uff0c\u8868\u793a\u78c1\u76d8\u76f4\u63a5\u8bfb\u53d6\u64cd\u4f5c\u5f88\u591a\uff0c\u53ef\u4ee5\u5c06\u8bfb\u53d6\u7684\u6570\u636e\u653e\u5165\u5185\u5b58\u4e2d\u8fdb\u884c\u64cd\u4f5c\u3002\u5bf9\u4e8e\u8fd9\u4e24\u4e2a\u9009\u9879\u7684\u503c\u6ca1\u6709\u4e00\u4e2a\u56fa\u5b9a\u7684\u5927\u5c0f\uff0c\u6839\u636e\u7cfb\u7edf\u5e94\u7528\u7684\u4e0d\u540c\uff0c\u4f1a\u6709\u4e0d\u540c\u7684\u503c\uff0c\u4f46\u662f\u6709\u4e00\u4e2a\u89c4\u5219\u8fd8\u662f\u53ef\u4ee5\u9075\u5faa\u7684\uff1a\u957f\u671f\u7684\u3001\u8d85\u5927\u7684\u6570\u636e\u8bfb\u5199\uff0c\u80af\u5b9a\u662f\u4e0d\u6b63\u5e38\u7684\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e00\u5b9a\u4f1a\u5f71\u54cd\u7cfb\u7edf\u6027\u80fd\u3002<\/p>\n

\u201ciostat \u2013x\u201d\u7ec4\u5408\u8fd8\u63d0\u4f9b\u4e86\u5bf9\u6bcf\u4e2a\u78c1\u76d8\u7684\u5355\u72ec\u7edf\u8ba1\uff0c\u5982\u679c\u4e0d\u6307\u5b9a\u78c1\u76d8\uff0c\u9ed8\u8ba4\u662f\u5bf9\u6240\u6709\u78c1\u76d8\u8fdb\u884c\u7edf\u8ba1\uff0c\u8bf7\u770b\u4e0b\u9762\u7684\u4e00\u4e2a\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# iostat -x \/dev\/sda 2 3 \r\nLinux 2.6.9-42.ELsmp (webserver) 12\/01\/2008 _i686_ (8 CPU) \r\navg-cpu: %user %nice %system %iowait %steal %idle \r\n2.45 0.00 0.30 0.24 0.00 97.03 \r\nDevice: rrqm\/s wrqm\/s r\/s w\/s rsec\/s wsec\/s avgrq-sz avgqu-sz await svctm %util \r\nsda 0.01 12.48 0.10 1.78 2.58 114.03 62.33 0.07 38.39 1.30 0.24 \r\navg-cpu: %user %nice %system %iowait %steal %idle \r\n3.97 0.00 1.83 8.19 0.00 86.14 \r\nDevice:rrqm\/s wrqm\/s r\/s w\/s rsec\/s wsec\/s avgrq-sz avgqu-sz await svctm %util \r\nsda 0.00 195.00 0.00 18.00 0.00 1704.00 94.67 0.04 2.50 0.11 0.20 \r\navg-cpu: %user %nice %system %iowait %steal %idle \r\n4.04 0.00 1.83 8.01 0.00 86.18 \r\nDevice: rrqm\/s wrqm\/s r\/s w\/s rsec\/s wsec\/s avgrq-sz avgqu-sz await svctm %util \r\nsda 0.00 4.50 0.00 7.00 0.00 92.00 13.14 0.01 0.79 0.14 0.10 \r\n<\/pre>\n

\u8fd9\u4e2a\u8f93\u51fa\u57fa\u672c\u4e0e\u201csar \u2013d\u201d\u76f8\u540c\uff0c\u9700\u8981\u8bf4\u660e\u7684\u51e0\u4e2a\u9009\u9879\u7684\u542b\u4e49\u4e3a\uff1a<\/p>\n

rrqm\/s\u8868\u793a\u6bcf\u79d2\u8fdb\u884cmerged\u7684\u8bfb\u64cd\u4f5c\u6570\u76ee\u3002
\nwrqm\/s\u8868\u793a\u6bcf\u79d2\u8fdb\u884c merge \u7684\u5199\u64cd\u4f5c\u6570\u76ee\u3002
\nr\/s\u8868\u793a\u6bcf\u79d2\u5b8c\u6210\u8bfbI\/O\u8bbe\u5907\u7684\u6b21\u6570\u3002
\nw\/s\u8868\u793a\u6bcf\u79d2\u5b8c\u6210\u5199I\/O\u8bbe\u5907\u7684\u6b21\u6570\u3002
\nrsec\/s\u8868\u793a\u6bcf\u79d2\u8bfb\u53d6\u7684\u6247\u533a\u6570\u3002
\nwsec\/s\u8868\u793a\u6bcf\u79d2\u5199\u5165\u7684\u6247\u533a\u6570\u3002<\/p>\n

3.3 vmstat \u2013d\u7ec4\u5408<\/strong><\/span><\/div>\n

\u901a\u8fc7\u201cvmstat \u2013d\u201d\u7ec4\u5408\u4e5f\u53ef\u4ee5\u67e5\u770b\u78c1\u76d8\u7684\u7edf\u8ba1\u6570\u636e\uff0c\u60c5\u51b5\u4e0b\u9762\u7684\u4e00\u4e2a\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# vmstat -d 3 2|grep sda \r\ndisk- \u2014\u2014\u2014\u2014reads\u2014\u2014\u2014\u2014 \u2014\u2014\u2014\u2014writes\u2014\u2014\u2014\u2013 \u2014\u2013IO\u2014\u2014 \r\ntotal merged sectors ms total merged sectors ms cur sec \r\nsda 239588 29282 6481862 1044442 4538678 32387680 295410812 186025580 0 6179 \r\ndisk- \u2014\u2014\u2014\u2014reads\u2014\u2014\u2014\u2014 \u2014\u2014\u2014\u2014writes\u2014\u2014\u2014\u2013 \u2014\u2013IO\u2014\u2014 \r\ntotal merged sectors ms total merged sectors ms cur sec \r\nsda 239588 29282 6481862 1044442 4538680 32387690 295410908 186025581 0 6179 \r\n<\/pre>\n

\u8fd9\u4e2a\u8f93\u51fa\u663e\u793a\u4e86\u78c1\u76d8\u7684reads\u3001writes\u548cIO\u7684\u4f7f\u7528\u72b6\u51b5\u3002<\/p>\n

3.4 \u672c\u8282\u5c0f\u7ed3<\/strong><\/span><\/div>\n

\u4e0a\u9762\u4e3b\u8981\u8bb2\u89e3\u4e86\u5bf9\u78c1\u76d8I\/O\u7684\u6027\u80fd\u8bc4\u4f30\uff0c\u5176\u5b9e\u8861\u91cf\u78c1\u76d8I\/O\u597d\u574f\u662f\u591a\u65b9\u9762\u7684\uff0c\u6709\u5e94\u7528\u7a0b\u5e8f\u672c\u8eab\u7684\uff0c\u4e5f\u6709\u786c\u4ef6\u8bbe\u8ba1\u4e0a\u7684\uff0c\u8fd8\u6709\u7cfb\u7edf\u81ea\u8eab\u914d\u7f6e\u7684\u95ee\u9898\u7b49\uff0c\u8981\u89e3\u51b3I\/O\u7684\u74f6\u9888\uff0c\u5173\u952e\u662f\u8981\u63d0\u9ad8I\/O\u5b50\u7cfb\u7edf\u7684\u6267\u884c\u6548\u7387\u3002\u4f8b\u5982\uff0c\u9996\u8981\u8981\u4ece\u5e94\u7528\u7a0b\u5e8f\u4e0a\u5bf9\u78c1\u76d8\u8bfb\u5199\u8fdb\u884c\u4f18\u5316\uff0c\u80fd\u591f\u653e\u5230\u5185\u5b58\u6267\u884c\u7684\u64cd\u4f5c\uff0c\u5c3d\u91cf\u4e0d\u8981\u653e\u5230\u78c1\u76d8\uff0c\u540c\u65f6\u5bf9\u78c1\u76d8\u5b58\u50a8\u65b9\u5f0f\u8fdb\u884c\u5408\u7406\u89c4\u5212\uff0c\u9009\u62e9\u9002\u5408\u81ea\u5df1\u7684RAID\u5b58\u53d6\u65b9\u5f0f\uff0c\u6700\u540e\uff0c\u5728\u7cfb\u7edf\u7ea7\u522b\u4e0a\uff0c\u53ef\u4ee5\u9009\u62e9\u9002\u5408\u81ea\u8eab\u5e94\u7528\u7684\u6587\u4ef6\u7cfb\u7edf\uff0c\u5fc5\u8981\u65f6\u4f7f\u7528\u88f8\u8bbe\u5907\u63d0\u9ad8\u8bfb\u5199\u6027\u80fd\u3002<\/p>\n

4 \u7f51\u7edc\u6027\u80fd\u8bc4\u4f30<\/strong><\/div>\n

\u7f51\u7edc\u6027\u80fd\u7684\u597d\u574f\u76f4\u63a5\u5f71\u54cd\u5e94\u7528\u7a0b\u5e8f\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u7684\u7a33\u5b9a\u6027\u548c\u53ef\u9760\u6027\uff0c\u76d1\u63a7\u7f51\u7edc\u6027\u80fd\uff0c\u53ef\u4ee5\u4ece\u4ee5\u4e0b\u51e0\u4e2a\u65b9\u9762\u8fdb\u884c\u7ba1\u7406\u548c\u4f18\u5316\u3002<\/p>\n

4.1 \u901a\u8fc7ping\u547d\u4ee4\u68c0\u6d4b\u7f51\u7edc\u7684\u8fde\u901a\u6027<\/strong><\/span><\/div>\n

\u5982\u679c\u53d1\u73b0\u7f51\u7edc\u53cd\u5e94 \u7f13\u6162\uff0c\u6216\u8005\u8fde\u63a5\u4e2d\u65ad\uff0c\u53ef\u4ee5\u901a\u8fc7ping\u6765\u6d4b\u8bd5\u7f51\u7edc\u7684\u8fde\u901a\u60c5\u51b5\uff0c\u8bf7\u770b\u4e0b\u9762\u7684\u4e00\u4e2a\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# ping 10.10.1.254 \r\nPING 10.10.1.254 (10.10.1.254) 56(84) bytes of data. \r\n64 bytes from 10.10.1.254: icmp_seq=0 ttl=64 time=0.235 ms \r\n64 bytes from 10.10.1.254: icmp_seq=1 ttl=64 time=0.164 ms \r\n64 bytes from 10.10.1.254: icmp_seq=2 ttl=64 time=0.210 ms \r\n64 bytes from 10.10.1.254: icmp_seq=3 ttl=64 time=0.178 ms \r\n64 bytes from 10.10.1.254: icmp_seq=4 ttl=64 time=0.525 ms \r\n64 bytes from 10.10.1.254: icmp_seq=5 ttl=64 time=0.571 ms \r\n64 bytes from 10.10.1.254: icmp_seq=6 ttl=64 time=0.220 ms \r\n\u2014 10.10.1.254 ping statistics \u2014 \r\n7 packets transmitted, 7 received, 0% packet loss, time 6000ms \r\nrtt min\/avg\/max\/mdev = 0.164\/0.300\/0.571\/0.159 ms, pipe 2 \r\n<\/pre>\n

\u5728\u8fd9\u4e2a\u8f93\u51fa\u4e2d\uff0ctime\u503c\u663e\u793a\u4e86\u4e24\u53f0\u4e3b\u673a\u4e4b\u95f4\u7684\u7f51\u7edc\u5ef6\u65f6\u60c5\u51b5\uff0c\u5982\u679c\u6b64\u503c\u5f88\u5927\uff0c\u5219\u8868\u793a\u7f51\u7edc\u7684\u5ef6\u65f6\u5f88\u5927\uff0c\u5355\u4f4d\u4e3a\u6beb\u79d2\u3002\u5728\u8fd9\u4e2a\u8f93\u51fa\u7684\u6700\u540e\uff0c\u662f\u5bf9\u4e0a\u9762\u8f93\u51fa\u4fe1\u606f\u7684\u4e00\u4e2a\u603b\u7ed3\uff0cpacket loss\u8868\u793a\u7f51\u7edc\u7684\u4e22\u5305\u7387\uff0c\u6b64\u503c\u8d8a\u5c0f\uff0c\u8868\u793a\u7f51\u7edc\u7684\u8d28\u91cf\u8d8a\u9ad8\u3002<\/p>\n

4.2 \u901a\u8fc7netstat \u2013i\u7ec4\u5408\u68c0\u6d4b\u7f51\u7edc\u63a5\u53e3\u72b6\u51b5<\/strong><\/span><\/div>\n

netstat\u547d\u4ee4\u63d0\u4f9b\u4e86\u7f51\u7edc\u63a5\u53e3\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u770b\u4e0b\u9762\u7684\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# netstat -i \r\nKernel Interface table \r\nIface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg \r\neth0 1500 0 1313129253 0 0 0 1320686497 0 0 0 BMRU \r\neth1 1500 0 494902025 0 0 0 292358810 0 0 0 BMRU \r\nlo 16436 0 41901601 0 0 0 41901601 0 0 0 LRU \r\n<\/pre>\n

\u5bf9\u4e0a\u9762\u6bcf\u9879\u7684\u8f93\u51fa\u89e3\u91ca\u5982\u4e0b\uff1a<\/p>\n

\uf06c Iface\u8868\u793a\u7f51\u7edc\u8bbe\u5907\u7684\u63a5\u53e3\u540d\u79f0\u3002 \r\n\uf06c MTU\u8868\u793a\u6700\u5927\u4f20\u8f93\u5355\u5143\uff0c\u5355\u4f4d\u5b57\u8282\u3002 \r\n\uf06c RX-OK\/TX-OK\u8868\u793a\u5df2\u7ecf\u51c6\u786e\u65e0\u8bef\u7684\u63a5\u6536\/\u53d1\u9001\u4e86\u591a\u5c11\u6570\u636e\u5305\u3002 \r\n\uf06c RX-ERR\/TX-ERR\u8868\u793a\u63a5\u6536\/\u53d1\u9001\u6570\u636e\u5305\u65f6\u4ea7\u751f\u4e86\u591a\u5c11\u9519\u8bef\u3002 \r\n\uf06c RX-DRP\/TX-DRP\u8868\u793a\u63a5\u6536\/\u53d1\u9001\u6570\u636e\u5305\u65f6\u4e22\u5f03\u4e86\u591a\u5c11\u6570\u636e\u5305\u3002 \r\n\uf06c RX-OVR\/TX-OVR\u8868\u793a\u7531\u4e8e\u8bef\u5dee\u800c\u9057\u5931\u4e86\u591a\u5c11\u6570\u636e\u5305\u3002 \r\n\uf06c Flg\u8868\u793a\u63a5\u53e3\u6807\u8bb0\uff0c\u5176\u4e2d\uff1a \r\n\uf0d8 L\uff1a\u8868\u793a\u8be5\u63a5\u53e3\u662f\u4e2a\u56de\u73af\u8bbe\u5907\u3002 \r\n\uf0d8 B\uff1a\u8868\u793a\u8bbe\u7f6e\u4e86\u5e7f\u64ad\u5730\u5740\u3002 \r\n\uf0d8 M\uff1a\u8868\u793a\u63a5\u6536\u6240\u6709\u6570\u636e\u5305\u3002 \r\n\uf0d8 R\uff1a\u8868\u793a\u63a5\u53e3\u6b63\u5728\u8fd0\u884c\u3002 \r\n\uf0d8 U\uff1a\u8868\u793a\u63a5\u53e3\u5904\u4e8e\u6d3b\u52a8\u72b6\u6001\u3002 \r\n\uf0d8 O\uff1a\u8868\u793a\u5728\u8be5\u63a5\u53e3\u4e0a\u7981\u7528arp\u3002 \r\n\uf0d8 P\uff1a\u8868\u793a\u4e00\u4e2a\u70b9\u5230\u70b9\u7684\u8fde\u63a5\u3002\r\n<\/pre>\n

\u6b63\u5e38\u60c5\u51b5\u4e0b\uff0cRX-ERR\/TX-ERR\u3001RX-DRP\/TX-DRP\u548cRX-OVR\/TX-OVR\u7684\u503c\u90fd\u5e94\u8be5\u4e3a0\uff0c\u5982\u679c\u8fd9\u51e0\u4e2a\u9009\u9879\u7684\u503c\u4e0d\u4e3a0\uff0c\u5e76\u4e14\u5f88\u5927\uff0c\u90a3\u4e48\u7f51\u7edc\u8d28\u91cf\u80af\u5b9a\u6709\u95ee\u9898\uff0c\u7f51\u7edc\u4f20\u8f93\u6027\u80fd\u4e5f\u4e00\u5b9a\u4f1a\u4e0b\u964d\u3002<\/p>\n

\u5f53\u7f51\u7edc\u4f20\u8f93\u5b58\u5728\u95ee\u9898\u662f\uff0c\u53ef\u4ee5\u68c0\u6d4b\u7f51\u5361\u8bbe\u5907\u662f\u5426\u5b58\u5728\u6545\u969c\uff0c\u5982\u679c\u53ef\u80fd\uff0c\u53ef\u4ee5\u5347\u7ea7\u4e3a\u5343\u5146\u7f51\u5361\u6216\u8005\u5149\u7ea4\u7f51\u7edc\uff0c\u8fd8\u53ef\u4ee5\u68c0\u67e5\u7f51\u7edc\u90e8\u7f72\u73af\u5883\u662f\u5426\u5408\u7406\u3002<\/p>\n

4.3 \u901a\u8fc7netstat \u2013r\u7ec4\u5408\u68c0\u6d4b\u7cfb\u7edf\u7684\u8def\u7531\u8868\u4fe1\u606f<\/strong><\/span><\/div>\n

\u5728\u7f51\u7edc\u4e0d\u901a\uff0c\u6216\u8005\u7f51\u7edc\u5f02\u5e38\u65f6\uff0c\u9996\u5148\u60f3\u5230\u7684\u5c31\u662f\u68c0\u67e5\u7cfb\u7edf\u7684\u8def\u7531\u8868\u4fe1\u606f\uff0c\u201cnetstat \u2013r\u201d\u7684\u8f93\u51fa\u7ed3\u679c\u4e0eroute\u547d\u4ee4\u7684\u8f93\u51fa\u5b8c\u5168\u76f8\u540c\uff0c\u8bf7\u770b\u4e0b\u9762\u7684\u4e00\u4e2a\u5b9e\u4f8b\uff1a<\/p>\n

[root@webserver ~]# netstat -r \r\nKernel IP routing table \r\nDestination Gateway Genmask Flags MSS Window irtt Iface \r\n10.10.1.0 * 255.255.255.0 U 0 0 0 eth0 \r\n192.168.200.0 * 255.255.255.0 U 0 0 0 eth1 \r\n169.254.0.0 * 255.255.0.0 U 0 0 0 eth1 \r\ndefault 10.10.1.254 0.0.0.0 UG 0 0 0 eth0 \r\n<\/pre>\n

\u5173\u4e8e\u8f93\u51fa\u4e2d\u6bcf\u9879\u7684\u5177\u4f53\u542b\u4e49\uff0c\u5df2\u7ecf\u5728\u524d\u9762\u7ae0\u8282\u8fdb\u884c\u8fc7\u8be6\u7ec6\u4ecb\u7ecd\uff0c\u8fd9\u91cc\u4e0d\u518d\u591a\u8bb2\uff0c\u8fd9\u91cc\u6211\u4eec\u91cd\u70b9\u5173\u6ce8\u7684\u662fdefault\u884c\u5bf9\u5e94\u7684\u503c\uff0cdefault\u9879\u8868\u793a\u7cfb\u7edf\u7684\u9ed8\u8ba4\u8def\u7531\uff0c\u5bf9\u5e94\u7684\u7f51\u7edc\u63a5\u53e3\u4e3aeth0\u3002<\/p>\n

4.4 \u901a\u8fc7sar \u2013n\u7ec4\u5408\u663e\u793a\u7cfb\u7edf\u7684\u7f51\u7edc\u8fd0\u884c\u72b6\u6001<\/strong><\/span><\/div>\n

sar\u63d0\u4f9b\u56db\u79cd\u4e0d\u540c\u7684\u9009\u9879\u6765\u663e\u793a\u7f51\u7edc\u7edf\u8ba1\u4fe1\u606f\uff0c\u901a\u8fc7\u201c-n\u201d\u9009\u9879\u53ef\u4ee5\u6307\u5b9a4\u4e2a\u4e0d\u540c\u7c7b\u578b\u7684\u5f00\u5173\uff1aDEV\u3001EDEV\u3001SOCK\u548cFULL\u3002DEV\u663e\u793a\u7f51\u7edc\u63a5\u53e3\u4fe1\u606f\uff0cEDEV\u663e\u793a\u5173\u4e8e\u7f51\u7edc\u9519\u8bef\u7684\u7edf\u8ba1\u6570\u636e\uff0cSOCK\u663e\u793a\u5957\u63a5\u5b57\u4fe1\u606f\uff0cFULL\u663e\u793a\u6240\u6709\u4e09\u4e2a\u5f00\u5173\u3002\u8bf7\u770b\u4e0b\u9762\u7684\u4e00\u4e2a\u8f93\u51fa\uff1a<\/p>\n

[root@webserver ~]# sar -n DEV 2 3 \r\nLinux 2.6.9-42.ELsmp (webserver) 12\/01\/2008 _i686_ (8 CPU) \r\n02:22:31 PM IFACE rxpck\/s txpck\/s rxkB\/s txkB\/s rxcmp\/s txcmp\/s rxmcst\/s \r\n02:22:33 PM lo 31.34 31.34 37.53 37.53 0.00 0.00 0.00 \r\n02:22:33 PM eth0 199.50 279.60 17.29 344.12 0.00 0.00 0.00 \r\n02:22:33 PM eth1 5.47 4.98 7.03 0.36 0.00 0.00 0.00 \r\n02:22:33 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 \r\n02:22:33 PM IFACE rxpck\/s txpck\/s rxkB\/s txkB\/s rxcmp\/s txcmp\/s rxmcst\/s \r\n02:22:35 PM lo 67.66 67.66 74.34 74.34 0.00 0.00 0.00 \r\n02:22:35 PM eth0 159.70 222.39 19.74 217.16 0.00 0.00 0.00 \r\n02:22:35 PM eth1 3.48 4.48 0.44 0.51 0.00 0.00 0.00 \r\n02:22:35 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 \r\n02:22:35 PM IFACE rxpck\/s txpck\/s rxkB\/s txkB\/s rxcmp\/s txcmp\/s rxmcst\/s \r\n02:22:37 PM lo 4.52 4.52 9.25 9.25 0.00 0.00 0.00 \r\n02:22:37 PM eth0 102.51 133.67 20.67 116.14 0.00 0.00 0.00 \r\n02:22:37 PM eth1 27.14 67.34 2.42 89.26 0.00 0.00 0.00 \r\n02:22:37 PM sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 \r\nAverage: IFACE rxpck\/s txpck\/s rxkB\/s txkB\/s rxcmp\/s txcmp\/s rxmcst\/s \r\nAverage: lo 34.61 34.61 40.48 40.48 0.00 0.00 0.00 \r\nAverage: eth0 154.08 212.15 19.23 226.17 0.00 0.00 0.00 \r\nAverage: eth1 11.98 25.46 3.30 29.85 0.00 0.00 0.00 \r\nAverage: sit0 0.00 0.00 0.00 0.00 0.00 0.00 0.00 \r\n<\/pre>\n

\u5bf9\u4e0a\u9762\u6bcf\u9879\u7684\u8f93\u51fa\u89e3\u91ca\u5982\u4e0b\uff1a<\/p>\n

IFACE\u8868\u793a\u7f51\u7edc\u63a5\u53e3\u8bbe\u5907\u3002
\nrxpck\/s\u8868\u793a\u6bcf\u79d2\u949f\u63a5\u6536\u7684\u6570\u636e\u5305\u5927\u5c0f\u3002
\ntxpck\/s\u8868\u793a\u6bcf\u79d2\u949f\u53d1\u9001\u7684\u6570\u636e\u5305\u5927\u5c0f\u3002
\nrxkB\/s\u8868\u793a\u6bcf\u79d2\u949f\u63a5\u6536\u7684\u5b57\u8282\u6570\u3002
\ntxkB\/s\u8868\u793a\u6bcf\u79d2\u949f\u53d1\u9001\u7684\u5b57\u8282\u6570\u3002
\nrxcmp\/s\u8868\u793a\u6bcf\u79d2\u949f\u63a5\u6536\u7684\u538b\u7f29\u6570\u636e\u5305\u3002
\ntxcmp\/s\u8868\u793a\u6bcf\u79d2\u949f\u53d1\u9001\u7684\u538b\u7f29\u6570\u636e\u5305\u3002
\nrxmcst\/s\u8868\u793a\u6bcf\u79d2\u949f\u63a5\u6536\u7684\u591a\u64ad\u6570\u636e\u5305\u3002
\n\u901a\u8fc7\u201csar \u2013n\u201d\u7684\u8f93\u51fa\uff0c\u53ef\u4ee5\u6e05\u695a\u7684\u663e\u793a\u7f51\u7edc\u63a5\u53e3\u53d1\u9001\u3001\u63a5\u6536\u6570\u636e\u7684\u7edf\u8ba1\u4fe1\u606f\u3002\u6b64\u5916\u8fd8\u53ef\u4ee5\u901a\u8fc7\u201csar -n EDEV 2 3\u201d\u6765\u7edf\u8ba1\u7f51\u7edc\u9519\u8bef\u4fe1\u606f\u7b49\u3002<\/p>\n

4.5 \u5c0f\u7ed3<\/strong><\/span><\/div>\n

\u672c\u8282\u901a\u8fc7\u51e0\u4e2a\u5e38\u7528\u7684\u7f51\u7edc\u547d\u4ee4\u4ecb\u7ecd\u4e86\u5bf9\u7f51\u7edc\u6027\u80fd\u7684\u8bc4\u4f30\uff0c\u4e8b\u5b9e\u4e0a\uff0c\u7f51\u7edc\u95ee\u9898\u662f\u7b80\u5355\u800c\u4e14\u5bb9\u6613\u5904\u7406\u7684\uff0c\u53ea\u8981\u6211\u4eec\u6839\u636e\u4e0a\u9762\u7ed9\u51fa\u7684\u547d\u4ee4\uff0c\u4e00\u822c\u90fd\u80fd\u8fc5\u901f\u5b9a\u4f4d\u95ee\u9898\u3002\u89e3\u51b3\u95ee\u9898\u7684\u65b9\u6cd5\u4e00\u822c\u662f\u589e\u52a0\u7f51\u7edc\u5e26\u5bbd\uff0c\u6216\u8005\u4f18\u5316\u7f51\u7edc\u90e8\u7f72\u73af\u5883\u3002<\/p>\n

\u9664\u4e86\u4e0a\u9762\u4ecb\u7ecd\u7684\u51e0\u4e2a\u547d\u4ee4\u5916\uff0c\u6392\u67e5\u7f51\u7edc\u95ee\u9898\u7ecf\u5e38\u7528\u5230\u7684\u547d\u4ee4\u8fd8\u6709traceroute\uff0c\u4e3b\u8981\u7528\u4e8e\u8ddf\u8e2a\u6570\u636e\u5305\u7684\u4f20\u8f93\u8def\u5f84\uff0c\u8fd8\u6709nslookup\u547d\u4ee4\uff0c\u4e3b\u8981\u7528\u4e8e\u5224\u65adDNS\u89e3\u6790\u4fe1\u606f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u4f5c\u4e3a\u4e00\u540dlinux\u7cfb\u7edf\u8fd0\u7ef4\u4eba\u5458\uff0c\u6700\u4e3b\u8981\u7684\u5de5\u4f5c\u662f\u4f18\u5316\u7cfb\u7edf\u914d\u7f6e\uff0c\u4f7f\u5e94\u7528\u5728\u7cfb\u7edf\u4e0a\u4ee5\u6700\u4f18\u7684\u72b6\u6001\u8fd0\u884c\uff0c\u4f46\u662f\u7531\u4e8e\u786c\u4ef6\u95ee\u9898\u3001 […]<\/p>\n","protected":false},"author":1898,"featured_media":160755,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[326],"class_list":["post-160753","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread","tag-326"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/160753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1898"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=160753"}],"version-history":[{"count":3,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/160753\/revisions"}],"predecessor-version":[{"id":160780,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/160753\/revisions\/160780"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/160755"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=160753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=160753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=160753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}