亚马逊 aws 指南 实战_减少您的AWS成本完整指南

宣意致
2023-12-01

亚马逊 aws 指南 实战

Do you think your cloud costs are too high? I think most businesses can find savings if they look in the right places. In this article I will provide a complete guide to reducing your AWS costs covering five different, but equally important perspectives:

您是否认为您的云成本过高? 我认为,如果选择正确的位置,大多数企业都可以节省开支。 在本文中,我将提供完整的指南来降低您的AWS成本,涵盖了五个不同但同样重要的观点:

  1. Architecture

    建筑

  2. Operations

    运作方式

  3. Pricing Models

    定价模型

  4. Cost Management

    成本管理

  5. Service Optimisation

    服务优化

This article will be somewhat long, but rather than giving you “10 tips to reduce your AWS costs”, I’ll instead provide you with a comprehensive, end-to-end guide covering every perspective that should be addressed to truly optimise your AWS cloud costs.

本文将有些冗长,但我没有为您提供“降低AWS成本的10条技巧”,而是向您提供了全面的端到端指南,涵盖了应针对如何真正优化AWS的每个方面进行探讨。云成本。

观点1:建筑 (Perspective 1: Architecture)

In this perspective, we’ll look at how to architect for improved cost efficiency.

从这个角度来看,我们将研究如何设计以提高成本效率。

选择正确的架构 (Select the right architecture)

There’s a lot of architectural styles to choose from. Carefully select the most appropriate style and don’t let emotion influence your choice. You may love the idea of microservices on Kubernetes, but there may be another architecture that’s more suitable.

有很多建筑风格可供选择。 仔细选择最合适的样式,不要让情感影响您的选择。 您可能喜欢Kubernetes上微服务的想法,但可能还有另一种更合适的架构。

选择合适的服务 (Select the right services)

As with architecture styles, there are many AWS services to choose from, and selecting the wrong one can really increase your costs. Maybe you can use Lambda instead of an EC2 instance or swap an RDS database for a DynamoDB table. Carefully compare and choose the right service for the job.

与架构样式一样,有许多AWS服务可供选择,选择错误的服务确实会增加您的成本。 也许您可以使用Lambda代替EC2实例,或者将RDS数据库交换为DynamoDB表。 仔细比较并选择适合工作的服务。

根据需求扩展应用程序 (Scale applications based on demand)

Use Auto Scaling to scale your application based on demand. Consider how you can optimise your scaling types and policies. Auto Scaling is one of the most powerful capabilities for cost control on AWS so use it whenever possible.

使用Auto Scaling可以根据需求扩展应用程序。 考虑如何优化扩展类型和策略。 Auto Scaling是AWS上成本控制最强大的功能之一,因此请尽可能使用它。

使用结构合理的框架 (Use the well-architected framework)

The AWS Well-Architected Framework (WAF) provides best practice guidance on how to properly architect AWS cloud solutions. It’s comprised of five pillars, one of which is Cost Optimisation. The guidance provided in the framework is easy to understand and very sensible. Try to implement as much of the framework as possible and consider getting a Well-Architected Review (WAR) from an AWS partner to identify any gaps.

AWS架构完善的框架(WAF)提供有关如何正确构建AWS云解决方案的最佳实践指南。 它由五个Struts组成,其中之一是成本优化。 框架中提供的指导很容易理解,也非常明智。 尝试实施尽可能多的框架,并考虑从AWS合作伙伴那里获得结构完善的审查(WAR),以找出任何差距。

避免过度的安全性或弹性 (Avoid excessive security or resilience)

I know what you’re going to say, security and resilience are important. Absolutely, but it’s important to take a balanced view of security and resilience requirements against the cost of a solution. Do you really need 5 layers of firewall appliances in front of that meme-generating web app?

我知道您要说的话,安全性和弹性非常重要。 绝对可以,但是重要的是要在解决方案成本与安全性和弹性要求之间取得平衡。 在产生模因的Web应用程序之前,您真的需要5层防火墙设备吗?

将成本效益作为架构原则 (Make cost-efficiency an architecture principle)

