-1

I can not understand the fargate price. If we pay for what we use why we should determine task size?

per vCPU per hour   $0.04048
per GB per hour $0.004445

if we use 1 vCPU for one hour and then use 10 Vcpu for the next hour. what is the price for this scenario? in this case, what is the task size?

yasin lachini
  • 2,590
  • 3
  • 12
  • 38
  • 2
    I'm voting to close this question as off-topic because questions about product or service pricing are off topic as explained in [Are questions on prices or support of developer services on topic?](https://meta.stackoverflow.com/q/274576) and [Why can't I ask customer service-related questions?](https://meta.stackoverflow.com/q/255745). – dbc Sep 21 '20 at 17:32

1 Answers1

1

The containers and tasks themselves do not scale elastically in terms of the resources available, for this reason you have to define the resources that can be used within the task definition.

For each task that is launched in Fargate you must pay for the amount of vCPU and memory that has been allocated. For this reason a single task definition will cost the same amount for each hour that it is running (in fact you pay to the nearest second so you can pay for partial hours).

You will pay for each task for the vCPU and memory that it uses, if you wanted to add more of that task you can increase this capacity in the defined ECS Service so that multiples of the task would be running. If you wanted each task to have more resources you would create a new revision of the task definition and redefine the amount of vCPU or memory that you want to use.

If you scenario you would pay $0.04048 for the first hour, then $0.4048 in the second hour. Although you have not defined the memory you're using so this is not included in the total price.

Chris Williams
  • 23,842
  • 4
  • 14
  • 39
  • If my task size is 1 vCPU and I use half of it I pay 0.02024? – yasin lachini Aug 19 '20 at 15:51
  • 1
    That is correct, the partial units are charged the partial of the vCPU. Otherwise everyone one would always use at least 1 vCPU :) – Chris Williams Aug 19 '20 at 15:57
  • I search more and find that if If my task size is 1 vCPU and I use half of it I pay 0.04048 – yasin lachini Aug 21 '20 at 16:58
  • 1
    Right sorry I think there was some confusion on my part there for this, you pay the full vCPU that is in your task. I misread this as half a vCPU. The task is the definition of how much of these resources you use – Chris Williams Aug 21 '20 at 17:00