Choosing the appropriate amount of server capacity is critical for any business because it affects both application performance and operating costs. On the one hand, applications need enough resources to function properly, but allocating excess capacity will generate extra expenses for unutilized computing power. Figuring out the optimal balance between these two considerations is not always easy. In the first installation of this two-part article, we will discuss EC2—Amazon’s cloud-based computing service—and how to determine the best remote-computing solution for your specific needs.
EC2: Remote Computing with Scalability and FlexibilityElastic Compute Cloud, or EC2, is an AWS service that provides virtual server capacity—also known as “instances”—that is secure, resizable, and scalable. EC2 is easy to use and AWS’ pay-as-you-go pricing model makes it fairly inexpensive to start building capacity. Released in 2006, EC2 has been one of the most popular services in AWS’ product suite. At first, EC2 was offered only as a one-size-fits-all (m1.small) instance. But as time passed and needs evolved, AWS significantly expanded its EC2 offering.
Over time, the diversity of EC2 instance offerings has grown dramatically.Instance nomenclature can be a bit confusing, so let’s break down the components and explain what they mean. Take the “m4.large” instance, for example. The letter “m” indicates the instance family. Each family (m, c, t, r, etc.) is specialized for specific workloads. The number “4” refers to instance generation, with higher numbers indicating newer generations. The suffix indicates instance sizes that feature varying resource capacities. For example, the “m4.large” instance offers a 2vCPU and 8GiB memory, while the “m4.xlarge” instance consists of a 4vCPU and 16GiB memory. EC2 offers a fair degree of flexibility with instance sizes, which comes in handy when designing for different architectures. For example, deploying multiple smaller instances is useful for horizontal scaling (always recommended by AWS instead of vertical scaling) because it allows you to spread capacity over multiple Availability Zones to achieve fault tolerance and high availability.
What Computing Instance Suits You?Selecting an appropriate instance depends on the performance requirements of your application. Below are some factors to consider:
- Is your application CPU intensive? If so, how many cores does it need?
- Is the workload distributed evenly? Can you utilize burstable T2 instances?
- Does the application perform many read/writes?If so, focus on IOPS.
- How much network bandwidth is required?
- Are GPU accelerations needed?
- Only test viable instance types, don’t test all of them.
- Always make sure you are using the newest generation instances.
- During testing, always monitor Amazon CloudWatch metrics for insight into application performance. If CloudWatch doesn’t have the metric you are looking for, you can create and publish custom metrics.
- If you need full 10GBps bandwidth between instances, use placement groups.