aws rds监控慢sql
This article explores estimating the AWS RDS SQL Server cost so that you can plan resources accordingly.
本文探讨了估算AWS RDS SQL Server成本的方法,以便您可以相应地计划资源。
介绍 (Introduction)
Amazon is a leading cloud solution provider and provides relational database service (RDS) for various databases such as Microsoft SQL Server, Oracle, PostgreSQL, MariaDB, MySQL and Amazon Aurora. We have explored various articles for AWS RDS SQL Server on SQLShack.
亚马逊是领先的云解决方案提供商,并为各种数据库(例如Microsoft SQL Server,Oracle,PostgreSQL,MariaDB,MySQL和Amazon Aurora)提供关系数据库服务(RDS)。 我们在SQLShack上浏览了有关AWS RDS SQL Server的各种文章。
Suppose we require a new RDS instance for our usage. In the planning phase, we need to consider the compute resources, storage, usage, availability requirements for RDS. Another useful requirement is cost analysis. Amazon provides a cost-effective model for you and charges only for the hours you use the RDS service. Once you stop the RDS DB instance, it does not charge anything to you. It is always a good idea to estimate the costs of the RDS instance during planning for it.
假设我们需要一个新的RDS实例来使用。 在规划阶段,我们需要考虑RDS的计算资源,存储,使用情况和可用性要求。 另一个有用的要求是成本分析。 Amazon为您提供了一种经济高效的模型,并且仅按您使用RDS服务的小时数收费。 停止RDS数据库实例后,它不会向您收取任何费用。 在规划RDS实例的成本时,始终建议一个好主意。

We get estimate RDS instance cost in two ways:
我们通过两种方式估算RDS实例成本:
- AWS RDS console AWS RDS控制台
- Simple Monthly Calculator 简单的每月计算器
Let’s look at both ways of estimating RDS costs.
让我们看一下估算RDS成本的两种方法。
使用RDS控制台的AWS RDS SQL Server成本估算 (AWS RDS SQL Server cost estimates using RDS console)
In the article AWS RDS SQL Server – Launching a new database instance, we go through RDS instance configuration and you should go through it before reading this article.
在“ AWS RDS SQL Server –启动新数据库实例”一文中 ,我们介绍了RDS实例配置,在阅读本文之前,您应该先进行配置。
In the create database wizard, select the required database engine, edition, version, templates, storage type, allocated space and provisioned IOPS, availability & durability for viewing the estimated cost of the RDS instance.
在创建数据库向导中,选择所需的数据库引擎,版本,版本,模板,存储类型,分配的空间和预配置的IOPS,可用性和持久性,以查看RDS实例的估计成本。
Let’s examine a few RDS SQL instance configuration and their estimated costs:
让我们检查一些RDS SQL实例配置及其估计成本:
DB Engine |
Microsoft SQL Server |
Edition |
SQL Server Enterprise edition |
Templates |
Dev/test |
DB instance class |
Standard class – db.m5.xlarge 4 vCPU, 16 GiB RAM, EBS 3500 Mbps |
Storage type |
General Purpose SSD – 20 GB |
Multi-AZ Deployment |
No |
IOPS |
10000 |
数据库引擎 |
Microsoft SQL服务器 |
版 |
SQL Server企业版 |
范本 |
开发/测试 |
数据库实例类 |
标准类– db.m5.xlarge 4个vCPU,16个GiB RAM,EBS 3500 Mbps |
存储类型 |
通用SSD – 20 GB |
多可用区部署 |
没有 |
IOPS |
10000 |
You can see the estimated monthly cost for the above configuration is 1707.58 USD:
您可以看到上述配置的估计每月成本为1707.58 USD:

Now, let’s change the DB instance class to db.m5.16xlarge (64 vCPU, 256 GiB RAM, EBS 10000 Mbs), and it changes AWS RDS SQL Server cost (estimated) to 27286.78 USD:
现在,让我们将数据库实例类更改为db.m5.16xlarge(64 vCPU,256 GiB RAM,EBS 10000 Mbs),并将AWS RDS SQL Server成本(估计值)更改为27286.78 USD:

In the above configuration, we used the dev template. If we change the template to production, the price will be higher, 54671.46 USD:
在以上配置中,我们使用了dev模板。 如果我们将模板更改为生产,则价格会更高,54671.46 USD:

In the above estimates, you will be charged for Multi-AZ standby instance. By default, if we use the production template, AWS recommends multi-AZ deployments for high availability purposes and enables it automatically for you. It also charges for the provisioned IOPS in the production template configuration.
在上述估算中,您需要为多可用区备用实例支付费用。 默认情况下,如果我们使用生产模板,则AWS建议出于高可用性目的进行多可用区部署,并自动为您启用它。 它还对生产模板配置中的预配置IOPS收费。
In the production instance, you will need a bigger storage size as well. The above estimates are for the 20 GiB storage that is not suitable for the production instance. Now, modify the required storage to 10000 GiB and storage prices increases as shown below. It charges 1280 USD for the 10000 GiB storage for the RDS instance:
在生产实例中,您还将需要更大的存储空间。 以上估计是针对不适合生产实例的20 GiB存储的。 现在,将所需的存储空间修改为10000 GiB,存储空间价格将增加,如下所示。 对于RDS实例的10000 GiB存储,它将收取1280 USD:

