Amazonrds 简明教程

Amazon RDS - DB Storages

RDS 实例使用 Amazon 区块存储 (EBS) 卷来存储数据和日志。这些存储类型可以在需要时动态增加其大小。但是,基于这些存储类型相关联的数据库工作负载和价格,我们可以自定义存储需求。以下是要决定存储类型时要分析的因素。

The RDS instances use Amazon Block Storage (EBS) volumes for storing data and log. These storage types can dynamically increase their size as and when needed. But based on the database workloads and price associated with these storage types we can customize the storage need. Following are the factors to be analysed while deciding on the storage types.

  1. IOPS – It represents the number of Input Output operations performed per second. Both read and write operations are summed up for finding the IOPS value. AWS creates a report of IOPS value for every 1 minute. It can have value from 0 to tens of thousands per second.

  2. Latency – It is the number of milliseconds elapsed between the initiation of an I/O request and the completion of the I/O request. A bigger latency indicates a slower performance.

  3. Throughput – The number of bytes transferred to and from the disk every second. AWS reports the read and write throughput separately for every 1-minute interval.

  4. Queue Depth – It is the number of I/O requests waiting in the queue before they can reach the disk. AWS reports the queue depth for every 1-minute interval. Also a higher queue-depth indicates a slower storage performance.

基于上述考虑因素,aws 存储类型如下。

Based on the above considerations, the aws storage types are as below.

General Purpose SSD

这是一种经济高效的存储,在大多数常见的数据库任务中都很有用。它可以为 1 TiB 卷提供 3000 IOPS。在 3.34 TiB 大小时,性能可以提升至 10000 IOPS。

This is a cost-effective storage that is useful in most of the common database tasks. It can provide 3000 IOPS for a 1- TiB volume. In a 3.34 TiB size the performance can go up to 10000 IOPS.

I/O Credits

每 GB 的存储空间可提供 3 IOPS 作为基线性能。这意味着 100 GB 的卷可以提供 300 IOPS。但有时您可能需要更多 IOPS。在这种情况下,您需要使用在存储初始化时提供的某些 I/O 信用余额。此余额为 540 万个 I/O 信用额度,可在需要突发性能时使用。另一方面,当您使用的 IOPS 低于基线性能时,您会累积可以在未来需要突发性能时使用的信用额度。

Each GB of storage allows 3 IOPs as a base line performance. Which mean a 100 GB volume can provide 300 IOPs. But there may be scenario when you need more IOPS. In such scenario you need to use some IO credit balance which is offered when the storage is initialized. It is 5.4 million IO credits which can be used when a burstable performance need arises. On the other hand when you use less IOPS than the baseline performance, you accumulate the credits which can be used in future requirement of burstable performances.

以下是一个显示突发持续时间和信用余额之间关系的方程式。

Below is a equation which shows the relation between burst duration and Credit balance.

Burst Duration = (credit Balance) / [(burst IOPS) – 3(Storage size in GB)]

如果您的数据库需要频繁而长时间的突发性能,那么下一个存储类型将是一个较好的选择。

If your DB needs frequent and long duration burstable performance, then the next storage type will be a better choice.

Provisioned IOPS Storage

这是一种存储系统类型,可提供持续更高的性能和持续较低的延迟,非常适合 OLTP 工作负载。

This is a type of storage system that gives sustained higher performance and consistently low latency which is most suitable for OLTP workloads.

在创建数据库实例时,您需要为这种存储指定所需的 IOPS 速率和卷大小。以下图表可作为参考,用于确定预置存储所需的 IOPS 和存储。

When creating the DB instance, you specify the required IOPS rate and volume size for such storage. Below is a chart which is used for reference for deciding about the IOPS and storage needed under provisioned storage.

DB Engine

Provisioned IOPS Range

Storage Range

MariaDB

1000 to 40000

100 GB to 16 TB

SQL Server

1000 to 32000

20GB to 16 TB

MySQL / Oracle/ PostgreSQL

1000 to 40000

100GB to 16 TB

这是一种非常旧的存储技术,AWS 仅为向后兼容性维护它。其功能非常有限,如下所示。

This is a very old storage technology which is maintained by aws, only for backward compatibility. Its features are very limited which are the following.

  1. Does not support Elastic Volumes

  2. Limited to maximum size of 4 TB

  3. Limited to maximum of 1000 IOPS