Is cost treated with the same priority as performance, resilience, or security? You should address cost efficiency in every architecture. At a minimum, consider including a cost forecast, elements that will influence cost and a description of how cost will be monitored and managed for every solution.

成本与性能,弹性或安全性是否具有相同的优先级? 您应该在每种架构中解决成本效益问题。 至少应考虑包括成本预测,将影响成本的要素以及对每种解决方案将如何监控和管理成本的描述。

实施有效的标签策略 (Implement an effective tag strategy)

To be blunt, you have zero chance of effectively managing your cloud costs without a good resource tagging strategy. Resource tags enable you to accurately analyse and allocate costs across business, units, environments, apps, components, etc. Spend the time to define an effective tagging strategy that makes sense then implement and enforce it.

直言不讳,如果没有良好的资源标记策略,则几乎没有机会有效管理云成本。 资源标签使您能够准确地分析和分配业务,部门,环境,应用程序,组件等方面的成本。花时间定义有效的标签策略,然后有意义地实施和实施它。

观点2:运营 (Perspective 2: Operations)

In this perspective, we’ll explore some important cost-related operational processes.

从这个角度来看,我们将探索一些与成本相关的重要运营流程。

成本优化角色和职责 (Cost optimisation roles and responsibilities)

Like any other operational process, cost optimisation needs ownership and clearly defined roles and responsibilities. Without this, it’s less likely that cost optimisation activities will be prioritised or even performed at all.

像任何其他运营流程一样,成本优化需要所有权以及明确定义的角色和职责。 没有这一点,成本优化活动将几乎不会被优先考虑甚至根本不会执行。

退款和退款 (Chargeback and showback)

Nothing makes people care about costs more than making them pay for them. Chargeback is a well-understood but rarely implemented IT financial process that allocates costs directly to a consuming business unit’s cost centre. It’s a very effective way of changing business unit’s behaviour towards cloud costs but can be tough to implement for a variety of reasons. At the very least you should have a showback system in place to report on each business unit’s cloud costs.

没有什么比让他们自己付费更能使人们关心成本了。 拒付是一个易于理解但很少实施的IT财务流程,可直接将成本分配给消费业务部门的成本中心。 这是改变业务部门对云成本的行为的非常有效的方法,但是由于多种原因可能很难实施。 至少您应该有一个Showback系统来报告每个业务部门的云成本。

成本分析和报告 (Cost analysis and reporting)

You can’t optimise your cloud costs if you don’t understand them. You should analyse and report on your cloud costs on a regular basis. You can use native or 3rd party services (described in Perspective 4 — Cost Management) for this purpose. Reports should be made easily accessible and shared widely.

如果您不了解云成本,就无法优化它们。 您应该定期分析并报告您的云成本。 为此,您可以使用本机或第三方服务(在“透视图4-成本管理”中进行了介绍)。 报告应易于访问并广泛共享。

成本和利用率监控 (Cost and utilisation monitoring)

You should be monitoring cost the same way that you monitor performance and capacity. Consider adding cost metrics to your dashboards and monitoring solution. Your operations team should watch any unexpected cost increase or decreases. Ideally, they should also be monitoring utilisation and asking questions when they see resources with low utilisation.

您应该以与监视性能和容量相同的方式监视成本。 考虑将成本指标添加到仪表板和监视解决方案。 您的运营团队应注意任何意外的成本增加或减少。 理想情况下,他们还应该监视利用率,并在看到利用率较低的资源时提出问题。

应用程序生命周期管理 (Application lifecycle management)

An Application Lifecycle Management (ALM) framework puts structure around the activities that occur over the life of an app. For cost optimisation, we’re interested in what happens at the end of this lifecycle — decommissioning. It’s common to find resources running for a retired app. If a full-blown ALM framework seems like overkill for you, make sure you at least have a process in place to remove resources that are no longer needed.

应用程序生命周期管理(ALM)框架围绕应用程序整个生命周期内发生的活动进行组织。 为了优化成本,我们对在此生命周期结束时发生的事情感兴趣-退役。 找到为退休应用运行的资源是很常见的。 如果成熟的ALM框架对您来说似乎过头了,请确保至少有一个适当的过程来删除不再需要的资源。

