Sunday 27 September 2015

The case for AWS T2 instances

I love AWS EC2 T2 instances for the the right workload. They provide high performance and low cost...they are ideal for workloads that burst and on a 24 hour aggregate use small amount of CPU utilisation:
What is surprising is that T2 instances can offer far higher performance than other low cost instances with fixed CPU performance. 

Here is list of low cost AWS EC2 instances and their performance:
Instance TypevCPUsMemoryLinux Cost
(Monthly)
Windows Cost
 (Monthly)
CoresCorePerfMemory (MB)Network
(Mbits/sec)
Storage Bandwidth
(MB/sec)
Geekbench3
Single 
Geekbench3
Multi
CommentsURL
t2.micro1 cores1.0 GB14.414.410.1102430062.52549254132 bit https://browser.primatelabs.com/geekbench3/2801596
t1.micro1 cores0.613 GB14.414.411614.420062.51046132564 bithttps://browser.primatelabs.com/geekbench3/546695
t2.small1 cores2.0 GB28.83610.2204830062.52477246664 bithttps://s3.amazonaws.com/cloudharmony/geekbench3_3_1_6/aws:ec2/t2.small/ebs/ap-southeast-2/2014-11-12/2627/368973-1/geekbench.html
m1.small1 cores1.7 GB41.7666.96111740.830062.577176364 bithttp://browser.primatelabs.com/geekbench3/523946
t2.medium2 cores4.0 GB57.67220.4409630062.52626512964 bithttps://browser.primatelabs.com/user/zorang
m3.medium1 cores3.75 GB66.96112.3211384030062.51333129932 bit https://browser.primatelabs.com/user/zorang
m1.medium1 cores3.75 GB84.24134.6411384030062.51472146732 bit http://browser.primatelabs.com/geekbench3/510203
c3.large2 cores3.75 GB95.04171.3622384050062.52527301632 bit https://browser.primatelabs.com/geekbench3/641598
c4.large2 cores3.75 GB103.68175.68223840100062.53326391164 bithttps://browser.primatelabs.com/user/zorang
t2.large2 cores8.0 GB115.2136.820.6819230062.52986567664 bithttp://browser.primatelabs.com/geekbench3/2883478
c1.medium2 cores1.7 GB118.08191.52221740.830062.53307?Geekbench2http://browser.primatelabs.com/geekbench2/591043
m4.large2 cores8.0 GB127.44218.16228192100056.252869334664 bithttp://browser.primatelabs.com/geekbench3/2883591
m3.large2 cores7.5 GB133.92224.6422768030062.52579303464 bithttps://browser.primatelabs.com/user/zorang
r3.large2 cores15.25 GB151.2232.562215616100062.52675314364 bithttp://browser.primatelabs.com/geekbench3/2883489
m1.large2 cores7.5 GB167.76268.5622768030062.51592310664 bithttps://gist.github.com/16hands/078800d5481e1d651828
c3.xlarge4 cores7.5 GB190.8343.4444768050062.52866662064 bithttps://browser.primatelabs.com/user/zorang
c4.xlarge4 cores7.5 GB208.08351.36447680100093.753402780764 bithttps://s3.amazonaws.com/cloudharmony/geekbench3_3_1_6/aws:ec2/c4.xlarge/ebs-500piops/eu-central-1/2015-04-16/4503/522092-10/geekbench.html
m2.xlarge2 cores17.1 GB213.12267.122217510.430062.54485?Geekbench2https://browser.primatelabs.com/user/zorang
m4.xlarge4 cores16.0 GB254.88436.324416384100093.752772610364 bithttp://browser.primatelabs.com/geekbench3/2883604
m3.xlarge4 cores15.0 GB267.84449.28441536030062.52237489432 bithttps://browser.primatelabs.com/geekbench3/542565
r3.xlarge4 cores30.5 GB302.4465.124431232100062.52542595864 bithttp://browser.primatelabs.com/geekbench3/2883495
m1.xlarge4 cores15.0 GB336.24537.84441536030062.51560542864 bithttps://gist.github.com/16hands/d4cf31011ce25b557701
c3.2xlarge8 cores15.0 GB380.88686.168815360100012526071132764 bithttp://browser.primatelabs.com/geekbench3/332304
c4.2xlarge8 cores15.0 GB416.16702.728815360100012532551340864 bithttp://browser.primatelabs.com/geekbench3/2258774
m2.2xlarge4 cores34.2 GB426.24534.244435020.830062.56563?Geekbench2http://browser.primatelabs.com/geekbench2/1830609

