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 vCPUsTheory: 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:
vCPU | RAM (GB) | Events per second |
---|---|---|
1 | 2 | 342 (note that one trial returned 353 and one returned 331) |
2 | 4 | 353 |
4 | 8 | 354 |
The Dockerfile to test this is here:
Performance with respect to a t2.micro
Section titled Performance with respect to a t2.microIn 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 9.30/month.