寻找僵尸和孤儿 (Hunt for zombies and orphans)

You should regularly hunt for zombies, idle and orphaned resources and terminate them. Several native and 3rd party services (described in Perspective 4 — Cost Management) can help identity these resources. Operations teams executing this process should be empowered to act upon their findings.

您应该定期寻找僵尸,闲置和孤立的资源并终止它们。 若干本机和第三方服务(如“透视图4-成本管理”中所述)可以帮助标识这些资源。 执行此过程的运营团队应有权根据他们的发现采取行动。

连续的提高 (Continuous improvement)

Taking an iterative, continuous improvement approach to cost optimisation can be extremely effective. Teams should be encouraged to identify and implement changes that improve cost efficiency. Improvements should be shared across teams, implemented more broadly and fed back into architecture patterns and standards.

采用迭代,持续改进的方法进行成本优化可能非常有效。 应鼓励团队确定并实施可提高成本效率的变更。 改进应在各个团队之间共享,应在更广泛的范围内实施,并反馈给体系结构模式和标准。

观点3:定价模型 (Perspective 3: Pricing Models)

In this perspective, we’ll look at a few AWS pricing models and discounts that can reduce your costs.

从这个角度来看,我们将研究一些可以降低成本的AWS定价模型和折扣。

储蓄计划 (Savings Plans)

The new kid on the AWS “get a discount for committed spend” block, Savings Plans provide a solid discount across a range of services when you commit to a minimum period of use. Savings Plans come in two flavours: Compute Savings Plans offer lower discounts (up to 66%) but are more flexible and EC2 Instance Savings Plans offer higher discounts (up to 77%) but are less flexible. Savings Plans are simpler than their predecessor, Reserved Instances, but still require some careful thought when purchasing.

当您承诺最短使用期限时,AWS上的新孩子“为承诺的支出获得折扣”框,“储蓄计划”为一系列服务提供了可观的折扣。 储蓄计划有两种形式:计算储蓄计划提供较低的折扣(最高66%),但更灵活; EC2实例储蓄计划提供较高的折扣(最高77%),但灵活性较差。 储蓄计划比其前身预留实例更简单,但是在购买时仍需要仔细考虑。

Savings Plans will apply discounts in a way that maximises savings, first within the account that owns the plan and then within other accounts in the same AWS Organisation. For this reason, you should purchase plans in your master account or an account that doesn’t contain any resources to maximise your savings.

储蓄计划将以最大程度的储蓄方式应用折扣,首先在拥有该计划的账户内,然后在同一AWS Organisation的其他账户内。 因此,您应该在主帐户或不包含任何资源的帐户中购买计划,以最大程度地节省资金。

You should purchase Savings Plans to match your minimum consistent monthly spend, giving some consideration to any forecasted increase or decrease. Buy your plans in small increments and try not to overdo it. If you’re not sure whether you will use a plan you don’t buy it. You can see savings plan utilisation, coverage and purchasing recommendations in the Cost Explorer Savings Plans console.

您应该购买储蓄计划以匹配您的每月最低稳定支出,并考虑任何预期的增加或减少。 少量购买您的计划,并尽量不要过度使用。 如果不确定是否要使用计划,则不要购买。 您可以在Cost Explorer储蓄计划控制台中查看储蓄计划的使用,覆盖范围和购买建议。

预留实例 (Reserved Instances)

Reserved Instances are more complex to manage but are still required for some services like RDS, ElastiCache and RedShift that aren’t covered by Savings Plans yet. There are a few different types of reserved instances, each with varying discount-levels, restrictions and characteristics.

预留实例的管理更加复杂,但是某些计划(如RDS,ElastiCache和RedShift)仍需要这些计划,而储蓄计划尚未涵盖这些实例。 有几种不同类型的预留实例,每种实例具有不同的折扣级别,限制和特征。