When T2 instances have CPUCredits their performance is as as good as instances that cost 5x as much, yet how is their performance when they run out of CPUCredits? I ran a simple benchmark on T2.medium instance where I ran Geekbench 3 continually in a loop obtained and the following results:
- Initially with CPUCredits: http://browser.primatelabs.com/geekbench3/3586907
        
- After CPUCredits depleted the t2.medium instance receives 20% for both CPU cores (40% in total) and still had better performance than m1.small: http://browser.primatelabs.com/geekbench3/3588122
         

Here is Cloudwatch graph with CPUUtilization and CPUCreditBalance during the benchmark:


Here are all Geekbench results during the benchmark:
[ec2-user@ip-172-30-0-183 Geekbench-3.1.2-Linux]$ grep 'Geekbench Score' geekbench.out
  Geekbench Score            2641   5179
  Geekbench Score            2636   5179
  Geekbench Score            2634   5174
  Geekbench Score            2629   5162
  Geekbench Score            2631   5165
  Geekbench Score            2637   5178
  Geekbench Score            2639   5193
  Geekbench Score            2641   5187
  Geekbench Score            2640   5180
  Geekbench Score            2633   5176
  Geekbench Score            2640   5190
  Geekbench Score            2643   5177
  Geekbench Score            2641   5182
  Geekbench Score            2641   5175
  Geekbench Score            2641   5184
  Geekbench Score            2638   5177
  Geekbench Score            2641   5185
  Geekbench Score            2638   5187
  Geekbench Score            2641   5176
  Geekbench Score            2641   5184
  Geekbench Score            2645   5190
  Geekbench Score            2646   5191
  Geekbench Score            2639   5179
  Geekbench Score            2640   5184
  Geekbench Score            2639   5171
  Geekbench Score            2633   5174
  Geekbench Score            2636   5171
  Geekbench Score            2642   5167
  Geekbench Score            2642   5032
  Geekbench Score            2636   4962
  Geekbench Score            2636   4977
  Geekbench Score            2634   4765
  Geekbench Score            2638   4322
  Geekbench Score            2638   4316
  Geekbench Score            2526   3845
  Geekbench Score            2059   2108
  Geekbench Score            1686   1715
  Geekbench Score            1052   1036
  Geekbench Score            1090   1095
  Geekbench Score            1100   1107
  Geekbench Score            1047   1035
  Geekbench Score            1084   1107
  Geekbench Score            1096   1099
[ec2-user@ip-172-30-0-183 Geekbench-3.1.2-Linux]$

Hence even when the instance ran out of CPUCredits at the worst performance it received a Geekbench result of 1036 for multi-core score, easily beating m1.small instance which has a multi-core score of 763. As many applications are not busy 24 hours a day they would potentially be a good fit for EC2 T2 instances as long as on the 24 hour aggregate the application requires less CPU resources than T2 base performance. If it does it can perform very well even outperforming more expensive instances.

Here is a simple example where T2 instance could be suitable:
- 8 hours with CPU peaks of up to 80%, yet averaging during these 8 hours at 40%
- 16 hours with CPU peaks of up to 100%, yet averaging during these 16 hours at 15%
The average CPU utilisation over a 24 hour period is 18.75%.

Update 7/1/2017 - New T2 instances:


Here is what t2.micro instance looks like after CPU credits run run - limited to 10%:

No comments:

Post a Comment