

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 在 PCS 中 AWS 配置自定义 cgroup 设置
<a name="cgroup-custom-settings"></a>

Slurm 使用 Linux cgroup 子系统来管理和限制作业资源，包括内存、CPU 内核、设备和交换空间。 AWS PCS 允许您在集群创建或更新`SlurmConfiguration`期间通过的`CgroupCustomSettings`属性自定义集群级别的`cgroup.conf`设置。

## 配置 cgroup 设置
<a name="cgroup-custom-settings-configure"></a>

Cgroup 自定义设置可以在集群创建期间通过 AWS 控制台、CLI 或 SDK 进行配置，也可以稍后通过更新操作进行修改。

------
#### [ AWS 管理控制台 ]

在群集资源的创建或编辑页面中导航到**其他调度器设置**。

**添加新设置**

1. 选择 “**添加新设置”**。

1. 从下拉列表中选择一个**参数**名称（其中包括简短的参数描述）。

1. 提供相应的值。

**取消设置自定义设置**

1. 选择相关 parameter/value 配对旁边的 “**移除**”。

1. 创建或更新资源。

------
#### [ AWS CLI ]

要对 cgroup 设置进行编程管理，请使用创建或更新集群操作中的`CgroupCustomSettings`字段。

**Example — 在集群`ConstrainRAMSpace`上进行设置**  

```
aws pcs update-cluster --cluster-identifier {{my-cluster}} \
--slurm-configuration \
'CgroupCustomSettings=[{parameterName=ConstrainRAMSpace,parameterValue="yes"}]'
```

------

## 集群支持的 cgroup 设置
<a name="cgroup-custom-settings-cluster"></a>

集群级别支持以下自定义 cgroup 设置：
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_AllowedRAMSpace](https://slurm.schedmd.com/cgroup.conf.html#OPT_AllowedRAMSpace)
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_AllowedSwapSpace](https://slurm.schedmd.com/cgroup.conf.html#OPT_AllowedSwapSpace)
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_ConstrainCores](https://slurm.schedmd.com/cgroup.conf.html#OPT_ConstrainCores)
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_ConstrainDevices](https://slurm.schedmd.com/cgroup.conf.html#OPT_ConstrainDevices)
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_ConstrainRAMSpace](https://slurm.schedmd.com/cgroup.conf.html#OPT_ConstrainRAMSpace)
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_ConstrainSwapSpace](https://slurm.schedmd.com/cgroup.conf.html#OPT_ConstrainSwapSpace)
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_IgnoreSystemd](https://slurm.schedmd.com/cgroup.conf.html#OPT_IgnoreSystemd)
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_MaxRAMPercent](https://slurm.schedmd.com/cgroup.conf.html#OPT_MaxRAMPercent)
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_MaxSwapPercent](https://slurm.schedmd.com/cgroup.conf.html#OPT_MaxSwapPercent)
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_MinRAMSpace](https://slurm.schedmd.com/cgroup.conf.html#OPT_MinRAMSpace)
+ [https://slurm.schedmd.com/cgroup.conf.html#OPT_SignalChildrenProcesses](https://slurm.schedmd.com/cgroup.conf.html#OPT_SignalChildrenProcesses)