You should only purchase new Reserved Instances for resources that aren’t supported by Savings Plans yet. As with Savings Plans, purchase in increments based on your minimum consistent spend, forecast carefully and don’t overdo it.

您只应为“储蓄计划”尚不支持的资源购买新的预留实例。 与“储蓄计划”一样,请根据您的最低稳定支出逐步购买,谨慎预测并不要过度使用。

竞价型实例 (Spot Instances)

Spot Instances offer a discount if you volunteer to keep AWS’s spare compute warm and can deal with having your instance terminated. Spot Instances offer tight integration with EC2 Auto Scaling, ECS, EMR and Batch plus a slew of flexible configuration options.

如果您自愿保持AWS的备用计算温暖并可以处理终止实例的情况,竞价型实例将提供折扣。 竞价型实例提供与EC2 Auto Scaling,ECS,EMR和Batch的紧密集成,以及一系列灵活的配置选项。

Spot Instances provide a discount up to 90% off On-Demand pricing, though usually, pricing falls somewhere between On-Demand and Savings Plans pricing. You should give Spot Instances some consideration for any variable capacity or transient workloads.

竞价型实例提供按需定价最高90%的折扣,尽管通常情况下,定价介于按需定价和储蓄计划定价之间。 对于任何可变容量或临时工作负载,应考虑竞价型实例。

企业优惠计划 (Enterprise Discount Program)

AWS Enterprise Discount Program (EDP) is a private, negotiated pricing agreement between AWS and a customer. It provides a discount based on an organisation’s committed spend over a set term, for example, an 18% discount for spending $10M over 3 years. Just make sure you understand that you’re committing to that spend, because use it or not, you’ll pay that amount.

AWS Enterprise Discount Program(EDP)是AWS与客户之间的私有,经协商的定价协议。 它根据组织在一定期限内的承诺支出提供折扣,例如,在3年内花费1000万美元可享受18%的折扣。 只需确保您了解自己要承担该笔费用即可,因为无论是否使用它,您都将支付这笔款项。

资金和信贷 (Funding and Credits)

AWS offers a range of funding programs and credits either directly to customers or through an AWS partner. You should work closely with your AWS partner and/or AWS account team to find out if you might be eligible for any funding programs or credits.

AWS直接向客户或通过AWS合作伙伴提供了一系列融资计划和信贷。 您应该与您的AWS合作伙伴和/或AWS客户团队紧密合作,以了解您是否有资格获得任何资助计划或信贷。

观点4:成本管理 (Perspective 4: Cost Management)

In this perspective, we’ll explore some cost management services that can help manage your costs.

从这个角度来看,我们将探索一些可以帮助您管理成本的成本管理服务。

AWS Cost Explorer (AWS Cost Explorer)

Cost Explorer is an easy to use, free service that can help analyse and manage your AWS costs. It lets you dig into your cloud costs by account, service, tags, etc. You should use it to understand your cost analysis activities and to investigate any unusual or unexpected costs.

Cost Explorer是一项易于使用的免费服务,可以帮助您分析和管理您的AWS成本。 它使您可以按帐户,服务,标签等来挖掘云成本。您应该使用它来了解成本分析活动并调查任何异常或意外成本。

AWS成本和使用情况报告 (AWS Cost and Usage Reports)

You can get extremely detailed cost data using Cost and Usage Reports (CUR). Reports can be output to S3 or obtained using the CUR API. Reports are broken down by products, resources, usage types, operations and tags. This data can be used to perform cost analysis and reporting.

您可以使用成本和使用情况报告(CUR)获得极其详细的成本数据。 报告可以输出到S3或使用CUR API获得。 报告按产品,资源,使用类型,操作和标签细分。 该数据可用于执行成本分析和报告。

AWS预算 (AWS Budgets)

Budgets allows you to setup cost or usage budgets that, when breached or forecasted to breach, will notify you. Budgets can be configured for cost, usage, Reserved Instances and Savings Plans. They can be centralised in your AWS Organizations master account and created as code. You should be creating budgets based on your expected cost and usage profile.

