免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3556 | 回复: 3
打印 上一主题 下一主题

[FreeBSD] vmstat -z的这几项输出是什么意思? [复制链接]

论坛徽章:
54
2017金鸡报晓
日期:2017-02-08 10:39:42操作系统版块每日发帖之星
日期:2016-03-08 06:20:00操作系统版块每日发帖之星
日期:2016-03-07 06:20:00操作系统版块每日发帖之星
日期:2016-02-22 06:20:00操作系统版块每日发帖之星
日期:2016-01-29 06:20:00操作系统版块每日发帖之星
日期:2016-01-27 06:20:00操作系统版块每日发帖之星
日期:2016-01-20 06:20:00操作系统版块每日发帖之星
日期:2016-01-06 06:20:0015-16赛季CBA联赛之江苏
日期:2015-12-21 20:00:24操作系统版块每日发帖之星
日期:2015-12-21 06:20:00IT运维版块每日发帖之星
日期:2015-11-17 06:20:002015亚冠之广州恒大
日期:2015-11-12 10:58:02
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-03-30 10:50 |只看该作者 |倒序浏览
有向项是fail,但是不清楚代表什么意思,请大神讲解一下:
  1. # vmstat -z
  2. ITEM                   SIZE  LIMIT     USED     FREE      REQ FAIL SLEEP

  3. UMA Kegs:               384,      0,     100,       0,     100,   0,   0
  4. UMA Zones:             1664,      0,     100,       0,     100,   0,   0
  5. UMA Slabs:               80,      0,   10927,      23,   14345,   0,   0
  6. UMA RCntSlabs:           88,      0,    6281,      19,    6281,   0,   0
  7. UMA Hash:               256,      0,       4,      11,       8,   0,   0
  8. 4 Bucket:                32,      0,      33,    1217,   34464,   0,   0
  9. 8 Bucket:                64,      0,      57,     997,    3187,   0,   0
  10. 16 Bucket:              128,      0,     105,    1538, 1128025, 656,   0
  11. 32 Bucket:              256,      0,     108,     447,    1567,  80,   0
  12. 64 Bucket:              512,      0,     198,     242,    1397, 150,   0
  13. 128 Bucket:            1024,      0,     401,     287,26938583,  17,   0
  14. vmem btag:               56,      0,   12265,     444,   12412, 179,   0
  15. VM OBJECT:              256,      0,    4882,     548,  109519,   0,   0
  16. RADIX NODE:             144,      0,    7033,     689,  189934,  39,   0
  17. MAP:                    240,      0,       3,      61,       3,   0,   0
  18. KMAP ENTRY:             128,      0,       6,     273,       6,   0,   0
复制代码

论坛徽章:
0
2 [报告]
发表于 2015-04-04 01:03 |只看该作者
版主,你可以简单的参考下面的描述,细讲起来有点繁琐.

"ITEM": 这个是kernel中创建的uma zone的名字,比如"UMA Zones",这个是分配struct uma_zone的uma zone的名字,创建进程时要分配相应的
struct proc结构,这个结构就是从相应的uma zone中分配的(这里为proc_zone),初始化时会创建这个proc_zone,既然创建proc_zone,那么就要从
名字为"UMA Zones"的uma zone获取相应的struct una_zone结构来描述它,所以从名字为"UMA Zones"的uma zone中分配的对象就是“struct uma_zone”,
FAIL就是分配对象失败的次数等等.其它成员参考下面结构的成员描述.这些成员的值是从kernel中描述一个uma zone的数据结构中获取的.

