0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AWS Batchで投入したジョブが開始されるまでに10分以上もかかる場合

Posted at

環境

AWS Batch
2019年10月30日、us-east-1 (N. Virginia) リージョン

症状

Desired vCPUsが0のコンピューティング環境では、キューにジョブを投入してから実際に開始されるまで10分以上かかることがよくある。

例:
StackOverflow
Reddit r/aws

Min vCPUsを1以上に設定すると、Desired vCPUsが0になることはないので、「Min vCPUsが0だと10分以上かかる」という相関関係も存在する。しかし本質はDesired vCPUsである。

分析

あなたの設定するDesired vCPUsは初期値であり、AWS Batchは直近の利用状況を見てこの値を書き換える。AWS Batch modifies this value between the minimum and maximum values, based on job queue demand.
実際に、AWSコンソールでコンピューティング環境を見ると、直近の数時間にジョブが投入されなかった環境のDesired vCPUsは0になっている。逆に、直近に何度もジョブが投入されていると0ではない。

対策

ジョブを投入するときに、コンピューティング環境のDesired vCPUsを調べる。もし0になっていたら、そのジョブのジョブ定義で要求しているvCPUsを設定する。

取得:

aws batch describe-compute-environments --compute-environment hello-batch-compute-environment

desiredvCpusに出てくる。
設定:

aws batch submit-job --job-name hello-batch-job --job-queue hello-batch-job-queue --job-definition hello-batch-job-definition:1

もちろん実装ではboto3等を使うことになるだろう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?