We should plan for the required IOPS for the RDS instance to get better IO throughput. The following estimates are for the 20000 IOPS, while the rest of the configuration remains the same. It is charged 2000 USD for the provisioned IOPS:
我们应该为RDS实例规划所需的IOPS,以获得更好的IO吞吐量。 以下估算值适用于20000 IOPS,其余配置保持不变。 预置的IOPS收费2000美元:

In this method, we estimate an RDS instance cost for an individual instance, and you need access to the AWS console.
在这种方法中,我们估计单个实例的RDS实例成本,并且您需要访问AWS控制台。
适用于AWS RDS SQL Server的AWS简单每月计算器 (AWS Simple Monthly Calculator for AWS RDS SQL Server cost)
Suppose you do not have access to the AWS console, and you are considering the cost of managed database instances for various cloud solution providers. In this case, the AWS Simple Monthly Calculator comes in handy.
假设您无权访问AWS控制台,并且正在考虑各种云解决方案提供商的托管数据库实例的成本。 在这种情况下,AWS简单月度计算器会派上用场。
You do not need access to the AWS console for using this tool. It is a web-based tool in which you can enter your requirements, and you get monthly estimates for the RDS resources.
您无需访问AWS控制台即可使用此工具。 它是一个基于Web的工具,您可以在其中输入需求,并且可以每月获取RDS资源的估算值。
In the web browser, open Simple monthly calculator:
在网络浏览器中,打开“ 简单的每月计算器” :
In the left-hand menu, the AWS services are listed, such as AWS EC2 instance, Amazon RDS, Amazon cloud Watch, Amazon RedShift.
在左侧菜单中,列出了AWS服务,例如AWS EC2实例,Amazon RDS,Amazon cloud Watch,Amazon RedShift。
Click on the Amazon RDS tab to open the calculator page specific for the RDS instance. The first step is to choose the region in which you want to deploy the RDS instance:
单击Amazon RDS选项卡以打开特定于RDS实例的计算器页面。 第一步是选择要在其中部署RDS实例的区域:
The RDS instance price might differ between the regions. We will compare the price between different regions for a similar configuration later in this article.
不同地区的RDS实例价格可能有所不同。 我们将在本文后面的类似配置中比较不同地区之间的价格。
Once you select the region, click on the Add New Row button to expand the configuration row:
It requires the following inputs:
它需要以下输入:
- Description: Name for the RDS instance. It does not affect to price 描述: RDS实例的名称。 不会影响价格
- DB instance: Number of the DB instances we need. Let’s say we need a single DB instance 数据库实例:我们需要的数据库实例数。 假设我们需要一个数据库实例
-
Usage: RDS instance usage in estimated hours. We can specify the usage in hours/day, hours/week, hours/month or %utilized/month basis:
使用情况 :RDS实例在估计小时内的使用情况。 我们可以按小时/天,小时/周,小时/月或%利用率/月为单位指定使用情况:
We estimated 100 hours per month usage:
我们估计每月使用100个小时:
- DB engine and license: Specifies the DB engine type and edition for it: 数据库引擎和许可证:指定数据库引擎的类型和版本:
Suppose we want SQL Server Enterprise edition for the RDS instance:
假设我们想要RDS实例SQL Server Enterprise版本:
- Class and deployment: Specifies the RDS instance class and deployment in single or multiple AZ. It provides a list of all supported instance classes. You can choose the appropriate instance for your requirements 类和部署:指定RDS实例类和单个或多个AZ中的部署。 它提供了所有支持的实例类的列表。 您可以根据需要选择合适的实例
- Storage:Specifies the storage type and its size. By default, it shows estimates for general purpose SSD with 20 GB space 存储 :指定存储类型及其大小。 默认情况下,它显示具有20 GB空间的通用SSD的估计值
- I/O: Select the provisioned IOPS for the RDS instance I / O:为RDS实例选择预配置的IOPS
As soon as you put the information for the RDS instance, it shows you AWS RDS SQL Server cost(monthly) in a new tab:
放置RDS实例的信息后,它将在新选项卡中显示AWS RDS SQL Server成本(每月):
Click on the highlighted tab(the Estimate of your monthly bill tab) to get the breakdown of the estimates:
点击突出显示的标签(您每月帐单的估算值标签)以获取估算明细:
Now suppose we require 5 instances of RDS instances with similar configuration. Specify the number of instances in the DB instances tab, and you get the estimated price as shown below:
现在假设我们需要5个具有类似配置的RDS实例。 在“数据库实例”选项卡中指定实例数,您将获得估计价格,如下所示:
You can see a breakdown of the total costs:
您可以查看总费用明细:
In any organization, we need multiple database environments such as production, development and staging. Each environment might differ in terms of computing resources as well as storage requirements. For example, a production instance has higher compute resources than other environments.
在任何组织中,我们都需要多个数据库环境,例如生产,开发和登台。 每个环境在计算资源和存储要求方面可能有所不同。 例如,生产实例比其他环境具有更高的计算资源。
We can calculate the total estimated cost of the RDS infrastructure using this simple monthly calculator at a single place. In the following table, we have calculated an estimated price for the 5 production, 2 development and 2 staging RDS instances.
我们可以在一个地方使用这个简单的每月计算器来计算RDS基础架构的总估算成本。 在下表中,我们计算了5个生产,2个开发和2个暂存RDS实例的估计价格。
Environment |
DB instances count |
Usage |
DB Engine |
Instance type |
Storage |
IOPS |
Production |
5 |
500 hours per month |
SQL Server Enterprise edition |
Db.r3.2xLarge with Multi-AZ configuration |
100 GB provisioned |
1000 |
Development |
2 |
4 hours per day |
SQL Server Standard edition |
Db.m1.large with single-AZ configuration |
General purpose 50 GB |
0 |
Staging |
2 |
4 hours per day |
SQL Server Express edition |
Db.t3.medium with single-AZ configuration |
General-purpose 50 GB |
0 |
环境 |
数据库实例数 |
用法 |
数据库引擎 |
实例类型 |
存储 |
IOPS |
生产 |
5 |
每月500小时 |
SQL Server企业版 |
具有多可用区配置的db.r3.2xLarge |
已配置100 GB |
1000 |
发展历程 |
2 |
每天4小时 |
SQL Server标准版 |
具有单可用区配置的db.m1.large |
通用50 GB |
0 |
分期 |
2 |
每天4小时 |
SQL Server Express版本 |
具有单可用区配置的db.t3.medium |
通用50 GB |
0 |
We have AWS RDS SQL Server cost of $28214.21 for all RDS instances:
所有RDS实例的AWS RDS SQL Server成本为$ 28214.21:
Click on the Estimated bill tab to get bill breakdown. However, it does not show price for an individual RDS instance:
单击“估计账单”选项卡以获取账单明细。 但是,它不显示单个RDS实例的价格:
AWS RDS SQL Server对AWS区域的成本依赖性 (AWS RDS SQL Server cost dependency on the AWS region)
As highlighted earlier, AWS costs vary in different regions. For a similar RDS instance configuration, US East (N.Virginia) costs you $502.30 monthly. However, Asia Pacific(Mumbai) charges you $ 514.22. You should choose the regions appropriately or you may end up paying a higher price for a similar configuration. N in the following screenshot:
如前所述,AWS成本在不同地区有所不同。 对于类似的RDS实例配置,美国东部(弗吉尼亚北部)每月的费用为502.30美元。 但是,亚太地区(孟买)向您收取514.22美元。 您应该适当地选择区域,否则最终可能为类似的配置付出更高的价格。 N在以下屏幕截图中:
免费套餐帐户和AWS RDS SQL Server成本 (Free Tier account and AWS RDS SQL Server Cost)
AWS provides a free tier account for you to get hands-on experience on various AWS resources such as RDS. Let me summarise here the free tier benefits:
AWS提供了一个免费套餐帐户,可让您获得有关各种AWS资源(如RDS)的实践经验。 让我在这里总结免费套餐的好处:
- 750 hours free usage of AWS RDS instance with Micro class servers and SQL server express edition 750小时免费使用带有微型类服务器和SQL Server Express Edition的AWS RDS实例
- 750 hours of AWS EC2 Linux, RHEL or SLES with t2.micro class servers 带有t2.micro类服务器的750小时AWS EC2 Linux,RHEL或SLES
- 5 GB standard storage for Amazon S3 Amazon S3的5 GB标准存储
You can explore more benefits on the following link AWS free tier usage.
您可以在以下链接AWS免费套餐使用中探索更多好处。
In the following screenshot, we get an estimated monthly bill of $ 0.00 for RDS instance with SQL Server Express edition, db.t2.micro deployment and 20 GB storage:
在下面的屏幕快照中,我们估计具有SQL Server Express版本,db.t2.micro部署和20 GB存储的RDS实例的每月帐单为0.00美元:
Now, let’s say we want to use RDS instance 732 hours per month with 50 GB storage for the RDS. The free tier account provides 20 GB of storage per month. In this estimate, we get charged for the additional storage. You can see the estimated price for this RDS instance under free tier account is $3.45:
现在,假设我们要使用每月732个小时的RDS实例以及50 GB的RDS存储空间。 免费套餐帐户每月提供20 GB的存储空间。 在此估算中,我们需要为额外的存储空间付费。 您可以在免费套餐帐户下看到此RDS实例的估计价格为$ 3.45:
结论 (Conclusion)
This article is useful for estimating AWS RDS SQL Server cost of RDS SQL Server. It is always recommended to check the pricing details so you can avoid any last-minute surprise in your monthly invoice.
本文对于估算RDS SQL Server的AWS RDS SQL Server成本非常有用。 始终建议您检查价格明细,以免在月度发票中出现任何最后的意外。
翻译自: https://www.sqlshack.com/estimating-aws-rds-sql-server-costs/
aws rds监控慢sql