预算允许您设置成本或使用预算,当预算被破坏或预计将被破坏时,这些预算将通知您。 可以为成本,使用情况,预留实例和节省计划配置预算。 它们可以集中在您的AWS Organizations主账户中,并作为代码创建。 您应该根据预期的成本和使用情况创建预算。

AWS可信顾问 (AWS Trusted Advisor)

Trusted Advisor includes cost optimisation checks. It can identify underutilised, unassociated and idle resources and provides Savings Plans and Reserved Instance recommendations. You should regularly review its findings to identify waste. Multi-account environments can use Systems Manager Explorer to get a consolidated view of findings across accounts.

Trusted Advisor包括成本优化检查。 它可以识别未充分利用的,未关联的和空闲的资源,并提供节省计划和预留实例建议。 您应定期检查其发现结果以识别浪费。 多帐户环境可以使用Systems Manager Explorer来获得跨帐户结果的合并视图。

AWS定价计算器 (AWS Pricing Calculator)

Use the Pricing Calculator when (re-)architecting your apps. Many services have complicated pricing that you may not fully appreciate until you’re stepping through the pricing calculator fields. Consider making pricing calculator estimates a key part of your architecture and design processes.

在(重新)架构应用程序时使用价格计算器。 许多服务具有复杂的定价,在您逐步浏览定价计算器字段之前,可能无法完全理解它们。 考虑使价格计算器估算成为您的体系结构和设计过程的关键部分。

AWS Compute Optimizer (AWS Compute Optimizer)

Compute Optimizer is a standalone service that can help identify underutilised instances and offer a right-sizing recommendation. It works by analysing instance specifications and performance metrics over time. It’s a free service, so you should opt-in and start reviewing your recommendations.

Compute Optimizer是一项独立的服务,可以帮助识别未充分利用的实例并提供适当大小的建议。 它通过分析实例规格和性能指标随时间变化来工作。 这是一项免费服务,因此您应该选择加入并开始查看您的建议。

第三方成本管理服务 (3rd Party Cost Management Services)

Several 3rd party services may make your cost management activities a lot easier. These services can consolidate the capabilities of AWS-native tools into a single interface. They also provide a range of additional capabilities like multi-cloud support, cost-allocation and chargeback mechanisms, unique recommendation engines, better reporting and tag governance. You should investigate whether the benefits of a cost management service might significantly outweigh the cost.

多个第三方服务可以使您的成本管理活动更加轻松。 这些服务可以将AWS本地工具的功能整合到单个界面中。 它们还提供了一系列附加功能,例如多云支持,成本分配和退款机制,独特的推荐引擎,更好的报告和标签管理。 您应该调查成本管理服务的收益是否可能大大超过成本。

透视图5:服务优化 (Perspective 5: Service Optimisation)

In this perspective, we’ll look at how to optimise the cost of some common AWS services.

从这个角度来看,我们将研究如何优化一些常见的AWS服务的成本。

尺寸正确 (Right sizing)

Applies to: Most AWS services.

适用于:大多数AWS服务。

As most services can be easily scaled up or out, there’s no reason to oversize your workloads. Base your sizing on estimates and testing and then monitor and resize if you need to. Continually review resource utilisation and right size anything that’s underutilised.

由于可以轻松扩展或扩展大多数服务,因此没有理由扩大工作量。 根据估算和测试确定规模,然后根据需要监视和调整大小。 持续检查资源利用率,并调整未充分利用的资源的大小。

自动缩放 (Auto scaling)

Applies to: EC2, ECS, DynamoDB, Aurora, RDS storage and a range of other services.

适用于: EC2,ECS,DynamoDB,Aurora,RDS存储和其他一系列服务。

Use auto scaling whenever possible. Configuring your resources to scale to meet demand will result in significantly lower costs. This is a fundamental cloud capability that you really should be using as often as possible to balance performance and cost.

尽可能使用自动缩放。 配置资源以进行扩展以满足需求将显着降低成本。 这是您实际上应该经常使用的基本云功能,以平衡性能和成本。

自动停止/启动 (Automatic stop/start)

Applies to: EC2, RDS, RedShift.

适用于: EC2,RDS,RedShift。

