Compute Antipatterns
(Compiled from AWS, Azure, Google and and other community sources)
The following are antipatterns to avoid:
AWS Compute docs:
Avoid:
- In a post-migration workload, using the same compute solution that was being used on premises.
- Lacking awareness of the cloud compute solutions and how those solutions might improve your compute performance.
- Oversizing an existing compute solution to meet scaling or performance requirements, when an alternative compute solution would align to your workload characteristics more precisely.
- Using the same compute solution that was being used on premises.
- Not reviewing the compute options or instance family to match workload characteristics.
- Oversizing the compute to ensure bursting capability.
- You use multiple compute management platforms for the same workload.
- You only use manual log file searching for metrics.
- You only publish metrics to internal tools.
- You only use the default metrics recorded by your selected monitoring software.
- You only review metrics when there is an issue.
- You choose the largest instance available for all workloads.
- You standardize all instances types to one type for ease of management.
- You react to alarms by manually increasing capacity.
- You leave increased capacity after a scaling event instead of scaling back down.
- You only monitor system-level metrics to gain insight into your workload.
- You architect your compute needs for peak workload requirements.
- You oversize the compute solution to meet scaling or performance requirements when moving to a new compute solution would match your workload characteristics"
AWS Instance
Avoid:
- Overprovisioning:
- Allocating more resources (such as CPU, memory, or storage) than an instance requires can result in higher costs and reduce overall efficiency.
- Underutilization:
- Running instances with low utilization rates or keeping instances running when they are not in use can also result in higher costs and reduce overall efficiency.
- Not using Autoscaling:
- Not utilizing Autoscaling groups can result in increased operational overhead, higher costs, and reduced availability and scalability.
- Non-optimized instance types:
- Using the wrong instance type (such as using a compute-optimized instance type for memory-intensive workloads) can result in poor performance and higher costs.
- Poor security group configuration:
- Misconfigured security groups can lead to vulnerabilities and potential security breaches.
- Poorly designed or maintained AMIs:
- Inefficient or outdated AMIs can result in increased costs and reduce efficiency.
- Over-reliance on EC2 Classic:
- EC2 Classic is an older platform for EC2 instances that is being phased out. Over-reliance on this platform can lead to potential downtime and increased security risks.
- Non-optimized storage:
- Using storage that is not optimized for your workloads (such as using magnetic disks instead of SSDs for high-performance databases) can result in poor performance and higher costs.
- Not leveraging elasticity:
- Not taking advantage of EC2's ability to quickly scale up or down based on demand can result in increased costs and reduced efficiency.
- Not leveraging EC2 instance metadata:
- EC2 instance metadata can provide valuable information about an instance's configuration and environment, but not utilizing this information can result in missed opportunities for optimization and efficiency gains.
AWS Lambdas
Avoid:
- Overloading the Lambda function:
- Packing too much functionality into a single Lambda function can make it difficult to maintain and troubleshoot, and can also lead to performance issues.
- Poor error handling:
- Not handling errors properly can result in unexpected behavior and difficult debugging.
- Not optimizing memory allocation:
- Over-allocating memory can lead to higher costs, while under-allocating memory can lead to poor performance.
- Not setting proper timeouts:
- Not setting appropriate timeouts can result in longer-than-expected execution times and higher costs.
- Not using environment variables:
- Failing to utilize environment variables can make it more difficult to manage configurations and environment-specific settings.
- Not leveraging Lambda layers:
- Not taking advantage of Lambda layers can result in duplicating code and increasing the size of the deployment package, leading to slower deployment times and higher storage costs.
- Not using AWS EventBridge:
- Failing to utilize AWS EventBridge can lead to suboptimal event-driven architectures and can make it more difficult to integrate with other AWS services.
- Not properly monitoring the Lambda function:
- Failing to set up proper monitoring can make it more difficult to troubleshoot and identify performance issues.
- Not using cold starts effectively:
- Not optimizing for cold starts can result in slower execution times and higher costs.
- Not properly testing the Lambda function:
- Failing to properly test the function can lead to unexpected behavior and issues in production environments.
- Not using a centralized logging solution:
- Failing to use a centralized logging solution can make it difficult to troubleshoot issues and identify performance bottlenecks.
- Not setting appropriate concurrency limits:
- Not setting appropriate concurrency limits can result in performance issues and unexpected behavior when handling high loads.
- Not properly handling input validation:
- Failing to validate input can result in security vulnerabilities and unexpected behavior.
- Not properly handling exceptions:
- Failing to handle exceptions properly can result in unexpected behavior and make it difficult to troubleshoot issues.
- Not taking advantage of caching:
- Not leveraging caching can result in slower execution times and higher costs.
- Not using a VPC:
- Failing to use a VPC can result in security vulnerabilities and reduce overall control over network configurations.
- Not using the appropriate triggers:
- Not using the appropriate triggers for your Lambda functions can result in suboptimal event-driven architectures and unexpected behavior.