下面是vmstat实现代码中用到的数据结构等等:
  1. /*
  2. * memstat maintains its own internal notion of statistics on each memory
  3. * type, common across UMA and kernel malloc.  Some fields are straight from
  4. * the allocator statistics, others are derived when extracted from the
  5. * kernel.  A struct memory_type will describe each type supported by an
  6. * allocator.  memory_type structures can be chained into lists.
  7. */
  8. struct memory_type {
  9.         /*
  10.          * Static properties of type.
  11.          */
  12.         int         mt_allocator;                /* malloc(9), uma(9), etc. */
  13.         char         mt_name[MEMTYPE_MAXNAME];        /* name of memory type. */

  14.         /*
  15.          * (Relatively) static zone settings, that don't uniquely identify
  16.          * the zone, but also don't change much.
  17.          */
  18.         uint64_t         mt_countlimit;        /* 0, or maximum allocations. */
  19.         uint64_t         mt_byteslimit;        /* 0, or maximum bytes. */
  20.         uint64_t         mt_sizemask;        /* malloc: allocated size bitmask. */
  21.         uint64_t         mt_size;        /* uma: size of objects. */

  22.         /*
  23.          * Zone or type information that includes all caches and any central
  24.          * zone state.  Depending on the allocator, this may be synthesized
  25.          * from several sources, or directly measured.
  26.          */
  27.         uint64_t         mt_memalloced;        /* Bytes allocated over life time. */
  28.         uint64_t         mt_memfreed;        /* Bytes freed over life time. */
  29.         uint64_t         mt_numallocs;        /* Allocations over life time. */
  30.         uint64_t         mt_numfrees;        /* Frees over life time. */
  31.         uint64_t         mt_bytes;        /* Bytes currently allocated. */
  32.         uint64_t         mt_count;        /* Number of current allocations. */
  33.         uint64_t         mt_free;        /* Number of cached free items. */
  34.         uint64_t         mt_failures;        /* Number of allocation failures. */
  35.         uint64_t         mt_sleeps;        /* Number of allocation sleeps. */

  36.         /*
  37.          * Caller-owned memory.
  38.          */
  39.         void                *mt_caller_pointer[MEMSTAT_MAXCALLER];        /* Pointers. */
  40.         uint64_t         mt_caller_uint64[MEMSTAT_MAXCALLER];        /* Integers. */

  41.         /*
  42.          * For allocators making use of per-CPU caches, we also provide raw
  43.          * statistics from the central allocator and each per-CPU cache,
  44.          * which (combined) sometimes make up the above general statistics.
  45.          *
  46.          * First, central zone/type state, all numbers excluding any items
  47.          * cached in per-CPU caches.
  48.          *
  49.          * XXXRW: Might be desirable to separately expose allocation stats
  50.          * from zone, which should (combined with per-cpu) add up to the
  51.          * global stats above.
  52.          */
  53.         uint64_t         mt_zonefree;        /* Free items in zone. */
  54.         uint64_t         mt_kegfree;        /* Free items in keg. */

  55.         /*
  56.          * Per-CPU measurements fall into two categories: per-CPU allocation,
  57.          * and per-CPU cache state.
  58.          */
  59.         struct mt_percpu_alloc_s {
  60.                 uint64_t         mtp_memalloced;/* Per-CPU mt_memalloced. */
  61.                 uint64_t         mtp_memfreed;        /* Per-CPU mt_memfreed. */
  62.                 uint64_t         mtp_numallocs;        /* Per-CPU mt_numallocs. */
  63.                 uint64_t         mtp_numfrees;        /* Per-CPU mt_numfrees. */
  64.                 uint64_t         mtp_sizemask;        /* Per-CPU mt_sizemask. */
  65.                 void                *mtp_caller_pointer[MEMSTAT_MAXCALLER];
  66.                 uint64_t         mtp_caller_uint64[MEMSTAT_MAXCALLER];
  67.         }        *mt_percpu_alloc;

  68.         struct mt_percpu_cache_s {
  69.                 uint64_t         mtp_free;        /* Per-CPU cache free items. */
  70.         }        *mt_percpu_cache;

  71.         LIST_ENTRY(memory_type)        mt_list;        /* List of types. */
  72. };

  73. struct memory_type *mtp;


  74. "SIZE":memstat_get_size(mtp)
  75. uint64_t
  76. memstat_get_size(const struct memory_type *mtp)
  77. {

  78.         return (mtp->mt_size);
  79. }

  80. "LIMIT":memstat_get_countlimit(mtp)
  81. uint64_t
  82. memstat_get_countlimit(const struct memory_type *mtp)
  83. {

  84.         return (mtp->mt_countlimit);
  85. }

  86. "USED":memstat_get_count(mtp)
  87. uint64_t
  88. memstat_get_count(const struct memory_type *mtp)
  89. {

  90.         return (mtp->mt_count);
  91. }

  92. "FREE":memstat_get_free(mtp)
  93. uint64_t
  94. memstat_get_free(const struct memory_type *mtp)
  95. {

  96.         return (mtp->mt_free);
  97. }

  98. "REQ":memstat_get_numallocs(mtp)
  99. uint64_t
  100. memstat_get_numallocs(const struct memory_type *mtp)
  101. {

  102.         return (mtp->mt_numallocs);
  103. }

  104. "FAIL":memstat_get_failures(mtp)
  105. uint64_t
  106. memstat_get_failures(const struct memory_type *mtp)
  107. {

  108.         return (mtp->mt_failures);
  109. }

  110. "SLEEP":memstat_get_sleeps(mtp)
  111. uint64_t
  112. memstat_get_sleeps(const struct memory_type *mtp)
  113. {

  114.         return (mtp->mt_sleeps);
  115. }
复制代码

论坛徽章:
54
2017金鸡报晓
日期:2017-02-08 10:39:42操作系统版块每日发帖之星
日期:2016-03-08 06:20:00操作系统版块每日发帖之星
日期:2016-03-07 06:20:00操作系统版块每日发帖之星
日期:2016-02-22 06:20:00操作系统版块每日发帖之星
日期:2016-01-29 06:20:00操作系统版块每日发帖之星
日期:2016-01-27 06:20:00操作系统版块每日发帖之星
日期:2016-01-20 06:20:00操作系统版块每日发帖之星
日期:2016-01-06 06:20:0015-16赛季CBA联赛之江苏
日期:2015-12-21 20:00:24操作系统版块每日发帖之星
日期:2015-12-21 06:20:00IT运维版块每日发帖之星
日期:2015-11-17 06:20:002015亚冠之广州恒大
日期:2015-11-12 10:58:02
3 [报告]
发表于 2015-04-04 15:25 |只看该作者
回复 2# 71v5


谢谢你的分析。

在netstat 的man中,也要求去看看uma,但是uma只是一种机制,我就想知道出错的那几行都代表什么含义,或者说是什么原因导致这几行错误。比如有个mbuf那几行出错,就代表mbuf不足了,要去查查mbuf的限额。

论坛徽章:
54
2017金鸡报晓
日期:2017-02-08 10:39:42操作系统版块每日发帖之星
日期:2016-03-08 06:20:00操作系统版块每日发帖之星
日期:2016-03-07 06:20:00操作系统版块每日发帖之星
日期:2016-02-22 06:20:00操作系统版块每日发帖之星
日期:2016-01-29 06:20:00操作系统版块每日发帖之星
日期:2016-01-27 06:20:00操作系统版块每日发帖之星
日期:2016-01-20 06:20:00操作系统版块每日发帖之星
日期:2016-01-06 06:20:0015-16赛季CBA联赛之江苏
日期:2015-12-21 20:00:24操作系统版块每日发帖之星
日期:2015-12-21 06:20:00IT运维版块每日发帖之星
日期:2015-11-17 06:20:002015亚冠之广州恒大
日期:2015-11-12 10:58:02
4 [报告]
发表于 2015-04-17 18:33 |只看该作者
再顶顶,还是没找到相应的含义。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP