Blog

EKS – best instance type to use as worker nodes optimising for price per IP address

We are playing with the new Elastic Container Service for Kubernetes from Amazon (EKS) and have found it interesting that instead of using a overlay network like we have been used to in previous Kubernetes experiments, they are assigning IP addresses to each Pod via their Elastic Network Adaptors. The plugin they use is open-sourced (amazon-vpc-cni-k8s). I like the simplicity of the idea so that network packets aren’t needlessly wrapped in an additional layer but the problem is that there is a limited number of IPs per instance and therefore it restricts the number of Pods that can be run on each node.

If running average applications, the pod limit might not be a issue because the CPU or memory would be the bottleneck but if you are running small mircroservices, or many CronJobs, the limiting factor for a node is the number of IP addresses. I did some calculations to find the best AWS instance type in terms of cheapest per IP:

API Name	Memory	    vCPUs	    Max IPs	ENIs	Cost	Cost per IP
t2.nano	    0.5 GiB	    1 vCPUs     4	    2	    0.0058	0.00145
t2.medium	4.0 GiB	    2 vCPUs     18	    3	    0.0464	0.0025777778
t2.large	8.0 GiB	    2 vCPUs     36	    3	    0.0928	0.0025777778
c5.large	4.0 GiB	    2 vCPUs	    30	    3	    0.085	0.0028333333
c5.xlarge	8.0 GiB	    4 vCPUs	    60	    4	    0.17	0.0028333333
c5.4xlarge	32  GiB	    16 vCPU     240	    8	    0.68	0.0028333333
t2.small	2.0 GiB	    1 vCPUs     8	    2	    0.023	0.002875
t2.micro	1.0 GiB	    1 vCPUs     4	    2	    0.0116	0.0029
m5.large	8.0 GiB	    2 vCPUs	    30	    3	    0.096	0.0032
m5.xlarge	16 GiB	    4 vCPUs	    60	    4	    0.192	0.0032
m5.4xlarge	64 GiB	    16 vCPUa    240	    8	    0.768	0.0032
c5d.large	4.0 GiB	    2 vCPUs	    30	    3	    0.096	0.0032
c5d.xlarge	8.0 GiB	    4 vCPUs	    60	    4	    0.192	0.0032
c5d.4xlarge	32 GiB	    16 vCPUa    240	    8	    0.768	0.0032
c4.xlarge	7.5 GiB	    4 vCPUs	    60	    4	    0.199	0.0033166667
c4.4xlarge	30.0 GiB	16 vCPUa	240	    8	    0.796	0.0033166667
m4.xlarge	16.0 GiB	4 vCPUs	    60	    4	    0.2	    0.0033333333
m4.4xlarge	64.0 GiB	16 vCPUa	240	    8	    0.8	    0.0033333333
c4.large	3.75 GiB	2 vCPUs	    30	    3	    0.1	    0.0033333333
c3.large	3.75 GiB	2 vCPUs	    30	    3	    0.105	0.0035
c3.xlarge	7.5 GiB	    4 vCPUs	    60	    4	    0.21	0.0035
c3.4xlarge	30.0 GiB	16 vCPUs	240	    8	    0.84	0.0035
m5d.large	8.0 GiB	    2 vCPUs	    30	    3	    0.113	0.0037666667
m5d.xlarge	16.0 GiB	4 vCPUs	    60	    4	    0.226	0.0037666667
m5d.4xlarge	64.0 GiB	16 vCPUs	240	    8	    0.904	0.0037666667
h1.4xlarge	64.0 GiB	16 vCPUs	240	    8	    0.936	0.0039
c5.18xlarge	144.0 GiB	72 vCPUs	750	    15	    3.06	0.00408
m2.xlarge	17.1 GiB	2 vCPUs	    60	    4	    0.245	0.0040833333
m2.2xlarge	34.2 GiB	4 vCPUs	    120	    4	    0.49	0.0040833333

This is for the Linux hourly on-demand price. I think we’re going to go with t2.large but making sure the unlimited option is set so they don’t run out of credits.

If you want this data yourself, my source was www.ec2instances.info – you can change the columns shown to relevant ones, then copy&paste the table into LibreOffice to calculate the price per IP and sort it.


21/Aug/18 – The t3 instance type was announced and it has the best cost per IP ratio.

No Comment

Post A Comment