Consider automatically stopping instances and databases when they’re not needed. Running an on-demand instance 8 hours a day costs roughly 50% less than the same instance covered by a Savings Plan running 24 hours a day. Carefully consider whether you have applications, environments or resources that could be run on a scheduled basis.

考虑在不需要实例和数据库时自动停止它们。 每天运行8个小时的按需实例的成本比每天运行24小时的“储蓄计划”所涵盖的相同实例的成本低大约50%。 仔细考虑您是否具有可以按计划运行的应用程序,环境或资源。

软件许可 (Software licensing)

Applies to: EC2.

适用于: EC2。

Investigate whether you have unused Windows (or other) OS licenses that may be eligible for cloud use. You can then Bring Your Own License to AWS to avoid paying for AWS-provided licensing. Also, be aware of AWS Dedicated Hosts if you happen to have any legacy, cloud-unfriendly licensing that might be causing you licensing headaches.

调查您是否有未使用的Windows(或其他)操作系统许可,这些许可可能适合云使用。 然后,您可以将自己的许可带到AWS以避免支付AWS提供的许可。 另外,如果您碰巧拥有任何旧的,对云不友好的旧许可,这可能会导致您头痛,请注意AWS专用主机。

Lambda调整 (Lambda tuning)

Applies to: Lambda.

适用于: Lambda。

Lambda is a great service, truly a game changer for many applications. However, it’s not the easiest service to tune for cost efficiency. Start by making sure your app logic is sound, minimise invocations where you can and avoid having functions waiting around for things. Monitor your run durations and memory usage and tune accordingly. Lastly, if your use case doesn’t make sense for Lambda, don’t force it, EC2 isn’t that uncool and you can always impress your friends by using containers.

Lambda是一项出色的服务,真正为许多应用程序带来了改变。 但是,这并不是调整成本效率最简单的服务。 首先,请确保您的应用程序逻辑合理,在可能的地方尽量减少调用,并避免让函数等待着事情。 监视运行时间和内存使用情况并进行相应调整。 最后,如果您的用例对Lambda没有意义,请不要强行使用它,EC2并不是那么酷,您始终可以通过使用容器来打动您的朋友。

DynamoDB调整 (DynamoDB tuning)

Applies to: DynamoDB.

适用于: DynamoDB。

DynamoDB is another great service that can also be a bit more challenging to tune for cost. Start by making sure you carefully plan your primary keys and any secondary indexes to avoid excessive and difficult queries. Use provisioned capacity mode unless your use case really needs on-demand. Tune your RCU / RWU values carefully and use auto scaling to adjust these based on demand.

DynamoDB是另一项出色的服务,在调整成本方面也可能会更具挑战性。 首先,请确保您仔细计划主键和所有辅助索引,以避免过多和困难的查询。 除非您的用例确实需要按需使用,否则请使用预配置容量模式。 仔细调整您的RCU / RWU值,并使用自动缩放功能根据需要进行调整。

S3对象类(层) (S3 object classes (tiers))

Applies to: S3.

适用于: S3。

Use S3 object classes (tiers) to reduce your storage cost for infrequently accessed or archive data. If you haven’t got a good handle on your data lifecycle then consider using intelligent tiering to figure it out for you.

使用S3对象类(层)可以减少不经常访问或归档数据的存储成本。 如果您无法很好地处理数据生命周期,请考虑使用智能分层为您解决。

S3存储生命周期 (S3 storage lifecycle)

Applies to: S3.

适用于: S3。

If you have data with a predictable lifecycle then you should configure S3 storage lifecycle rules to automatically manage object storage classes and potentially delete objects when they’re no longer required.

如果您的数据具有可预测的生命周期,则应配置S3存储生命周期规则以自动管理对象存储类,并在不再需要它们时删除对象。

EBS体积类型 (EBS volume types)

Applies to: EC2/EBS.

适用于: EC2 / EBS。

Plan your EBS volume type and size carefully. You may be able to reduce your EBS storage costs by using larger General Purpose (GP2) volumes instead of smaller Provisioned IOPS (IO1) volumes. If you are feeling adventurous, you can also create RAID volumes across several GP2 volumes to get greater performance at a lower price than IO1 volumes.

