Optimizing your AWS Infrastructure for Sustainability, Part III: Networking
AWS Architecture BlogOptimizing your AWS Infrastructure for Sustainability, Part III: Networkingby Katja Philipp, Aleena Yunus, Otis Antoniou, and Ceren Tahtasiz | on25 OCT 2021| inAmazon CloudFront,Amazon EC2,Amazon Simple Storage Service (S3),Amazon VPC,AWS Trusted Advisor,Sustainability|Permalink|ShareInPart I: ComputeandPart II: Storageof this series, we introduced strategies to optimize the compute and storage layer of your AWS architecture for sustainability.This blog post focuses on the network layer of your AWS infrastructure and proposes concepts to optimize your network utilization.Optimizing the networking layer of your AWS infrastructureWhen you make your applications available to more customers, the packets that travel across the network will increase. Similarly, the larger the size of data, as well as the more distance a packet has to travel, the more resources are required to transmit it. With growing number of application users, optimizing network traffic can ensure that network resource consumption is not growing linearly.The recommendations in the following sections will help you use your resources more efficiently for the network layer of your workload.Reducing the network traveled per requestReducing the data sent over the network and optimizing the path a packet takes will result in a more efficient data transfer. The following table provides metrics related to some AWS services that can help you find potential network optimization opportunities.ServiceMetric/CheckSourceAmazon CloudFrontCache hit rateViewing CloudFront and Lambda@Edge metricsAWS Trusted Advisor check referenceAmazon Simple Storage Service (Amazon S3)Data transferred in/out of a bucketMetrics and dimensionsAWS Trusted Advisor check referenceAmazon Elastic Compute Cloud (Amazon EC2)NetworkPacketsIn/NetworkPacketsOutList the available CloudWatch metrics for your instancesAWS Trusted AdvisorCloudFront Content Delivery OptimizationAWS Trusted Advisor check referenceWe recommend the following concepts to optimize your network utilization.Read local, write globalThe following strategies allow users to read the data from the source closest to them; thus, fewer requests travel longer distances.If you are operating within a single AWS Region, you should choose a Region that is near the majority of your users. The further your users are away from the Region, the further data needs to travel through the global network.If your users are spread over multiple Regions, set up multiple copies of the data to reside in each Region.Amazon Relational Database Service (Amazon RDS)andAmazon Auroralet you set up cross-Region read replicas.Amazon DynamoDBglobal tables allow for fast performance and alleviate network load.Use a content delivery networkContent delivery networks (CDNs) bring your data closer to the end user. When requested, they cache static content from the original server and deliver it to the user. This shortens the distance each packet has to travel.CloudFront optimizes network utilization and delivers traffic over CloudFront’s globally distributed edge network. Figure 1 shows a global user base that accesses an S3 bucket directly versus serving cached data from edge locations.Trusted Advisor includes acheckthat recommends whether you should use a CDN for your S3 buckets. It analyzes the data transferred out of your S3 bucket and flags the buckets that could benefit from a CloudFront distribution.Figure 1. Comparison of accessing an S3 bucket directly versus via a CloudFront distribution/edge locationsOptimize CloudFront cache hit ratioCloudFront caches different versions of an object depending upon the request headers (for example, language, date, or user-agent). You can further optimize your CDN distribution’s cache hit ratio (the number of times an object is served from the CDN versus from the origin) with aTrusted Advisor check. It automatically checks for headers that do not affect the object and then recommends a configuration to ignore those headers and not forward the request to the origin.Use edge-oriented servicesEdge computing brings data storage and computation closer to users. By implementing this approach, you can perform data preprocessing or run machine learning algorithms on the edge.Edge-oriented services applied on gateways or directly onto user devices reduce network traffic because data does not need to be sent back to the cloud server.One-time, low-latency tasks are a good fit for edge use cases, like when an autonomous vehicle needs to detect objects nearby. You should generally archive data that needs to be accessed by multiple parties in the cloud, but consider factors such as device hardware and privacy regulations first.CloudFront Functionscan run compute on edge locations andLambda@Edgecan generateRegional edge caches.AWS IoT Greengrassprovides edge computing for Internet of Things (IoT) devices.Reducing the size of data transmittedServe compressed filesIn addition to caching static assets, you can further optimize network utilization by serving compressed files to your users. You can configure CloudFront toautomatically compress objects, which results in faster downloads, leading to faster rendering of webpages.Enhance Amazon EC2 network performanceNetwork packets consist of data that you are sending (frame) and the processing overhead information. If you use larger packets, you can pass more data in a single packet and decrease processing overhead.Jumbo framesuse the largest permissible packet that can be passed over the connection. Keep in mind that outside a single virtual private cloud (VPC), over virtual private network (VPN) or internet gateway, traffic is limited to a lower frame regardless of using jumbo frames.Optimize APIsIf your payloads are large, consider reducing their size to reduce network traffic bycompressingyour messages for your REST API payloads. Use the right endpoint for your use case.Edge-optimized API endpointsare best suited for geographically distributed clients.Regional API endpointsare best suited for when you have a few clients with higher demands, because they can help reduce connection overhead.Caching your API responseswill reduce network traffic and enhance responsiveness.ConclusionAs your organization’s cloud adoption grows, knowing how efficient your resources are is crucial when optimizing your AWS infrastructure for environmental sustainability. Using the fewest number of resources possible and using them to their fullest will have the lowest impact on the environment.Throughout thisthree-part blog post series, we introduced you to the following architectural concepts and metrics for the compute, storage, and network layers of your AWS infrastructure.Reducing idle resources and maximizing utilizationShaping demand to existing supplyManaging your data’s lifecycleUsing different storage tiersOptimizing the path data travels through a networkReducing the size of data transmittedThis is not an exhaustive list. We hope it is a starting point for you to consider the environmental impact of your resources and how you can build your AWS infrastructure to be more efficient and sustainable. Figure 2 shows an overview of how you can monitor related metrics with CloudWatch and Trusted Advisor.Figure 2. Overview of services that integrate with CloudWatch and Trusted Advisor for monitoring metricsReady to get started?Check out theAWS Sustainabilitypage to find out more about our commitment to sustainability. It provides information about renewable energy usage, case studies on sustainability through the cloud, and more.Other blog posts in this seriesOptimizing your AWS Infrastructure for Sustainability, Part I: ComputeOptimizing your AWS Infrastructure for Sustainability, Part II: StorageRelated informationAWS Architecture Monthly magazine, Sustainability issue, August 2021TAGS:Optimizing your AWS Infrastructure for Sustainability Series,SustainabilityKatja PhilippKatja Philipp is an Associate Solutions Architect based in Munich, Germany. With a background in M. Sc. Information Systems, she joined AWS in September 2020 with the TechU Graduate program. She enables her customers in the Power & Utilities vertical with best practices around their cloud journey. Katja is passionate about sustainability and how technology can be leveraged to solve current challenges for a better future.Aleena YunusAleena Yunus is an Associate Startup Solutions Architect in DACH. She has a Masters in Computer Science majoring in distributed systems and network security. She enjoys developing, helping her customers innovate on the cloud, and apply architectural best practices. Aleena is an avid reader and her favorite author is John Steinbeck.Otis AntoniouOtis Antoniou is an Associate Solutions Architect based in London. He is part of the UK and Ireland SMB team and he enjoys helping customers innovate and solve business problems using AWS Services. Outside of work, Otis enjoys playing team sports, racket sports, and he is passionate about music.Ceren TahtasizCeren Tahtasiz is a Startup Solutions Architect based in London. She helps startups grow by understanding their goals and challenges, and guiding them on how they can get started on AWS. She’s passionate about enabling customers to launch cloud-native products that are resilient and scalable. Her core focus areas are serverless technologies and sustainability in cloud.
In Part I: Compute and Part II: Storage of this series, we introduced strategies to optimize the compute and storage layer of your AWS architecture for sustainability. This blog post focuses on the network layer of your AWS infrastructure and proposes concepts to optimize your network utilization. Optimizing the networking layer of your AWS infrastructure When you […]
Katja Philipp
Amazon CloudFront Amazon EC2 Amazon Simple Storage Service (S3) Amazon VPC AWS Trusted Advisor Sustainability