简体   繁体   English

如何减少我的 AWS RDS 实例的账单

[英]How to reduce billing on my AWS RDS instance

We currently pay somewhere between 85-100 USD on a monthly basis for RDS usage.我们目前每月为 RDS 使用费支付 85-100 美元。 But most of the times we don't access our database instances.但大多数时候我们不访问我们的数据库实例。 Is there a way to reduce the billing by bringing down the instance or go in for a shared database mode.有没有办法通过在共享数据库模式下关闭实例或 go 来减少账单。 What kind of alternatives exist?存在什么样的替代方案?

You can delete an instance at any time with DeleteDBInstance .您可以随时使用DeleteDBInstance删除实例。 By default, a final snapshot will be created.默认情况下,将创建最终快照。 Then, you can recreate it at a later time.然后,您可以稍后重新创建它。 See this FAQ .请参阅此常见问题解答 The final snapshot storage cost is $0.15 per GB-month.最终快照存储成本为每月每 GB 0.15 美元。

Even I was facing this issue.即使我也面临这个问题。 With AWS;使用AWS; RDS is much more expensive than EC2 instances. RDS 比 EC2 实例贵得多。 And database is something which needs to run for 24*7 in my case as compared to EC2 instances which can be optimized.与可以优化的 EC2 实例相比,在我的情况下,数据库需要 24*7 运行。

The way I opted for reducing my costs for RDS is go for "Reserved Instance".. Anyway RDS is something which I will always need ( until I am on AWS ).我选择降低 RDS 成本的方式是“预留实例”go。无论如何,RDS 是我永远需要的东西(直到我在 AWS 上)。 This way I could reduce my costs by around 50%.通过这种方式,我可以将成本降低 50% 左右。

There are several options you can leverage to reduce RDS costs.您可以利用多种选项来降低 RDS 成本。 You mention that you are not using your RDS instance most of the time, so that is the first obvious place to look for savings:你提到你大部分时间都没有使用你的 RDS 实例,所以这是寻找节省的第一个明显的地方:

  1. If you only use the instance for, say, 8 hours/day, 09:00 - 17:00, set up a scheduled job to shut down the instance at 17:00 and start it back up at 09:00.如果您只使用该实例,比如说,每天 8 小时,即 09:00 - 17:00,请设置一个计划作业以在 17:00 关闭实例并在 09:00 重新启动它。

  2. Look at serverless RDS instances.查看无服务器 RDS 实例。 They shut down after an idle period.他们在闲置一段时间后关闭。 You should be aware, however, that if you have monitoring hooked into your RDS instance, the monitoring will create enough workload to prevent the instance from ever going to sleep, so it is only suitable for a very narrow range of uses and needs to be considered very carefully.但是,您应该知道,如果您将监控挂接到您的 RDS 实例,监控将产生足够的工作负载以防止实例进入休眠状态,因此它仅适用于非常狭窄的用途并且需要考虑得很周到。

  3. As mentioned elsewhere in the thread, switch to an EC2 instance and manage your own database.正如线程中其他地方提到的,切换到 EC2 实例并管理您自己的数据库。 That will save you approximately half in costs compared to a similarly specced RDS instance.与类似规格的 RDS 实例相比,这将为您节省大约一半的成本。

For more finely grained savings approaches, you may want to look at this article a colleague of mine wrote on reducing RDS costs in AWS .对于更细粒度的节省方法,您可能需要查看我的一位同事撰写的关于降低 AWS 中的 RDS 成本的文章。

AWS added the ability to shut down (but not delete.) RDS instances when you are not using them, That way, you only pay for the data storage. AWS 添加了在不使用 RDS 实例时关闭(但不是删除)的功能,这样,您只需为数据存储付费。 which is much cheaper than the actual running DB.这比实际运行的数据库便宜得多。 You can use the AWS Instance Scheduler to automatically shut down RDS DBs and EC2 Instances on a scheduled basis, such as at night and on weekends in non-production environments.您可以使用AWS Instance Scheduler按计划自动关闭 RDS 数据库和 EC2 实例,例如在非生产环境中的夜间和周末。

You can find more info on this, plus other AWS cost optimization tips in the AWS Production Readiness Checklist .您可以在AWS Production Readiness Checklist中找到这方面的更多信息以及其他 AWS 成本优化技巧。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM