Chinese translated version of Documentation/sched-bwc.txt

If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.

Chinese maintainer: majg <1519014266@qq.com>
---------------------------------------------------------------------
Documentation/sched-bwc.txt 的中文翻译

如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。

中文版维护者: 马建刚  majg <1519014266@qq.com>
中文版翻译者: 马建刚  majg <1519014266@qq.com>
中文版校译者: 马建刚  majg <1519014266@qq.com>

以下为正文
---------------------------------------------------------------------
-CFS带宽控制
CFS Bandwidth Control
=====================
[ This document only discusses CPU bandwidth control for SCHED_NORMAL.
  The SCHED_RT case is covered in Documentation/scheduler/sched-rt-group.txt ]

-本文档只讨论CPU带宽控制SCHED_NORMAL的SCHED_RT案件中文档/调度/SCHED-RT-group.txt的覆盖

CFS bandwidth control is a CONFIG_FAIR_GROUP_SCHED extension which allows the
specification of the maximum CPU bandwidth available to a group or hierarchy.

-CFS的带宽控制是一个CONFIG_FAIR_GROUP_SCHED的的的扩展,它允许的CPU的最大可用带宽的一组或层次的规范。

The bandwidth allowed for a group is specified using a quota and period. Within
each given "period" (microseconds), a group is allowed to consume only up to
"quota" microseconds of CPU time.  When the CPU bandwidth consumption of a
group exceeds this limit (for that period), the tasks belonging to its
hierarchy will be throttled and are not allowed to run again until the next
period.
-带宽允许一组使用指定的配额和周期。在每个给定的“期间”(微秒),
一组最多只允许消耗“配额”微秒的CPU时间。当CPU的带宽消耗组大小超
出该限制(在该段期间),属于其的任务层次结构将被扼杀,且不得再
次运行,直到下一个时期。

A group's unused runtime is globally tracked, being refreshed with quota units
above at each period boundary.  As threads consume this bandwidth it is
transferred to cpu-local "silos" on a demand basis.  The amount transferred
within each of these updates is tunable and described as the "slice".
-A组的全球跟踪未使用的运行时,配额单位被刷新上述每个周期边界。
当线程消耗带宽转移到CPU本地需求的基础上的“孤岛”。转让金额于每
个这些更新是可调的,并描述为“切片”。

Management
-管理
----------

Quota and period are managed within the cpu subsystem via cgroupfs.
-cgroup的CPU子系统通过配额和周期内进行管理。

cpu.cfs_quota_us: the total available run-time within a period (in microseconds)
-cpu.cfs_quota_us:总的可用运行一段时间内(微秒)

cpu.cfs_period_us: the length of a period (in microseconds)
-cpu.cfs期间的周期长度(微秒)

cpu.stat: exports throttling statistics [explained further below]
-cpu.stat:出口节流统计[下文进一步解释]

The default values are:
 cpu.cfs_period_us=100ms
 cpu.cfs_quota=-1
-默认值是:
-cpu.cfs_period_us=为100ms
-cpu.xfs_quota=-1

A value of -1 for cpu.cfs_quota_us indicates that the group does not have any
bandwidth restriction in place, such a group is described as an unconstrained
bandwidth group.  This represents the traditional work-conserving behavior for
CFS.
-cpu.cfs_quota_us值为-1表示该组没有任何带宽限制的地方,
这样的基团被描述为一个无约束的带宽组。这代表传统保工作行为CFS。

Writing any (valid) positive value(s) will enact the specified bandwidth limit.
The minimum quota allowed for the quota or period is 1ms.  There is also an
upper bound on the period length of 1s.  Additional restrictions exist when
bandwidth limits are used in a hierarchical fashion, these are explained in
more detail below.
-编写任何(有效)阳性值(s)将制定指定带宽限制。配额或期间所允许的最低额度为1ms。此外,还有一个
上限1周期长度。存在其他限制时,带宽的限制是用于在一个分层的方式,这些都是解释更详细说明。

Writing any negative value to cpu.cfs_quota_us will remove the bandwidth limit
and return the group to an unconstrained state once more.
-写作任何负值cpu.cfs_quota_us的将删除的带宽限制,并返回该组的一次不受约束的状态。

Any updates to a group's bandwidth specification will result in it becoming
unthrottled if it is in a constrained state.
-任何一组的带宽规格在约束状态的更新会导致其成为未经节流的。

System wide settings
-系统范围的设置
--------------------

