Skip to content

Fargate

Created: 2018-10-15 16:09:50 -0700 Modified: 2019-01-22 11:30:22 -0800

I mostly wrote notes in the ECS note here for all of this; that’s why this note is so empty. (reference)

Section titled I mostly wrote notes in the ECS note here for all of this; that’s why this note is so empty. (reference)

Fargate is part of ECS (Elastic Container Service). More specifically, it can handle the creation/destruction of VMs in EC2 so that you only have to worry about the specs that a particular set of containers requires.

The way the maximumPercent works when updating a service is that it’s the maximum number of tasks allowed on at any time (rounded down to the nearest integer since it’s specified as a percentage) (reference). For example, when I wanted a single task to be online for Verdaccio, I had the maximum percent set to 200. This allowed two tasks to exist transiently so that the old task wasn’t cleaned up until the new one was stable for long enough. This worked out to be about 5-10 minutes of having two tasks online.

Supported configurations (e.g. ¼ vCPU / 2 GB RAM) can be found here.

Fargate containers get 10 GB of disk space (reference).

The service limit is 50 tasks per region (reference).

Performance with respect to number of vCPUs

Section titled Performance with respect to number of vCPUs

Theory: having more vCPUs results in each individual vCPU being more powerful (a la Lambda performance scaling with RAM allocated)

Actuality: all vCPUs should be the same power.

dotjosh ran a sysbench test with the following results:

vCPURAM (GB)Events per second
12342 (note that one trial returned 353 and one returned 331)
24353
48354

The Dockerfile to test this is here:

FROM debian:latest
RUN apt-get update && \
apt-get -y install curl
RUN curl -s https://packagecloud.io/install/repositories/akopytov/sysbench/script.deb.sh | bash
RUN apt-get -y install sysbench git make gcc unzip wget lua5.1 lua5.1-dev && \
apt-get clean
ENTRYPOINT ["sysbench", "--test=cpu", "--cpu-max-prime=20000", "--threads=1", "run"]

Performance with respect to a t2.micro

Section titled Performance with respect to a t2.micro

In January, 2019, I ran the same Dockerfile above on a t2.micro instance that had CPU credits to burst to 100%, and I got 334.14 and 335.13 events per second, meaning the t2.micro instance is slightly less powerful than the Fargate instances.

Pricing is based on vCPU / second and GB of RAM / second (with a minimum charge of one minute).

As of 10/15/2018, this works out to about 47/monthfora1vCPU/2GBRAMmachine.EachadditionalGBofRAMisabout47/month for a 1 vCPU / 2 GB RAM machine. Each additional GB of RAM is about 9.30/month.