仔细计划您的EBS卷类型和大小。 通过使用较大的通用(GP2)卷而不是较小的预配置IOPS(IO1)卷,您可以降低EBS存储成本。 如果您喜欢冒险,还可以跨多个GP2卷创建RAID卷,以比IO1卷更低的价格获得更高的性能。

EBS快照生命周期 (EBS snapshot lifecycle)

Applies to: EC2/EBS.

适用于: EC2 / EBS。

You should actively manage the lifecycle of EBS snapshots to ensure you’re not paying for snapshots that are no longer required. You can use Data Lifecycle Manger (DLM) to simplify and automate the management of snapshots. You can also use AWS Backup for more complex retention requirements that are difficult to achieve using snapshots directly.

您应该积极管理EBS快照的生命周期,以确保您无需为不再需要的快照付费。 您可以使用数据生命周期管理器(DLM)来简化和自动化快照管理。 您也可以使用AWS Backup满足更复杂的保留要求,而这些要求很难直接使用快照来实现。

RDS数据库引擎 (RDS database engine)

Applies to: RDS.

适用于: RDS。

Consider using Aurora, MySQL and Postgres in place of Oracle or Microsoft SQL RDS instances. There is a dramatic price difference between these different engines which may justify the cost of a DB re-platform project.

考虑使用Aurora,MySQL和Postgres代替Oracle或Microsoft SQL RDS实例。 这些不同的引擎之间存在巨大的价格差异,这可能证明数据库重新平台项目的成本是合理的。

无服务器的Aurora (Aurora serverless)

Applies to: Aurora.

适用于: Aurora。

If you have a database that only handles infrequent queries or has unpredictable load you should look at Aurora Serverless. It may provide better performance and cost for these types of database workload.

如果您的数据库仅处理很少查询或负载不可预测,则应查看Aurora Serverless。 对于这些类型的数据库工作负载,它可能会提供更好的性能和成本。

参数存储与秘密管理器 (Parameter Store vs. Secrets Manager)

Applies to: Secrets Manager, Systems Manager.

适用于: Secrets Manager,Systems Manager。

Secrets Manager is awesome, but if you don’t need secret generation, automatic-rotation or cross-account access then you should consider storing your secrets in Parameter Store which is free up to 10,000 parameters.

Secrets Manager很棒,但是如果不需要秘密生成,自动轮换或跨帐户访问,那么您应该考虑将秘密存储在Parameter Store中,该存储最多可容纳10,000个参数。

直接连接和VPN (Direct Connect and VPN)

Applies to: Direct Connect, Managed VPN.

适用于:直接连接,托管VPN。

Keep your Direct Connect and VPN connections to a minimum. Look for and terminate connections that are no longer required. Make sure that you size your Direct Connect connections appropriately.

将Direct Connect和VPN连接保持在最低限度。 查找并终止不再需要的连接。 确保适当调整Direct Connect连接的大小。

运输网关和VPC对等 (Transit Gateway and VPC Peering)

Applies to: Transit Gateway, VPC Peering.

适用于: Transit Gateway,VPC对等。

If you have many VPCs and/or Direct Connect or VPN connections, you should consider using Transit Gateway to consolidate your network connectivity and NAT gateways. This will not only reduce your costs but will also simplify your network architecture. If you only have a handful of VPCs, consider using VPC Peering instead of Transit Gateway as it will cost you less.

如果您有许多VPC和/或Direct Connect或VPN连接,则应考虑使用Transit Gateway来合并网络连接和NAT网关。 这不仅可以降低成本,而且可以简化网络架构。 如果您只有少数几个VPC,请考虑使用VPC对等而不是Transit Gateway,因为它将减少您的花费。

NAT网关和NAT实例 (NAT Gateways and NAT Instances)

Applies to: NAT Gateway, NAT Instances.

适用于: NAT网关,NAT实例。

