AWS ParallelCluster 3.6.0 で追加された新機能を個別に確認します。本ブログではヘッドノードの CloudWatch Agent によりメモリ使用率と、ディスク使用率を取得されるようになったアップデートを確認します。
確認結果
- ヘッドノードの EC2 インスタンスのメモリ使用率と、ディスク使用率を CloudWatch Agent で追加取得
- コンピュートノードは非対応なので注意
- CloudWatch Agent による追加メトリクスの取得間隔は60秒
- クラスターの CloudWatch ダッシュボードに追加メトリクスのグラフが追加
検証環境
- AWS ParallelCluster のバージョンは
3.6.0
を使用 - OS は
RHEL8
を使用
検証用に構築したクラスターのコンフィグを参考までに載せておきます。
折りたたみ
Region: ap-northeast-1
Image:
Os: rhel8
Tags:
- Key: Name
Value: ParallelCluster360
# ----------------------------------------------------------------
# Head Node Settings
# ----------------------------------------------------------------
HeadNode:
InstanceType: t3.micro
Networking:
ElasticIp: false
SubnetId: subnet-035be95eeaa091603
Ssh:
KeyName: sandbox-key
LocalStorage:
RootVolume:
Size: 35
Encrypted: true
VolumeType: gp3
Iops: 3000
Throughput: 125
Iam:
AdditionalIamPolicies:
- Policy: arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
S3Access:
- BucketName: hpc-dev-postinstall-files
EnableWriteAccess: false
# ----------------------------------------------------------------
# Compute Node Settings
# ----------------------------------------------------------------
Scheduling:
Scheduler: slurm
SlurmSettings:
ScaledownIdletime: 5
SlurmQueues:
# ------ Compute 1 ------
- Name: queue1
ComputeResources:
- Name: queue1
Instances:
- InstanceType: c6i.large
MinCount: 0
MaxCount: 10
DisableSimultaneousMultithreading: true
ComputeSettings:
LocalStorage:
RootVolume:
Size: 35
Encrypted: true
VolumeType: gp3
Iops: 3000
Throughput: 125
CapacityType: SPOT
AllocationStrategy: lowest-price
Networking:
SubnetIds:
- subnet-035be95eeaa091603
PlacementGroup:
Enabled: true
Iam:
AdditionalIamPolicies:
- Policy: arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
S3Access:
- BucketName: hpc-dev-postinstall-files
EnableWriteAccess: false
# ----------------------------------------------------------------
# Shared Storage Settings
# ----------------------------------------------------------------
SharedStorage:
- MountDir: /mnt/efs-1zone
Name: efs-1zone
StorageType: Efs
EfsSettings:
FileSystemId: fs-0f1158ade79354809
# ----------------------------------------------------------------
# Other Settings
# ----------------------------------------------------------------
Monitoring:
Logs:
CloudWatch:
Enabled: true
# RetentionInDays: 30
DeletionPolicy: "Delete"
Dashboards:
CloudWatch:
Enabled: true
DetailedMonitoring: true
CloudWatch のメトリクスを確認
コンピュートノードのメトリクス
CloudWathc のメトリクスからコンピュートノードのインスタンス ID で検索しました。本件のアップデートはコンピュートノードは対象ではないためとくに変化はありませんでした。
デフォルトで取得できている EC2 の標準メトリクスは通常の EC2 インスタンスと変わりはありません。
List the available CloudWatch metrics for your instances - Amazon Elastic Compute Cloud
ヘッドノードのメトリクス
CloudWathc のメトリクスからヘッドノードのインスタンス ID で検索しました。CloudWatch Agent で取得しているメトリクスがカスタム名前空間に追加されています。
メモリ使用率
CloudWatch Agent がないと確認できないメモリ使用率をデフォルトで取得できています。
5分間隔のグラフで表示してみました。
ディスク使用率
ルートと、デバイス名で2つメトリクスを取得していました。
値を確認してみると同じ値が記録されていました。ヘッドノードにルートの EBS が1つアタッチされた構成ですと違いがわかりませんでした。
CloudWatch Agent の設定内容確認
ヘッドノードに仕込まれている CloudWatch Agent の設定内容を確認します。ディスク使用率の設定をみると単純にルートを確認しているだけでした。メモリも同様です。設定を確認してわかったことはメトリクスの取得間隔が60秒でしたので細かい粒度でメトリクスを確認できたことでした。
/opt/aws/amazon-cloudwatch-agent/etc/amazon-cloudwatch-agent.toml
[agent]
collection_jitter = "0s"
debug = false
flush_interval = "1s"
flush_jitter = "0s"
hostname = ""
interval = "60s"
logfile = "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log"
logtarget = "lumberjack"
metric_batch_size = 1000
metric_buffer_limit = 10000
omit_hostname = false
precision = ""
quiet = false
round_interval = false
[inputs]
[[inputs.disk]]
fieldpass = ["used_percent"]
interval = "60s"
mount_points = ["/"]
tagexclude = ["mode"]
[inputs.disk.tags]
metricPath = "metrics"
[[inputs.logfile]]
destination = "cloudwatchlogs"
file_state_folder = "/opt/aws/amazon-cloudwatch-agent/logs/state"
[[inputs.logfile.file_config]]
file_path = "/var/log/messages"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.system-messages"
pipe = false
retention_in_days = -1
timestamp_layout = "Jan 2 15:04:05"
timestamp_regex = "(\\w{3} \\s{0,1}\\d{1,2} \\d{2}:\\d{2}:\\d{2})"
[[inputs.logfile.file_config]]
file_path = "/var/log/cfn-init.log"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.cfn-init"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02 15:04:05,.000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/chef-client.log"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.chef-client"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02 15:04:05,.000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/cloud-init.log"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.cloud-init"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02 15:04:05,.000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/supervisord.log"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.supervisord"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02 15:04:05,.000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/parallelcluster/clustermgtd"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.clustermgtd"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02 15:04:05,.000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/parallelcluster/clustermgtd.events"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.clustermgtd_events"
pipe = false
retention_in_days = -1
[[inputs.logfile.file_config]]
file_path = "/var/log/parallelcluster/slurm_resume.events"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.slurm_resume_events"
pipe = false
retention_in_days = -1
[[inputs.logfile.file_config]]
file_path = "/var/log/parallelcluster/compute_console_output.log"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.compute_console_output"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02 15:04:05,.000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/parallelcluster/slurm_resume.log"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.slurm_resume"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02 15:04:05,.000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/parallelcluster/slurm_suspend.log"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.slurm_suspend"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02 15:04:05,.000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/parallelcluster/slurm_fleet_status_manager.log"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.slurm_fleet_status_manager"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02 15:04:05,.000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/slurmctld.log"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.slurmctld"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02T15:04:05..000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/slurmdbd.log"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.slurmdbd"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02T15:04:05..000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.(\\d{1,9}))"
[[inputs.logfile.file_config]]
file_path = "/var/log/parallelcluster/clusterstatusmgtd"
from_beginning = true
log_group_name = "/aws/parallelcluster/ParallelCluster-v360-202305230801"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.clusterstatusmgtd"
pipe = false
retention_in_days = -1
timestamp_layout = "2006-01-02 15:04:05,.000"
timestamp_regex = "(\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2},(\\d{1,9}))"
[inputs.logfile.tags]
metricPath = "logs"
[[inputs.mem]]
fieldpass = ["used_percent"]
interval = "60s"
[inputs.mem.tags]
metricPath = "metrics"
[outputs]
[[outputs.cloudwatch]]
force_flush_interval = "60s"
namespace = "CWAgent"
region = "ap-northeast-1"
rollup_dimensions = [["InstanceId", "path"]]
tagexclude = ["host", "metricPath"]
[outputs.cloudwatch.tagpass]
metricPath = ["metrics"]
[[outputs.cloudwatchlogs]]
force_flush_interval = "5s"
log_stream_name = "ip-10-0-1-30.i-0499121a34c2ccf45.default-log-stream"
region = "ap-northeast-1"
tagexclude = ["metricPath"]
[outputs.cloudwatchlogs.tagpass]
metricPath = ["logs"]
[processors]
[[processors.ec2tagger]]
ec2_metadata_tags = ["InstanceId"]
refresh_interval_seconds = "0s"
[processors.ec2tagger.tagpass]
metricPath = ["metrics"]
メモリ使用率を改めて確認しました。たしかに1分間隔でメトリクスが記録されていました。
ちなみにデフォルトで取得している EC2 の標準メトリクスは詳細モニタリングが有効ではないため5分間間隔です。
補足
ParallelCluster 3.6.0 のアップデート内容に詳細モニタリングの有効化があるのですが適用範囲はコンピュートノードのみです。
CloudWatch ダッシュボードの表示確認
アップデートのアナウンスどおり、ダッシュボードにメモリ使用率とディスク使用率が追加されていました。せっかく取得しているメトリクスなのでダッシュボードに追加するという細かい配慮がされていて良いですね。
確認結果(再掲)
- ヘッドノードの EC2 インスタンスのメモリ使用率と、ディスク使用率を CloudWatch Agent で追加取得
- コンピュートノードは非対応なので注意
- CloudWatch Agent による追加メトリクスの取得間隔は60秒
- クラスターの CloudWatch ダッシュボードに追加メトリクスのグラフが追加
おわりに
コンピュートノードはカスタムスクリプトで後付で CloudWatch Agent の設定か、ゴールデン AMI を作成しないといけなく手間なので、コンピュートノードにもメモリ使用率のメトリクスがデフォルトで取得に期待です。メモリ使用率をみてキューのインスタンスタイプを選定をできるようになればチューニングがはかどります。