For efficiency run-time is transferred between the global pool and CPU local
"silos" in a batch fashion.  This greatly reduces global accounting pressure
on large systems.  The amount transferred each time such an update is required
is described as the "slice".
-为了提高效率,运行时全局池之间传送和CPU局部“孤岛”在批处理时。
这大大降低了设计大型系统的压力。调入量每次需要更新被描述为“切片”。

This is tunable via procfs:
-这是通过procfs的可调:
 /proc/sys/kernel/sched_cfs_bandwidth_slice_us (default=5ms)

Larger slice values will reduce transfer overheads, while smaller values allow
for more fine-grained consumption.
-较大的切片值会降低传输费用,而较小的值允许为更细粒度消费。

Statistics
-统计
----------

A group's bandwidth statistics are exported via 3 fields in cpu.stat.
-A组的带宽统计数据导出通过3场cpu.stat。

cpu.stat:
-  nr_periods:执行后所经过的时间间隔数。
- nr_periods: Number of enforcement intervals that have elapsed.
-  nr_throttled:这个组得次数已节流/限制。
- nr_throttled: Number of times the group has been throttled/limited.
-  throttled_time,总持续时间(纳秒)组实体被扼杀。
- throttled_time: The total time duration (in nanoseconds) for which entities
  of the group have been throttled.

This interface is read-only.
 -这个是只读接口。

Hierarchical considerations
-分层考虑
---------------------------
-The interface enforces that an individual entity's bandwidth is always
attainable, that is: max(c_i) <= C. However, over-subscription in the
aggregate case is explicitly allowed to enable work-conserving semantics
within a hierarchy.

-接口执行个体的带宽是可以实现的,那就是:最大(c_i)<=C。然而,

在总的情况下认购是明确允许的使工作保持语义在层次结构内。

e.g. \Sum (c_i) may exceed C
[ Where C is the parent's bandwidth, and c_i its children ]

[ 其中C是父母的带宽,和c_i儿童 ]

There are two ways in which a group may become throttled:
 a. it fully consumes its own quota within a period
 b. a parent's quota is fully consumed within its period
-这可能成为节流在一组的方式有两种:
a.它完全消耗了自己的配额在期限内
b.父母的配额被完全消耗在其周期内
 
In case b) above, even though the child may have runtime remaining it will not
be allowed to until the parent's runtime is refreshed.
-在案例B)以上,即使孩子可能有剩余运行时间也不被允许直到到父的运行刷新结束。

Examples
-示例
--------
1. Limit a group to 1 CPU worth of runtime.
-限制了一批价值1个CPU的运行时间。
 If period is 250ms and quota is also 250ms, the group will get
 1 CPU worth of runtime every 250ms.
-如果周期是250毫秒和配额也是250ms的,本组将获得1个CPU运行时每250毫秒。
 # echo 250000 > cpu.cfs_quota_us /* quota = 250ms */
 # echo 250000 > cpu.cfs_period_us /* period = 250ms */

2. Limit a group to 2 CPUs worth of runtime on a multi-CPU machine.
-限制一组2个处理器在多CPU的机器上运行时间。
 With 500ms period and 1000ms quota, the group can get 2 CPUs worth of
 runtime every 500ms.
-500ms的期间1000MS配额的,可以得到价值2个CPU运行时每500ms。
 # echo 1000000 > cpu.cfs_quota_us /* quota = 1000ms */
 # echo 500000 > cpu.cfs_period_us /* period = 500ms */

The larger period here allows for increased burst capacity.
-较大的时间在这里可以增加应对突发状况的能力。
3. Limit a group to 20% of 1 CPU.
-一组限制到20%,1个CPU。
 With 50ms period, 10ms quota will be equivalent to 20% of 1 CPU.
-10ms的配额与50ms的时期,将相当于1个CPU的20%。
 # echo 10000 > cpu.cfs_quota_us /* quota = 10ms */
 # echo 50000 > cpu.cfs_period_us /* period = 50ms */

By using a small period here we are ensuring a consistent latency
 response at the expense of burst capacity.
-在这里使用一个小的时期,我们将确保一致的延迟响应突发能力为代价的。