NAT Gateways are nice and simple but can start costing a lot if you have many of them. Depending on your architecture, you might be able to reduce the number of NAT Gateways you’re running or switch to cheaper NAT Instances or even use public subnets.

NAT网关既好又简单,但是如果您有很多的话,可能会花费很多。 根据您的体系结构,您也许可以减少正在运行的NAT网关的数量,或者切换到便宜的NAT实例,甚至使用公共子网。

CloudWatch优化 (CloudWatch Optimisation)

Applies to: CloudWatch.

适用于: CloudWatch。

For CloudWatch Logs, only ingest logs that you need and configure retention settings so that you’re not indefinitely storing large volumes of logs. Disable detailed monitoring on resources when it’s not required. Clean up any unnecessary custom metrics, alarms and events.

对于CloudWatch Logs,仅摄取所需的日志并配置保留设置,这样就不会无限期地存储大量日志。 不需要时禁用对资源的详细监视。 清理所有不必要的自定义指标,警报和事件。

VPC端点 (VPC Endpoints)

Applies to: VPC.

适用于: VPC。

Gateway Endpoints provide access to S3 and DynamoDB and are free. Interface Endpoints provide access to a range of other services but are most certainly not free. A few interface endpoints aren’t a big deal, but the cost of many interface endpoints adds up quickly. You should consider centralising your Interface Endpoints using Transit Gateway or skip them altogether and use NAT Gateways or public subnets instead.

网关端点提供对S3和DynamoDB的访问,并且是免费的。 接口端点提供对一系列其他服务的访问,但肯定不是免费的。 几个接口端点没什么大不了的,但是许多接口端点的成本却Swift增加。 您应该考虑使用Transit Gateway集中接口端点,或者完全跳过它们,而改用NAT网关或公共子网。

互联网出口,跨区域和跨可用区流量 (Internet egress, cross-region and cross-AZ traffic)

Applies to: VPC.

适用于: VPC。

Network traffic costs on AWS are infamously complex. At a high-level, keep in mind that you will pay for traffic that leaves AWS (Internet egress) or goes between regions or availability zones. Plan the placement of workloads to avoid racking up large inter-region / AZ charges and do whatever you can to optimise your egress charges. You should consider using CloudFront to serve content, use Direct Connect or the Snow family for bulk data transfer, use HTTP compression and architect apps to limit unnecessary network traffic.

AWS的网络流量成本非常复杂。 从高层次上来说,请记住,您将为离开AWS(互联网出口)或在区域或可用区之间流动的流量付费。 规划工作负载的放置,以避免造成较大的区域间/可用区费用,并尽一切可能优化出口费用。 您应该考虑使用CloudFront服务内容,使用Direct Connect或Snow系列进行批量数据传输,使用HTTP压缩和架构师应用程序来限制不必要的网络流量。

结论 (Conclusion)

I hope that you’ve seen there’s a lot you can do to reduce your AWS cloud costs. Organisations are generally quite good at optimising AWS services that they’re familiar with and using flexible pricing models. However, they sometimes forget about some of the bigger picture things like architecture, operations, and cost management services. Try not to neglect any of these perspectives as you’ll be leaving money on the table.

我希望您已经看到可以做很多事情来降低AWS云成本。 组织通常非常擅长优化他们熟悉的AWS服务并使用灵活的定价模型。 但是,他们有时会忘记一些更全面的信息,例如体系结构,运营和成本管理服务。 尽量不要忽略这些观点中的任何一个,因为您会浪费金钱。

Cost optimisation isn’t easy, and it’s a job that’s never done. You’ll become more successful at cost optimisation the more you do it. You don’t need to go it alone, reach out for help if you need to, as AWS and AWS partners both want you to get maximum value out of the AWS cloud.

成本优化并非易事,这是从未完成的工作。 您做得越多,您将在成本优化方面变得更加成功。 您无需孤身一人,如果需要,可以寻求帮助,因为AWS和AWS合作伙伴都希望您从AWS云中获得最大价值。

翻译自: https://medium.com/slalom-technology/reduce-your-aws-costs-the-complete-guide-a0b47b78a421

亚马逊 aws 指南 实战

 类似资料: