Optimizing cloud-based infrastructure to get the best performance from applications running in the cloud. By supporting remote workers, migrating applications to cloud-based infrastructure lets businesses scale as demand increases.
Underutilized resources can pose the same problems as overutilized resources. Inadequate monitoring, inefficient workloads, network bottlenecks, and poorly configured resources can hinder your applications. Therefore, optimizing your infrastructure is essential.
Our goal is not to maximize resource use, but to provide the right amount of resources at the right time.
Start With Performance Monitoring
You can't optimize without measuring performance. By using monitoring services provided by your cloud provider, you can identify infrastructure bottlenecks and see where performance can improve.
Cloud providers offer a wide array of monitoring tools. These tools, such as Amazon CloudWatch, Microsoft Azure Monitor, and Google Cloud Monitoring, can track metrics such as CPU and memory usage, network activity, response times, and the health of applications and services.
Collecting data for its own sake serves no purpose. The IT team must set up the monitoring to collect data based on the performance indicators that truly matter to them. For example, workloads with consistently high CPU utilization may need additional capacity, while workloads with extremely low CPU utilization may have oversized resources.
Establishing a performance baseline for your workloads before you make changes lets you verify that what you did actually made a difference.
Rightsize Your Cloud Resources
The most common problem with cloud infrastructure is that resources are oversized and underused most of the time. Companies provision high-end virtual machines for fear they might run out of capacity in the future. In reality, most of the capacity in these large virtual machines goes unused most of the time.
Rightsizing workloads involves understanding the actual workload requirements versus the capacity provided by the resource. In many cases, virtual machines are provisioned with a large amount of processing power and memory but use only a small percentage of that capacity consistently. Moving to a smaller Virtual Machine that provides only the processing power and memory the workload needs can be highly efficient without compromising performance.
Conversely, underloading resources can also have an adverse effect, resulting in slow application responses and possible instability.
When optimizing your cloud-based IT infrastructure, regularly review your workloads to sure your infrastructure meets changing business and technical requirements.
Use Auto-Scaling to Match Demand
Traffic through your application will not be constant. Some websites have peak hours due to marketing activities; others have more traffic during the day because of the nature of the work; yet others have consistent traffic day and night. Only certain applications have high traffic volumes during business hours.
Auto-scaling is an alternative to running as much infrastructure as possible to handle peak demand. The computing resources needed to run an application can scale up and down as demand varies.
Computing resources scale up when demand is high and down when demand falls, ensuring applications run optimally without excess capacity.
Workloads with predictable patterns can scale on a schedule so extra capacity is only in place when needed. For example, during working hours, a business application may need more servers than outside working hours.
Improve Network Performance
Poor network configuration can leave even well-provisioned compute resources idle. Network configuration includes data transfer paths, latency, bandwidth, and workload geography.
IT teams can review data transfer paths, latency, bandwidth, and workload geography to assess the network performance of their cloud services. For example, a real-time web or mobile application that relies on frequent communication between different components can be seriously impacted by poor network performance.
A Content Delivery Network (CDN) will also improve application performance by distributing copies of frequently used content across a network of geographically distributed servers closer to end users. Services such as Amazon CloudFront, Azure Front Door, and Cloud CDN help developers improve the end-user experience by removing the end user's location from the equation and using cached copies of frequently used content.
You should optimize your network based on the real traffic coming through your application, rather than guessing where your users are based.
Optimize Storage and Databases
Storage to applications is like serving up food to customers in a restaurant. The speed at which you can serve up applications can be severely impacted by the type of storage or database you pick, even if you have the right amount of servers to handle traffic.
How often data is accessed, how quickly it needs to be retrieved, and how much processing is done on it are key considerations when selecting the right storage or database configuration.
Database optimization: query optimization, suitable indexing, database capacity optimization, caching. Storage performance is also very important and depends on the chosen storage and database type. Cloud providers offer different storage types with different performance characteristics.
Small configuration changes can sometimes produce significant improvements.
Use Caching Where It Makes Sense
By storing frequently accessed information in a cache, you can retrieve already processed data quickly instead of retrieving it from a database or recomputing it.
Caching database results, such as connection data, session data, frequently accessed API data, and many more things, can speed up a web application or web service significantly.
While caching can be a very powerful optimization technique, it is not a "once and done" optimization. Cached information has many different characteristics, including how long it will last, how it will be invalidated, and how users will expect it to behave.
Automate Infrastructure Management
Manual infrastructure management is inconsistent and slows down required changes. Therefore, it is important to manage your infrastructure as code. The two main tools we use to manage infrastructure as code are Terraform and AWS CloudFormation, which let us define our entire infrastructure in code and then deploy and manage it on demand and at scale.
Automation is important for managing different environment states and tracking changes.
Additionally, automating testing in those environments lets you test performance and other factors much faster.
Build for Reliability, Not Just Speed
Performance optimization should not come at the cost of reliability. For example, an application that is fast but fails under heavy traffic is not optimized.
Redundancy, health monitoring, failover, backups, and recovery are as important as performance for an optimized cloud-based application. As such, disaster recovery as a service can be part of a broader resilience strategy for applications where maintaining business continuity in a disaster is key. However, you must ensure the right level of resilience. Applications with temporary user bases do not require the same level of resilience as applications with fixed user bases, some of which are critical. For temporary user bases, development environments, and temporary applications, low resilience can even be optimal.
A development environment, for example, does not need the same reliability as a production application, such as a web shop for critical processes.
Make Optimization an Ongoing Process
Clouds change as your applications, users, and business change, and what works for you well today can become suboptimal 6 months later.
Regular optimization as part of ongoing cloud infrastructure management helps prevent your environment from becoming obsolete as your applications, users, and business continue to evolve.
This is a simple goal: sufficient infrastructure to deliver a good user experience, with no unnecessary capacity or complexity to manage.
Together, performance monitoring, rightsizing, scaling, networking, storage, and automation form the essential cornerstones of a managed, performance-oriented cloud environment.