Documentation/sched-bwc.txt 的中文翻译的更多相关文章

  1. Documentation/PCI/pci-iov-howto.txt

    Chinese translated version of Documentation/PCI/pci-iov-howto.txt If you have any comment or update ...

  2. Spark官方文档 - 中文翻译

    Spark官方文档 - 中文翻译 Spark版本:1.6.0 转载请注明出处:http://www.cnblogs.com/BYRans/ 1 概述(Overview) 2 引入Spark(Linki ...

  3. Spark SQL 官方文档-中文翻译

    Spark SQL 官方文档-中文翻译 Spark版本:Spark 1.5.2 转载请注明出处:http://www.cnblogs.com/BYRans/ 1 概述(Overview) 2 Data ...

  4. Objective-C 编程艺术 (Zen and the Art of the Objective-C Craftsmanship 中文翻译)

    # 禅与 Objective-C 编程艺术 (Zen and the Art of the Objective-C Craftsmanship 中文翻译) - 原文 <https://githu ...

  5. 中文翻译:pjsip教程(一)之PJNATH简介

    在学习pjsip的过程中,发现只是单单的阅读英文官方文档,对于里边概念的理解还是不够透彻,并且苦于pjsip没有发现全一点的中文版本,所以想尽自己所能为建设和谐社会而贡献一份力量,文中定会有所疏漏,希 ...

  6. [资料] Apache2 的 httpd.conf 经典中文翻译

    [i=s] 本帖最后由 www.PHP888.com 于 2009-5-22 13:40 编辑 [/i] # 基于 NCSA 服务的配置文件. # #这是Apache服务器主要配置文件. #它包含服务 ...

  7. Next.js v4.1.4 文档中文翻译【转载】

    最近想稍稍看下 React的 SSR框架 Next.js,因为不想看二手资料, 所以自己跑到 Github上看,Next.js的文档是英文的,看倒是大概也能看得懂, 但有些地方不太确定,而且英文看着毕 ...

  8. python wsgi PEP333 中文翻译

    PEP 333 中文翻译 首先说明一下,本人不是专门翻译的,英文水平也不敢拿来献丑.只是这是两年前用python的时候为了自己学习方便而翻译的,记录着笔记自己看看而已.最近翻出来看看觉得还是放出来吧. ...

  9. 《Entity Framework 6 Recipes》中文翻译系列 目录篇 -持续更新

    为了方便大家的阅读和学习,也是响应网友的建议,在这里为这个系列做一个目录.在目录开始这前,我先来回答之前遇到的几个问题. 1.为什么要学习EF? 这个问题很简单,项目需要.这不像学校,没人强迫你学习! ...

随机推荐

  1. 1.1GTK+ 的简单程序HelloWorld

    1.1GTK+ 的简单程序HelloWorld 编译执行如图所看到的:

  2. mybatis 与 ehcache 整合[转]

    1.简介 MyBatis 是支持普通SQL 查询,存储过程和高级映射的优秀持久层框架.MyBatis 消除了几乎所有的JDBC 代码和参数的手工设置以及结果集的检索. Ehcache 是现在最流行的纯 ...

  3. VMware于CentOS网络设置

    VMware于CentOS网络设置 底: 笔记本电脑有两块网卡: 1. 网卡连接公司内网,仅仅配置了内网ip和子网掩码. 2. 无线网卡.连接4g无线路由器.dhcp自己主动配置. 问题: 在VMwa ...

  4. 汉诺塔III 递推题

    题目描述: 约19世纪末,在欧州的商店中出售一种智力玩具,在一块铜板上有三根杆,最左边的杆上自上而下.由小到大顺序串着由64个圆盘构成的塔.目的是将最左边杆上的盘全部移到右边的杆上,条件是一次只能移动 ...

  5. 案例:java中的基本排序

    //冒泡排序 import java.util.Arrays; public class ForTest{ public static void main(String args[]){ int[] ...

  6. .net邮件发送实例 邮件内容为网页模板

    .net邮件发送实例 邮件内容为网页模板 2009-07-03 09:31:01|  分类: .NET|字号 订阅      Encoding encoding = Encoding.GetEncod ...

  7. PHP 网页爬虫

    只能爬一个页面 <?php function get_urls($url){ $url_array=array(); $the_first_content=file_get_contents($ ...

  8. SQL中 patindex函数的用法

    语法格式:PATINDEX ( '%pattern%' , expression ) 返回pattern字符串在表达式expression里第一次出现的位置,起始值从1开始算. pattern字符串在 ...

  9. c - 递归年龄

    /* 题目:有 5 个人坐在一起,问第五个人多少岁?他说比第 4 个人大 2 岁.问第 4 个人岁数,他说比第3 个人大 2 岁.问第三个人,又说比第 2 人大两.问第 2 个人,说比第一个人大两岁. ...

  10. struts2与spring整合问题,访问struts2链接时,spring会负责创建Action

    每次访问一次链接,spring会创建一个对象,并将链接所带的参数注入到Action的变量中(如何做到的呐) 因为: struts2的action每次访问都重新创建一个对象,那spring的ioc是怎么 ...