﻿{"id":1496,"date":"2017-01-13T11:30:09","date_gmt":"2017-01-13T03:30:09","guid":{"rendered":"http:\/\/nick.txtcc.com\/?p=1496"},"modified":"2017-01-13T11:30:09","modified_gmt":"2017-01-13T03:30:09","slug":"tsar-%e7%9a%84%e4%bd%bf%e7%94%a8%e8%af%b4%e6%98%8e","status":"publish","type":"post","link":"http:\/\/nick.txtcc.com\/index.php\/linux\/1496","title":{"rendered":"tsar \u7684\u4f7f\u7528\u8bf4\u660e"},"content":{"rendered":"<h2>\u7cfb\u7edf\u6a21\u5757<\/h2>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#cpu\" name=\"user-content-cpu\"><\/a>cpu<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>user: \u8868\u793aCPU\u6267\u884c\u7528\u6237\u8fdb\u7a0b\u7684\u65f6\u95f4,\u901a\u5e38\u671f\u671b\u7528\u6237\u7a7a\u95f4CPU\u8d8a\u9ad8\u8d8a\u597d.<\/li>\n    <li>sys: \u8868\u793aCPU\u5728\u5185\u6838\u8fd0\u884c\u65f6\u95f4,\u7cfb\u7edfCPU\u5360\u7528\u7387\u9ad8,\u8868\u660e\u7cfb\u7edf\u67d0\u90e8\u5206\u5b58\u5728\u74f6\u9888.\u901a\u5e38\u503c\u8d8a\u4f4e\u8d8a\u597d.<\/li>\n    <li>wait: CPU\u5728\u7b49\u5f85I\/O\u64cd\u4f5c\u5b8c\u6210\u6240\u82b1\u8d39\u7684\u65f6\u95f4.\u7cfb\u7edf\u90e8\u5e94\u8be5\u82b1\u8d39\u5927\u91cf\u65f6\u95f4\u6765\u7b49\u5f85I\/O\u64cd\u4f5c,\u5426\u5219\u5c31\u8bf4\u660eI\/O\u5b58\u5728\u74f6\u9888.<\/li>\n    <li>hirq: \u7cfb\u7edf\u5904\u7406\u786c\u4e2d\u65ad\u6240\u82b1\u8d39\u7684\u65f6\u95f4\u767e\u5206\u6bd4<\/li>\n    <li>sirq: \u7cfb\u7edf\u5904\u7406\u8f6f\u4e2d\u65ad\u6240\u82b1\u8d39\u7684\u65f6\u95f4\u767e\u5206\u6bd4<\/li>\n    <li>util: CPU\u603b\u4f7f\u7528\u7684\u65f6\u95f4\u767e\u5206\u6bd4<\/li>\n    <li>nice: \u7cfb\u7edf\u8c03\u6574\u8fdb\u7a0b\u4f18\u5148\u7ea7\u6240\u82b1\u8d39\u7684\u65f6\u95f4\u767e\u5206\u6bd4<\/li>\n    <li>steal: \u88ab\u5f3a\u5236\u7b49\u5f85\uff08involuntary wait\uff09\u865a\u62dfCPU\u7684\u65f6\u95f4,\u6b64\u65f6hypervisor\u5728\u4e3a\u53e6\u4e00\u4e2a\u865a\u62df\u5904\u7406\u5668\u670d\u52a1<\/li>\n    <li>ncpu: CPU\u7684\u603b\u4e2a\u6570<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E5%BC%8F\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E5%BC%8F\"><\/a>\u91c7\u96c6\u65b9\u5f0f<\/h4>\n<p>CPU\u7684\u5360\u7528\u7387\u8ba1\u7b97,\u90fd\u662f\u6839\u636e\/proc\/stat\u8ba1\u6570\u5668\u6587\u4ef6\u800c\u6765,stat\u6587\u4ef6\u7684\u5185\u5bb9\u57fa\u672c\u683c\u5f0f\u662f:<\/p>\n<pre><code>cpu  67793686 1353560 66172807 4167536491 2705057 0 195975 609768\ncpu0 10529517 944309 11652564 835725059 2150687 0 74605 196726\ncpu1 14380773 127146 13908869 832565666 150815 0 31780 108418\n<\/code>\n<\/pre>\n<p>cpu\u662f\u603b\u7684\u4fe1\u606f,cpu0,cpu1\u7b49\u662f\u5404\u4e2a\u5177\u4f53cpu\u7684\u4fe1\u606f,\u5171\u67098\u4e2a\u503c,\u5355\u4f4d\u662fticks,\u5206\u522b\u662f<\/p>\n<blockquote>User time, 67793686 Nice time, 1353560 System time, 66172807 Idle time, 4167536491 Waiting time, 2705057 Hard Irq time, 0 SoftIRQ time, 195975 Steal time, 609768<\/blockquote>\n<p><code>CPU\u603b\u65f6\u95f4=user+system+nice+idle+iowait+irq+softirq+Stl<\/code>\n\u5404\u4e2a\u72b6\u6001\u7684\u5360\u7528=\u72b6\u6001\u7684cpu\u65f6\u95f4\uff05CPU\u603b\u65f6\u95f4\uff0a100%\n\u6bd4\u8f83\u7279\u6b8a\u7684\u662fCPU\u603b\u4f7f\u7528\u7387\u7684\u8ba1\u7b97(util),\u76ee\u524d\u7684\u7b97\u6cd5\u662f:\n<code>util = 1 - idle - iowait - steal<\/code><\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#mem\" name=\"user-content-mem\"><\/a>mem<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-1\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-1\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>free: \u7a7a\u95f2\u7684\u7269\u7406\u5185\u5b58\u7684\u5927\u5c0f<\/li>\n    <li>used: \u5df2\u7ecf\u4f7f\u7528\u7684\u5185\u5b58\u5927\u5c0f<\/li>\n    <li>buff: buff\u4f7f\u7528\u7684\u5185\u5b58\u5927\u5c0f,buffer is something that has yet to be &#8220;written&#8221; to disk.<\/li>\n    <li>cach: \u64cd\u4f5c\u7cfb\u7edf\u4f1a\u628a\u7ecf\u5e38\u8bbf\u95ee\u7684\u4e1c\u897f\u653e\u5728cache\u4e2d\u52a0\u5feb\u6267\u884c\u901f\u5ea6,A cache is something that has been &#8220;read&#8221; from the disk and stored for later use<\/li>\n    <li>total: \u7cfb\u7edf\u603b\u7684\u5185\u5b58\u5927\u5c0f<\/li>\n    <li>util: \u5185\u5b58\u4f7f\u7528\u7387<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u5185\u5b58\u7684\u8ba1\u6570\u5668\u5728\/proc\/meminfo,\u91cc\u9762\u6709\u4e00\u4e9b\u5173\u952e\u9879<\/p>\n<pre><code>    MemTotal:      7680000 kB\n    MemFree:        815652 kB\n    Buffers:       1004824 kB\n    Cached:        4922556 kB\n<\/code>\n<\/pre>\n<p>\u542b\u4e49\u5c31\u4e0d\u89e3\u91ca\u4e86,\u4e3b\u8981\u4ecb\u7ecd\u4e00\u4e0b\u5185\u5b58\u4f7f\u7528\u7387\u7684\u8ba1\u7b97\u7b97\u6cd5:\n<code>util = (total - free - buff - cache) \/ total * 100%<\/code><\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#load\" name=\"user-content-load\"><\/a>load<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-2\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-2\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>load1: \u4e00\u5206\u949f\u7684\u7cfb\u7edf\u5e73\u5747\u8d1f\u8f7d<\/li>\n    <li>load5: \u4e94\u5206\u949f\u7684\u7cfb\u7edf\u5e73\u5747\u8d1f\u8f7d<\/li>\n    <li>load15:\u5341\u4e94\u5206\u949f\u7684\u7cfb\u7edf\u5e73\u5747\u8d1f\u8f7d<\/li>\n    <li>runq: \u5728\u91c7\u6837\u65f6\u523b,\u8fd0\u884c\u961f\u5217\u7684\u4efb\u52a1\u7684\u6570\u76ee,\u4e0e\/proc\/stat\u7684procs_running\u8868\u793a\u76f8\u540c\u610f\u601d<\/li>\n    <li>plit: \u5728\u91c7\u6837\u65f6\u523b,\u7cfb\u7edf\u4e2d\u6d3b\u8dc3\u7684\u4efb\u52a1\u7684\u4e2a\u6570\uff08\u4e0d\u5305\u62ec\u8fd0\u884c\u5df2\u7ecf\u7ed3\u675f\u7684\u4efb\u52a1\uff09<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-1\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-1\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\/proc\/loadavg\u6587\u4ef6\u4e2d\u4fdd\u5b58\u7684\u6709\u8d1f\u8f7d\u76f8\u5173\u7684\u6570\u636e\n<code>0.00 0.01 0.00 1\/271 23741<\/code>\n\u5206\u522b\u662f1\u5206\u949f\u8d1f\u8f7d,\u4e94\u5206\u949f\u8d1f\u8f7d,\u5341\u4e94\u5206\u949f\u8d1f\u8f7d,\u8fd0\u884c\u8fdb\u7a0b\uff0f\u603b\u8fdb\u7a0b \u6700\u5927\u7684pid\n\u53ea\u9700\u8981\u91c7\u96c6\u524d\u4e94\u4e2a\u6570\u636e\u65e2\u53ef\u5f97\u5230\u6240\u6709\u4fe1\u606f\n\u6ce8\u610f:\u53ea\u6709\u5f53\u7cfb\u7edf\u8d1f\u8f7d\u9664cpu\u6838\u6570>1\u7684\u65f6\u5019,\u7cfb\u7edf\u8d1f\u8f7d\u8f83\u9ad8<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#traffic\" name=\"user-content-traffic\"><\/a>traffic<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-3\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-3\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>bytin: \u5165\u53e3\u6d41\u91cfbyte\/s<\/li>\n    <li>bytout: \u51fa\u53e3\u6d41\u91cfbyte\/s<\/li>\n    <li>pktin: \u5165\u53e3pkt\/s<\/li>\n    <li>pktout: \u51fa\u53e3pkt\/s<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-2\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-2\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u6d41\u91cf\u7684\u8ba1\u6570\u5668\u4fe1\u606f\u6765\u81ea:\/proc\/net\/dev<\/p>\n<pre><code>    face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed\n    lo:1291647853895 811582000    0    0    0     0          0         0 1291647853895 811582000    0    0    0     0       0          0\n    eth0:853633725380 1122575617    0    0    0     0          0         0 1254282827126 808083790    0    0    0     0       0          0\n<\/code>\n<\/pre>\n<p>\u5b57\u6bb5\u7684\u542b\u4e49\u7b2c\u4e00\u884c\u5df2\u7ecf\u6807\u793a\u51fa\u6765,\u6bcf\u4e00\u884c\u4ee3\u8868\u4e00\u4e2a\u7f51\u5361,tsar\u4e3b\u8981\u91c7\u96c6\u7684\u662f\u51fa\u53e3\u548c\u5165\u53e3\u7684bytes\uff0fpackets\n\u6ce8\u610ftsar\u53ea\u5bf9\u4ee5eth\u548cem\u5f00\u5934\u7684\u7f51\u5361\u6570\u636e\u8fdb\u884c\u4e86\u91c7\u96c6,\u50cflo\u8fd9\u79cd\u7f51\u5361\u76f4\u63a5\u5c31\u5ffd\u7565\u6389\u4e86,\u6d41\u91cf\u7684\u5355\u4f4d\u662fbyte<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#tcp\" name=\"user-content-tcp\"><\/a>tcp<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-4\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-4\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>active:\u4e3b\u52a8\u6253\u5f00\u7684tcp\u8fde\u63a5\u6570\u76ee<\/li>\n    <li>pasive:\u88ab\u52a8\u6253\u5f00\u7684tcp\u8fde\u63a5\u6570\u76ee<\/li>\n    <li>iseg: \u6536\u5230\u7684tcp\u62a5\u6587\u6570\u76ee<\/li>\n    <li>outseg:\u53d1\u51fa\u7684tcp\u62a5\u6587\u6570\u76ee<\/li>\n    <li>EstRes:Number of resets that have occurred at ESTABLISHED<\/li>\n    <li>AtmpFa:Number of failed connection attempts<\/li>\n    <li>CurrEs:\u5f53\u524d\u72b6\u6001\u4e3aESTABLISHED\u7684tcp\u8fde\u63a5\u6570<\/li>\n    <li>retran:\u7cfb\u7edf\u7684\u91cd\u4f20\u7387<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-3\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-3\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>tcp\u7684\u76f8\u5173\u8ba1\u6570\u5668\u6587\u4ef6\u662f:\/proc\/net\/snmp<\/p>\n<pre><code>    Tcp: RtoAlgorithm RtoMin RtoMax MaxConn ActiveOpens PassiveOpens AttemptFails EstabResets CurrEstab InSegs OutSegs RetransSegs InErrs OutRsts\n    Tcp: 1 200 120000 -1 31702170 14416937 935062 772446 16 1846056224 1426620266 448823 0 5387732\n<\/code>\n<\/pre>\n<p>\u6211\u4eec\u4e3b\u8981\u5173\u6ce8\u5176\u4e2d\u7684ActiveOpens\/PassiveOpens\/AttemptFails\/EstabResets\/CurrEstab\/InSegs\/OutSegs\/RetransSegs\n\u4e3b\u8981\u5173\u6ce8\u4e00\u4e0b\u91cd\u4f20\u7387\u7684\u8ba1\u7b97\u65b9\u5f0f:\n<code>retran = (RetransSegs\uff0dlast RetransSegs) \uff0f (OutSegs\uff0dlast OutSegs) * 100%<\/code><\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#udp\" name=\"user-content-udp\"><\/a>udp<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-5\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-5\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>idgm: \u6536\u5230\u7684udp\u62a5\u6587\u6570\u76ee<\/li>\n    <li>odgm: \u53d1\u9001\u7684udp\u62a5\u6587\u6570\u76ee<\/li>\n    <li>noport:udp\u534f\u8bae\u5c42\u63a5\u6536\u5230\u76ee\u7684\u5730\u5740\u6216\u76ee\u7684\u7aef\u53e3\u4e0d\u5b58\u5728\u7684\u6570\u636e\u5305<\/li>\n    <li>idmerr:udp\u5c42\u63a5\u6536\u5230\u7684\u65e0\u6548\u6570\u636e\u5305\u7684\u4e2a\u6570<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-4\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-4\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>UDP\u7684\u6570\u636e\u6765\u6e90\u6587\u4ef6\u548cTCP\u4e00\u6837,\u4e5f\u662f\u5728\/proc\/net\/snmp<\/p>\n<pre><code>    Udp: InDatagrams NoPorts InErrors OutDatagrams\n    Udp: 31609577 10708119 0 159885874\n<\/code>\n<\/pre>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#io\" name=\"user-content-io\"><\/a>io<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-6\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-6\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>rrqms: The number of read requests merged per second that were issued to the device.<\/li>\n    <li>wrqms: The number of write requests merged per second that were issued to the device.<\/li>\n    <li>rs: The number of read requests that were issued to the device per second.<\/li>\n    <li>ws: The number of write requests that were issued to the device per second.<\/li>\n    <li>rsecs: The number of sectors read from the device per second.<\/li>\n    <li>wsecs: The number of sectors written to the device per second.<\/li>\n    <li>rqsize:The average size (in sectors) of the requests that were issued to the device.<\/li>\n    <li>qusize:The average queue length of the requests that were issued to the device.<\/li>\n    <li>await: The average time (in milliseconds) for I\/O requests issued to the device to be served. This includes the time spent by the requests in queue and the time spent servicing them.<\/li>\n    <li>svctm: The average service time (in milliseconds) for I\/O requests that were issued to the device.<\/li>\n    <li>util: Percentage of CPU time during which I\/O requests were issued to the device (bandwidth utilization for the device).Device saturation occurs when this value is close to 100%.<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-5\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-5\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>IO\u7684\u8ba1\u6570\u5668\u6587\u4ef6\u662f:\/proc\/diskstats,\u6bd4\u5982:<\/p>\n<pre><code>    202    0 xvda 12645385 1235409 416827071 59607552 193111576 258112651 3679534806 657719704 0 37341324 717325100\n    202    1 xvda1 421 2203 3081 9888 155 63 421 1404 0 2608 11292\n<\/code>\n<\/pre>\n<p>\u6bcf\u4e00\u884c\u5b57\u6bb5\u7684\u542b\u4e49\u662f:<\/p>\n<ul>\n    <li>major: \u4e3b\u8bbe\u5907\u53f7<\/li>\n    <li>minor: \u6b21\u8bbe\u5907\u53f7,\u8bbe\u5907\u53f7\u662f\u7528\u6765\u533a\u5206\u78c1\u76d8\u7684\u7c7b\u578b\u548c\u5382\u5bb6\u4fe1\u606f<\/li>\n    <li>name: \u8bbe\u5907\u540d\u79f0<\/li>\n    <li>rd_ios: \u8bfb\u5b8c\u6210\u6b21\u6570,number of issued reads. This is the total number of reads completed successfully<\/li>\n    <li>rd_merges: \u5408\u5e76\u8bfb\u5b8c\u6210\u6b21\u6570,\u4e3a\u4e86\u6548\u7387\u53ef\u80fd\u4f1a\u5408\u5e76\u76f8\u90bb\u7684\u8bfb\u548c\u5199.\u4ece\u800c\u4e24\u6b214K\u7684\u8bfb\u5728\u5b83\u6700\u7ec8\u88ab\u5904\u7406\u5230\u78c1\u76d8\u4e0a\u4e4b\u524d\u53ef\u80fd\u4f1a\u53d8\u6210\u4e00\u6b218K\u7684\u8bfb,\u624d\u88ab\u8ba1\u6570\uff08\u548c\u6392\u961f\uff09,\u56e0\u6b64\u53ea\u6709\u4e00\u6b21I\/O\u64cd\u4f5c<\/li>\n    <li>rd_sectors: \u8bfb\u6247\u533a\u7684\u6b21\u6570,number of sectors read. This is the total number of sectors read successfully.<\/li>\n    <li>rd_ticks: \u8bfb\u82b1\u8d39\u7684\u6beb\u79d2\u6570,number of milliseconds spent reading. This is the total number of milliseconds spent by all reads<\/li>\n    <li>wr_ios: \u5199\u5b8c\u6210\u6b21\u6570,number of writes completed. This is the total number of writes completed successfully<\/li>\n    <li>wr_merges: \u5408\u5e76\u5199\u5b8c\u6210\u6b21\u6570,number of writes merged Reads and writes which are adjacent to each other may be merged for efficiency. Thus two 4K reads may become one 8K read before it is ultimately handed to the disk, and so it will be counted (and queued) as only one I\/O.<\/li>\n    <li>wr_sectors: \u5199\u6247\u533a\u6b21\u6570,number of sectors written. This is the total number of sectors written successfully<\/li>\n    <li>wr_ticks: \u5199\u82b1\u8d39\u7684\u6beb\u79d2\u6570,number of milliseconds spent writing. This is the total number of milliseconds spent by all writes.<\/li>\n    <li>cur_ios: \u6b63\u5728\u5904\u7406\u7684\u8f93\u5165\/\u8f93\u51fa\u8bf7\u6c42\u6570,number of I\/Os currently in progress. The only field that should go to zero. Incremented as requests are given to appropriate request_queue_t and decremented as they finish.<\/li>\n    <li>ticks: \u8f93\u5165\/\u8f93\u51fa\u64cd\u4f5c\u82b1\u8d39\u7684\u6beb\u79d2\u6570<\/li>\n    <li>aveq: \u8f93\u5165\/\u8f93\u51fa\u64cd\u4f5c\u82b1\u8d39\u7684\u52a0\u6743\u6beb\u79d2\u6570<\/li>\n<\/ul>\n<p>\u901a\u8fc7\u8fd9\u4e9b\u8ba1\u6570\u5668\u53ef\u4ee5\u7b97\u51fa\u6765\u4e0a\u9762\u7684\u6bcf\u4e2a\u5b57\u6bb5\u7684\u503c<\/p>\n<pre><code>double n_ios = rd_ios + wr_ios;\ndouble n_ticks = rd_ticks + wr_ticks;\ndouble n_kbytes = (rd_sectors + wr_sectors) \/ 2;\nst_array[0] = rd_merges \/ (inter * 1.0);\nst_array[1] = wr_merges \/ (inter * 1.0);\nst_array[2] = rd_ios \/ (inter * 1.0);\nst_array[3] = wr_ios \/ (inter * 1.0);\nst_array[4] = rd_sectors \/ (inter * 2.0);\nst_array[5] = wr_sectors \/ (inter * 2.0);\nst_array[6] = n_ios ? n_kbytes \/ n_ios : 0.0;\nst_array[7] = aveq \/ (inter * 1000);\nst_array[8] = n_ios ? n_ticks \/ n_ios : 0.0;\nst_array[9] = n_ios ? ticks \/ n_ios : 0.0;\nst_array[10] = ticks \/ (inter * 10.0); \n\n<\/code>\n<\/pre>\n<p>\u6ce8\u610f:<\/p>\n<blockquote>\u6247\u533a\u4e00\u822c\u90fd\u662f512\u5b57\u8282,\u56e0\u6b64\u6709\u7684\u5730\u65b9\u9664\u4ee52\u4e86 ws\u662f\u6307\u771f\u6b63\u843d\u5230io\u8bbe\u5907\u4e0a\u7684\u5199\u6b21\u6570, wrqpms\u662f\u6307\u7cfb\u7edf\u8c03\u7528\u5408\u5e76\u7684\u5199\u6b21\u6570, \u5b83\u4eec\u4e4b\u95f4\u7684\u5927\u5c0f\u5173\u7cfb\u6ca1\u6709\u53ef\u6bd4\u6027,\u56e0\u4e3a\u4e0d\u77e5\u9053\u591a\u5c11\u8bf7\u6c42\u80fd\u591f\u88ab\u5408\u5e76,\u6bd4\u5982\u53d1\u8d77\u4e86100\u4e2aread\u7cfb\u7edf\u8c03\u7528,\u6bcf\u4e2a\u8bfb4K,\u5047\u5982\u8fd9100\u4e2a\u90fd\u662f\u8fde\u7eed\u7684\u8bfb,\u7531\u4e8e\u786c\u76d8\u901a\u5e38\u5141\u8bb8\u6700\u5927\u7684request\u4e3a256KB,\u90a3\u4e48block\u5c42\u4f1a\u628a\u8fd9100\u4e2a\u8bfb\u8bf7\u6c42\u5408\u5e76\u62102\u4e2arequest,\u4e00\u4e2a256KB,\u53e6\u4e00\u4e2a144KB,rrqpm\/s\u4e3a100,\u56e0\u4e3a100\u4e2arequest\u90fd\u53d1\u751f\u4e86\u5408\u5e76,\u4e0d\u7ba1\u5b83\u6700\u540e\u5408\u5e76\u6210\u51e0\u4e2a\uff1br\/s\u4e3a2,\u56e0\u4e3a\u6700\u540e\u7684request\u6570\u4e3a2<\/blockquote>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#paritition\" name=\"user-content-paritition\"><\/a>paritition<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-7\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-7\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>bfree: \u5206\u533a\u7a7a\u95f2\u7684\u5b57\u8282<\/li>\n    <li>bused: \u5206\u533a\u4f7f\u7528\u4e2d\u7684\u5b57\u8282<\/li>\n    <li>btotl: \u5206\u533a\u603b\u7684\u5927\u5c0f<\/li>\n    <li>util: \u5206\u533a\u4f7f\u7528\u7387<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-6\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-6\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u9996\u5148\u901a\u8fc7\/etc\/mtab\u83b7\u53d6\u5230\u5206\u533a\u4fe1\u606f,\u7136\u540e\u901a\u8fc7statfs\u8bbf\u95ee\u8be5\u5206\u533a\u7684\u4fe1\u606f,\u67e5\u8be2\u6587\u4ef6\u7cfb\u7edf\u76f8\u5173\u4fe1\u606f,\u5305\u542b:<\/p>\n<pre><code>    struct statfs {\n    long f_type; \n    long f_bsiz\n    e; \n    long f_blocks; \n    long f_bfree; \n    long f_bavail; \n    long f_files; \n    long f_ffree; \n    fsid_t f_fsid; \n    long f_namelen; \n    };\n<\/code>\n<\/pre>\n<p>\u7136\u540e\u5c31\u53ef\u4ee5\u8ba1\u7b97\u51fatsar\u9700\u8981\u7684\u4fe1\u606f,\u5206\u533a\u7684\u5b57\u8282\u6570\uff1d\u5757\u6570\uff0a\u5757\u5927\u5c0f\uff1df_blocks * f_bsize<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#pcsw\" name=\"user-content-pcsw\"><\/a>pcsw<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-8\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-8\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>cswch: \u8fdb\u7a0b\u5207\u6362\u6b21\u6570<\/li>\n    <li>proc: \u65b0\u5efa\u7684\u8fdb\u7a0b\u6570<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-7\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-7\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u8ba1\u6570\u5668\u5728\/proc\/stat:<\/p>\n<pre><code>    ctxt 19873315174\n    processes 296444211\n<\/code>\n<\/pre>\n<p>\u5206\u522b\u4ee3\u8868\u8fdb\u7a0b\u5207\u6362\u6b21\u6570,\u4ee5\u53ca\u8fdb\u7a0b\u6570<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#tcpx\" name=\"user-content-tcpx\"><\/a>tcpx<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-9\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-9\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<p>recvq sendq est twait fwait1 fwait2 lisq lising lisove cnest ndrop edrop rdrop pdrop kdrop\n\u5206\u522b\u4ee3\u8868\ntcprecvq tcpsendq tcpest tcptimewait tcpfinwait1 tcpfinwait2 tcplistenq tcplistenincq tcplistenover tcpnconnest tcpnconndrop tcpembdrop tcprexmitdrop tcppersistdrop tcpkadrop<\/p>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-8\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-8\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u8ba1\u6570\u5668\u6765\u81ea:\/proc\/net\/netstat \/proc\/net\/snmp \u91cc\u9762\u7528\u5230\u7684\u6570\u636e\u6709:<\/p>\n<pre><code>    TcpExt: SyncookiesSent SyncookiesRecv SyncookiesFailed EmbryonicRsts PruneCalled RcvPruned OfoPruned OutOfWindowIcmps LockDroppedIcmps ArpFilter TW TWRecycled TWKilled PAWSPassive PAWSActive PAWSEstab DelayedACKs DelayedACKLocked DelayedACKLost ListenOverflows ListenDrops TCPPrequeued TCPDirectCopyFromBacklog&lt;wbr&gt;&lt;\/wbr&gt; TCPDirectCopyFromPrequeu&lt;wbr&gt;&lt;\/wbr&gt;e TCPPrequeueDropped TCPHPHits TCPHPHitsToUser TCPPureAcks TCPHPAcks TCPRenoRecovery TCPSackRecovery TCPSACKReneging TCPFACKReorder TCPSACKReorder TCPRenoReorder TCPTSReorder TCPFullUndo TCPPartialUndo TCPDSACKUndo TCPLossUndo TCPLoss TCPLostRetransmit TCPRenoFailures TCPSackFailures TCPLossFailures TCPFastRetrans TCPForwardRetrans TCPSlowStartRetrans TCPTimeouts TCPRenoRecoveryFail TCPSackRecoveryFail TCPSchedulerFailed TCPRcvCollapsed TCPDSACKOldSent TCPDSACKOfoSent TCPDSACKRecv TCPDSACKOfoRecv TCPAbortOnSyn TCPAbortOnData TCPAbortOnClose TCPAbortOnMemory TCPAbortOnTimeout TCPAbortOnLinger TCPAbortFailed TCPMemoryPressures\n    TcpExt: 0 0 0 80 539 0 0 0 0 0 3733709 51268 0 0 0 80 5583301 5966 104803 146887 146887 6500405 39465075 2562794034 0 689613557 2730596 540646233 234702206 0 44187 2066 94 240 0 114 293 1781 7221 60514 185158 2 2 3403 400 107505 5860 24813 174014 0 2966 7 168787 106151 40 32851 2 0 2180 9862 0 15999 0 0 0\n<\/code>\n<\/pre>\n<p>\u5177\u4f53\u5b57\u6bb5\u627e\u5230\u5e76\u4e14\u83b7\u53d6\u5373\u53ef<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#percpu-ncpu\" name=\"user-content-percpu-ncpu\"><\/a>percpu ncpu<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-10\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-10\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<p>\u5b57\u6bb5\u542b\u4e49\u7b49\u540ccpu\u6a21\u5757,\u53ea\u4e0d\u8fc7\u80fd\u591f\u652f\u6301\u91c7\u96c6\u5177\u4f53\u7684\u6bcf\u4e00\u4e2acpu\u7684\u4fe1\u606f<\/p>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-9\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-9\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u7b49\u540c\u4e8ecpu\u6a21\u5757<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#pernic\" name=\"user-content-pernic\"><\/a>pernic<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-11\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-11\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<p>\u5b57\u6bb5\u542b\u4e49\u7b49\u540ctraffic\u6a21\u5757,\u53ea\u4e0d\u8fc7\u80fd\u591f\u652f\u6301\u91c7\u96c6\u5177\u4f53\u7684\u6bcf\u4e00\u4e2a\u7f51\u5361\u7684\u4fe1\u606f<\/p>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-10\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-10\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u7b49\u540c\u4e8etraffic\u6a21\u5757<\/p>\n<h2><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%BA%94%E7%94%A8%E6%A8%A1%E5%9D%97\" name=\"user-content-%E5%BA%94%E7%94%A8%E6%A8%A1%E5%9D%97\"><\/a>\u5e94\u7528\u6a21\u5757<\/h2>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#proc\" name=\"user-content-proc\"><\/a>proc<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-12\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-12\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>user: \u67d0\u4e2a\u8fdb\u7a0b\u7528\u6237\u6001cpu\u6d88\u8017<\/li>\n    <li>sys: \u67d0\u4e2a\u8fdb\u7a0b\u7cfb\u7edf\u6001cpu\u6d88\u8017<\/li>\n    <li>total:\u67d0\u4e2a\u8fdb\u7a0b\u603b\u7684cpu\u6d88\u8017<\/li>\n    <li>mem: \u67d0\u4e2a\u8fdb\u7a0b\u7684\u5185\u5b58\u6d88\u8017\u767e\u5206\u6bd4<\/li>\n    <li>RSS: \u67d0\u4e2a\u8fdb\u7a0b\u7684\u865a\u62df\u5185\u5b58\u6d88\u8017,\u8fd9\u662f\u9a7b\u7559\u5728\u7269\u7406\u5185\u5b58\u7684\u4e00\u90e8\u5206.\u5b83\u6ca1\u6709\u4ea4\u6362\u5230\u786c\u76d8.\u5b83\u5305\u62ec\u4ee3\u7801,\u6570\u636e\u548c\u6808<\/li>\n    <li>read: \u8fdb\u7a0bio\u8bfb\u5b57\u8282<\/li>\n    <li>write:\u8fdb\u7a0b\u7684io\u5199\u5b57\u8282<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-11\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-11\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u8ba1\u6570\u5668\u6587\u4ef6<\/p>\n<blockquote>\/proc\/pid\/stat:\u83b7\u53d6\u8fdb\u7a0b\u7684cpu\u4fe1\u606f\n\/proc\/pid\/status:\u83b7\u53d6\u8fdb\u7a0b\u7684mem\u4fe1\u606f\n\/proc\/pid\/io:\u83b7\u53d6\u8fdb\u7a0b\u7684\u8bfb\u5199IO\u4fe1\u606f<\/blockquote>\n<p>\u6ce8\u610f,\u9700\u8981\u5c06\u91c7\u96c6\u7684\u8fdb\u7a0b\u540d\u79f0\u914d\u7f6e\u5728\/etc\/tsar\/tsar.conf\u603b\u7684mod_proc on procname,\u8fd9\u6837\u5c31\u4f1a\u627e\u5230procname\u7684pid,\u5e76\u8fdb\u884c\u6570\u636e\u91c7\u96c6<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#nginx\" name=\"user-content-nginx\"><\/a>nginx<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-13\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-13\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>Accept:\u603b\u5171\u63a5\u6536\u7684\u65b0\u8fde\u63a5\u6570\u76ee<\/li>\n    <li>Handle:\u603b\u5171\u5904\u7406\u7684\u8fde\u63a5\u6570\u76ee<\/li>\n    <li>Reqs:\u603b\u5171\u4ea7\u751f\u8bf7\u6c42\u6570\u76ee<\/li>\n    <li>Active:\u6d3b\u8dc3\u7684\u8fde\u63a5\u6570,\u7b49\u4e8eread+write+wait<\/li>\n    <li>Read:\u8bfb\u53d6\u8bf7\u6c42\u6570\u636e\u7684\u8fde\u63a5\u6570\u76ee<\/li>\n    <li>Write:\u5411\u7528\u6237\u5199\u54cd\u5e94\u6570\u636e\u7684\u8fde\u63a5\u6570\u76ee<\/li>\n    <li>Wait:\u957f\u8fde\u63a5\u7b49\u5f85\u7684\u8fde\u63a5\u6570\u76ee<\/li>\n    <li>Qps:\u6bcf\u79d2\u5904\u7406\u7684\u8bf7\u6c42\u6570<\/li>\n    <li>Rt:\u5e73\u5747\u54cd\u5e94\u65f6\u95f4ms<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-12\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-12\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u901a\u8fc7nginx\u7684\u91c7\u96c6\u6a21\u5757\u914d\u7f6e,\u8bbf\u95ee\u7279\u5b9a\u5730\u5740,\u5177\u4f53\u53c2\u89c1:<a href=\"https:\/\/github.com\/taobao\/tsar-mod_nginx\"><a href=\"https:\/\/github.com\/taobao\/tsar-mod_nginx\">https:\/\/github.com\/taobao\/tsar-mod_nginx<\/a><\/a><\/p>\n<pre><code>    location = \/nginx_status {\n        stub_status on;\n    }\n<\/code>\n<\/pre>\n<p>\u8bf7\u6c42\u5230\u7684\u6570\u636e\u662f:<\/p>\n<pre><code>    Active connections: 1\n    server accepts handled requests request_time\n    24 24 7 0\n    Reading: 0 Writing: 1 Waiting: 0\n<\/code>\n<\/pre>\n<p>\u9700\u8981\u786e\u4fddnginx\u914d\u7f6e\u8be5location,\u5e76\u4e14\u80fd\u591f\u8bbf\u95ee<code>curl &lt;a href=&quot;http:\/\/localhost\/nginx_status&quot;&gt;http:\/\/localhost\/nginx_status&lt;\/a&gt;<\/code>\u5f97\u5230\u4e0a\u9762\u7684\u6570\u636e\n\u5982\u679cnginx\u7684\u7aef\u53e3\u4e0d\u662f80,\u5219\u9700\u8981\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u6307\u5b9a\u7aef\u53e3,\u914d\u7f6e\u6587\u4ef6\u662f\/etc\/tsar\/tsar.conf,\u4fee\u6539mod_nginx on\u4e3amod_nginx on 8080<\/p>\n<p>\u7c7b\u4f3c\u7684\u6709nginx_code, nginx_domain\u6a21\u5757,\u76f8\u5e94\u7684\u914d\u7f6e\u662f:<\/p>\n<pre><code>    req_status_zone server &quot;$host&quot; 20M;\n    req_status server;\n    location \/traffic_status {\n            req_status_show;\n    } \n<\/code>\n<\/pre>\n<p>\u901a\u8fc7\u8bbf\u95ee<code>curl &lt;a href=&quot;http:\/\/localhost\/traffic_status&quot;&gt;http:\/\/localhost\/traffic_status&lt;\/a&gt;<\/code>\u80fd\u591f\u5f97\u5230\u5982\u4e0b\u5b57\u6bb5\u7684\u6570\u636e\n<code>localhost,0,0,2,2,2,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0<\/code><\/p>\n<p>\u8bf7\u6c42\u5230\u7684\u6570\u636e\u6bcf\u4e2a\u5b57\u6bb5\u7684\u542b\u4e49\u662f:<\/p>\n<ul>\n    <li>kv \u8ba1\u7b97\u5f97\u5230\u7684req_status_zone\u6307\u4ee4\u5b9a\u4e49\u53d8\u91cf\u7684\u503c,\u6b64\u65f6\u4e3adomain\u5b57\u6bb5<\/li>\n    <li>bytes_in_total \u4ece\u5ba2\u6237\u7aef\u63a5\u6536\u6d41\u91cf\u603b\u548c<\/li>\n    <li>bytes_out_total \u53d1\u9001\u5230\u5ba2\u6237\u7aef\u6d41\u91cf\u603b\u548c<\/li>\n    <li>conn_total \u5904\u7406\u8fc7\u7684\u8fde\u63a5\u603b\u6570<\/li>\n    <li>req_total \u5904\u7406\u8fc7\u7684\u603b\u8bf7\u6c42\u6570<\/li>\n    <li>2xx 2xx\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>3xx 3xx\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>4xx 4xx\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>5xx 5xx\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>other \u5176\u4ed6\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>rt_total rt\u7684\u603b\u6570<\/li>\n    <li>upstream_req \u9700\u8981\u8bbf\u95eeupstream\u7684\u8bf7\u6c42\u603b\u6570<\/li>\n    <li>upstream_rt \u8bbf\u95eeupstream\u7684\u603brt<\/li>\n    <li>upstream_tries upstram\u603b\u8bbf\u95ee\u6b21\u6570<\/li>\n    <li>200 200\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>206 206\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>302 302\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>304 304\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>403 403\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>404 404\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>416 416\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>499 499\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>500 500\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>502 502\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>503 503\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>504 504\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>508 508\u8bf7\u6c42\u7684\u603b\u6570<\/li>\n    <li>detail_other \u975e\u4ee5\u4e0a13\u79cdstatus code\u7684\u8bf7\u6c42\u603b\u6570<\/li>\n<\/ul>\n<p>\u5982\u679cdomain\u6570\u91cf\u592a\u591a,\u6216\u8005\u7aef\u53e3\u4e0d\u662f80,\u9700\u8981\u8fdb\u884c\u4e13\u95e8\u7684\u914d\u7f6e,\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b:\nport=8080 #\u6307\u5b9anginx\u7684\u7aef\u53e3\ntop=10 #\u6307\u5b9a\u6700\u591a\u91c7\u96c6\u7684\u57df\u540d\u4e2a\u6570\uff0c\u6309\u7167\u8bf7\u6c42\u603b\u4e2a\u6570\u6392\u5217\ndomain=a.com b.com #\u6307\u5b9a\u7279\u5b9a\u9700\u8981\u91c7\u96c6\u7684\u57df\u540d\u5217\u8868,\u5206\u9694\u7b26\u4e3a\u7a7a\u683c,\u9017\u53f7,\u6216\u8005\u5236\u8868\u7b26\n\u5728\/etc\/tsar\/tsar.conf\u4e2d\u6307\u5b9a\u914d\u7f6e\u6587\u4ef6\u7684\u8def\u5f84:mod_nginx_domain on \/tmp\/my.conf<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#squid\" name=\"user-content-squid\"><\/a>squid<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-14\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-14\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>qps: \u6bcf\u79d2\u8bf7\u6c42\u6570<\/li>\n    <li>rt: \u8bbf\u95ee\u5e73\u5747\u76f8\u5e94\u65f6\u95f4<\/li>\n    <li>r_hit: \u8bf7\u6c42\u547d\u4e2d\u7387<\/li>\n    <li>b_hit: \u5b57\u8282\u547d\u4e2d\u7387<\/li>\n    <li>d_hit: \u78c1\u76d8\u547d\u4e2d\u7387<\/li>\n    <li>m_hit: \u5185\u5b58\u547d\u4e2d\u7387<\/li>\n    <li>fdused: Number of file desc currently in use<\/li>\n    <li>fdque: Files queued for open<\/li>\n    <li>objs: StoreEntries<\/li>\n    <li>inmem: StoreEntries with MemObjects<\/li>\n    <li>hot: Hot Object Cache Items<\/li>\n    <li>size: Mean Object Size<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-13\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-13\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u8bbf\u95eesquid\u7684mgrinfo\u4fe1\u606f\u83b7\u53d6,\u6709\u4e9b\u5b57\u6bb5\u7ecf\u8fc7\u4e86\u4e00\u4e9bpatch,\u53ef\u80fd\u4e0d\u9002\u7528\u5916\u90e8\u7248\u672c<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#haproxy\" name=\"user-content-haproxy\"><\/a>haproxy<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-15\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-15\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>stat: \u72b6\u6001,1\u6b63\u5e38<\/li>\n    <li>uptime:\u542f\u52a8\u6301\u7eed\u65f6\u95f4<\/li>\n    <li>conns: \u603b\u7684\u8fde\u63a5\u6570<\/li>\n    <li>qps: \u6bcf\u79d2\u8bf7\u6c42\u6570<\/li>\n    <li>hit: haproxy\u5f00\u542fcache\u65f6\u7684\u547d\u4e2d\u7387<\/li>\n    <li>rt: \u5e73\u5747\u54cd\u5e94\u65f6\u95f4ms<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-14\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-14\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>haproxy\u7ecf\u8fc7\u4e86patch,\u80fd\u591f\u5728\u591a\u8fdb\u7a0b\u6a21\u5f0f\u4e0b\u8fdb\u884c\u7edf\u8ba1\u4fe1\u606f\u7684\u6c47\u603b,\u7136\u540e\u901a\u8fc7haproxy\u7684\u672c\u5730\u8bbf\u95ee\u5176\u72b6\u6001\u9875\u9762admin\u5206\u6790\u5f97\u5230<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#lvs\" name=\"user-content-lvs\"><\/a>lvs<\/h3>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-16\" name=\"user-content-%E5%AD%97%E6%AE%B5%E5%90%AB%E4%B9%89-16\"><\/a>\u5b57\u6bb5\u542b\u4e49<\/h4>\n<ul>\n    <li>stat: lvs\u72b6\u6001,1\u6b63\u5e38<\/li>\n    <li>conns: \u603b\u7684\u8fde\u63a5\u6570<\/li>\n    <li>pktin: \u6536\u5230\u7684\u5305\u6570<\/li>\n    <li>pktout:\u53d1\u51fa\u7684\u5305\u6570<\/li>\n    <li>bytin: \u6536\u5230\u7684\u5b57\u8282\u6570<\/li>\n    <li>bytout:\u53d1\u51fa\u7684\u5b57\u8282\u6570<\/li>\n<\/ul>\n<h4><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-15\" name=\"user-content-%E9%87%87%E9%9B%86%E6%96%B9%E6%B3%95-15\"><\/a>\u91c7\u96c6\u65b9\u6cd5<\/h4>\n<p>\u8bbf\u95eelvs\u7684\u7edf\u8ba1\u6587\u4ef6:\/proc\/net\/ip_vs_stats<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#apache\" name=\"user-content-apache\"><\/a>apache<\/h3>\n<p>\u53c2\u89c1:<a href=\"https:\/\/github.com\/kongjian\/tsar-apache\"><a href=\"https:\/\/github.com\/kongjian\/tsar-apache\">https:\/\/github.com\/kongjian\/tsar-apache<\/a><\/a><\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#tcprt\" name=\"user-content-tcprt\"><\/a>tcprt<\/h3>\n<p>\u79c1\u6709\u5e94\u7528,\u7565<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#swift\" name=\"user-content-swift\"><\/a>swift<\/h3>\n<p>\u79c1\u6709\u5e94\u7528,\u7565<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#cgcpucgmemcgblkio\" name=\"user-content-cgcpucgmemcgblkio\"><\/a>cgcpu\/cgmem\/cgblkio<\/h3>\n<p>\u79c1\u6709\u5e94\u7528,\u7565<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#trafficserver\" name=\"user-content-trafficserver\"><\/a>trafficserver<\/h3>\n<p>\u5f85\u8865\u5145<\/p>\n<h3><a href=\"https:\/\/github.com\/alibaba\/tsar\/blob\/master\/info.md#tmd\" name=\"user-content-tmd\"><\/a>tmd<\/h3>\n<p>\u79c1\u6709\u5e94\u7528,\u7565<\/p>","protected":false},"excerpt":{"rendered":"<p>\u7cfb\u7edf\u6a21\u5757 cpu \u5b57\u6bb5\u542b\u4e49 user: \u8868\u793aCPU\u6267\u884c\u7528\u6237\u8fdb\u7a0b\u7684\u65f6\u95f4,\u901a\u5e38\u671f\u671b\u7528\u6237\u7a7a\u95f4CPU\u8d8a\u9ad8\u8d8a\u597d. sys: \u8868\u793aCPU\u5728\u5185\u6838\u8fd0\u884c\u65f6\u95f4,\u7cfb\u7edfCPU\u5360\u7528\u7387\u9ad8,\u8868\u660e\u7cfb\u7edf\u67d0\u90e8\u5206\u5b58\u5728\u74f6\u9888.\u901a\u5e38\u503c\u8d8a\u4f4e\u8d8a\u597d.&#46;&#46;&#46;<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[465],"class_list":["post-1496","post","type-post","status-publish","format-standard","hentry","category-linux","tag-tsar"],"_links":{"self":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1496","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/comments?post=1496"}],"version-history":[{"count":1,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1496\/revisions"}],"predecessor-version":[{"id":1497,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/posts\/1496\/revisions\/1497"}],"wp:attachment":[{"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/media?parent=1496"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/categories?post=1496"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/nick.txtcc.com\/index.php\/wp-json\/wp\/v2\/tags?post=1496"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}