Best practices for deploying Db2 Warehouse on Amazon Web Services (AWS)
When deploying Db2® Warehouse on Amazon Web Services (AWS), be sure to choose the correct AWS instance and storage types.
AWS instance types
AWS offers a wide range of instance types. When deploying Db2 Warehouse, choose a memory optimized instance. These instances are especially well suited and for large databases, and are designed to deliver fast performance for workloads that process large data sets in memory. It is also highly recommended that you use an EBS-optimized instance.
Storage types
AWS offers the following types of storage:- S3
- Elastic Block Storage (EBS)
- Elastic File System (EFS)
Because S3 is an object store and not a relational database, Db2 Warehouse cannot be deployed to S3.
EBS is the best choice for a Db2 Warehouse SMP deployment. Db2 Warehouse MPP can be deployed to either EFS or to a combination of EBS and EFS.
- Elastic Block Storage (EBS)
- EBS is composed of volumes of various sizes and types. Possible volume types are:
- EBS General Purpose SSD (gp2)
- Provisioned IOPS SSD (io1)
- Throughput Optimized HDD (st1)
- Cold HDD (sc1)
- Elastic File System (EFS)
- When deploying Db2 Warehouse to EFS, enable
Cloudwatch so that you can monitor all aspects of the EFS storage system, especially the
BurstIOCredit and PercentIOLimit metrics. Add alerts in Cloudwatch to track the BurstCreditBalance threshold.
- Performance modes
- EFS supports two performance modes, General Purpose and Max I/O. Because Max I/O results in higher access latency for higher levels of total I/O throughput, use General Purpose unless the PercentIOLimit metric often reaches 100%.
- Throughput
- EFS uses Bursting Throughput by default. Newly procured file systems start with 2.1 TiB of burst
credits. An EFS file system has an aggregate baseline throughput of 50KiBps for every gibibyte (GiB)
of allocated storage.
EFS also offers a Provisioned Throughput mode, which lets you set the IOPS requirement without having to constantly keep track of the burst credits. However, because this option comes at a higher cost, choose this option only if Bursting Throughput does not satisfy your needs.
To improve performance, fill the filesystem with dummy data.
An EFS file system scales its standard I/O throughput as the size of the file system grows. A metering process runs about once every hour to determine the file system size. Based on the size, the metering process sets the baseline and burst throughput rates. When all burst credits have been consumed, file system throughput drops back to the baseline rate. For example, a 100 GB share sustains 5 Mbps, and 1 TB volume sustains 50 Mbps, but each can burst to 100 Mbps.
- Mount options
- Set the mount options according to the best practices documented by AWS.
- NFS version
- EFS is based on NFS v4.0. Follow the recommended best practices for NFS file volumes. Use the latest Linux version with the latest NFS code and bug fixes.
Vertical scaling
You can stop an AWS server without losing its root file system mount. You can then start a new larger or smaller AWS instance, and use the existing root volume. In this way, you can easily vertically scale your server up or down.